1

I examine address space of process in Windows 7. I use VirtualQueryEx function, and this is some part of my example, where handleOfProcess_ is handle of some process:

MEMORY_BASIC_INFORMATION mbi;
bool ok = (VirtualQueryEx(handleOfProcess_, (LPCVOID)0x00020000, &mbi, sizeof(mbi))== sizeof(mbi));
ok = (VirtualQueryEx(handleOfProcess_, (LPCVOID)0x00021000, &mbi, sizeof(mbi))== sizeof(mbi));

When I do debug, I see, that the AllocationBase of 0x00020000 is 0x00020000, and the Allocationbase of 0x00021000 is 0x00000000, which is the allocationBase of another region.

How can it happen?

Thanks to all.

Unheilig
  • 16,196
  • 193
  • 68
  • 98
user3245337
  • 147
  • 9

1 Answers1

1

From the documentation for MEMORY_BASIC_INFORMATION:

For free pages, the information in the AllocationBase, AllocationProtect, Protect, and Type members is undefined.

Harry Johnston
  • 35,639
  • 6
  • 68
  • 158
  • Thanks, so how can i check whether free block is in a region with some AllocationBase address? Richter don't check in VMMap program whether block is free or not. – user3245337 Mar 10 '14 at 23:44
  • 1
    If a block is free, then by definition it isn't in an allocated region, so there's nothing to check. I don't understand your second sentence at all; who or what is Richter? – Harry Johnston Mar 11 '14 at 02:14
  • Yes you are right. I already understand what i want, so you don't need to understand my second sentence :) thanks again. – user3245337 Mar 11 '14 at 19:29