Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3301716
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:46:45+00:00 2026-05-17T20:46:45+00:00

I have a list which contains a number of _MEMORY_BASIC_INFORMATION structs nested within mb

  • 0

I have a list which contains a number of _MEMORY_BASIC_INFORMATION structs nested within mb structs (defs below). What I am having problems with is getting the info from the nested _MEMORY_BASIC_INFORMATION out. I am using an iterator to traverse the list. From below I know the error is g->mbi; but I don’t know how I should reference the nested struct… Thanks.

Basically I am trying to write the base address from gMemList[i] to start = (DWORD)g.mbi.BaseAddress; but I am getting the error c2228: left of ‘.mbi’ must have a class/struct/union.

list<struct mb *> gMemList

std::list<mb *>::iterator i = gMemList.begin();
while(i != gMemList.end())
{
    struct mb *g = *i;
    MEMORY_BASIC_INFORMATION mbi2 = g->mbi;
    start = (DWORD)mbi2.BaseAddress;
    buf = new wchar_t[255];
        while(start < mbi2.RegionSize)
    {...

//struct mb
//{
//  MEMORY_BASIC_INFORMATION mbi;
//  char *p;
//};

/*typedef struct _MEMORY_BASIC_INFORMATION {
PVOID BaseAddress;
PVOID AllocationBase;
DWORD AllocationProtect;
SIZE_T RegionSize;
DWORD State;
DWORD Protect;
DWORD Type;
} MEMORY_BASIC_INFORMATION, *PMEMORY_BASIC_INFORMATION;*/
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T20:46:45+00:00Added an answer on May 17, 2026 at 8:46 pm

    When posting such a problem, it is always extremely helpful to include the specific error message that you get from your compiler.

    At the first sight I can’t see why your code does not compile. However, you should be aware that your assignment of mbi2 does create a copy of the whole _MEMORY_BASIC_INFORMATION structure. (And maybe that is the source of the problem here.) You probably do not need to copy the structure, if I understand your case correctly, since you only want to get some information from it.

    Try this:

    _MEMORY_BASIC_INFORMATION &mbi2=(*i)->mbi;
    

    If you do not need to change anything in mbi2, you should definitely use a const reference:

    const _MEMORY_BASIC_INFORMATION &mbi2=(*i)->mbi;
    

    Always remember that const-correctness is your friend!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list which contains a number of things: lista = ['a', 'b',
I have a list which contains 1-5 lists within it. I want to return
I have a Request object which contains a list of Approvers. An approver has
I have a base class Node which contains a list of child nodes. Node
I have an array that contains a list of vertices which I copy to
I have a List which contains a list of objects and I want to
I have a table called changes which contains a list of record numbers the
I have a Node class that has an 'element' slot which contains a list
I have list of vertices i.e List<Point> , which contains following points for square:
I have two List's which I want to check for corresponding numbers. for example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.