I've had no problems using VirtualQuery in my x64 apps, and have not noticed the behavior you are describing (I am able to enumerate free memory blocks fine). I think that either your code is wrong, or your compiler is doing something wrong.
Would you mind posting the relevant snippets of your source code, along with a disassembly of the code generated by the compiler, so we can try and figure out what's going on?
As a reference, here's my memory region enumeration code which works for both native x86 and x64.
https://code.google.com/p/hadesmem/source/browse/trunk/Include/Memory/HadesMemory/Region.hpp
https://code.google.com/p/hadesmem/source/browse/trunk/Src/Memory/Memory/Region.cpp
|