user3245337
user3245337

Reputation: 167

Different regions have the same allocation address

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.

Upvotes: 1

Views: 129

Answers (1)

Harry Johnston
Harry Johnston

Reputation: 36328

From the documentation for MEMORY_BASIC_INFORMATION:

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

Upvotes: 1

Related Questions