VirtualQuery gives illegal result. Is it a bug?

Posted by Shimon Newman on Stack Overflow See other posts from Stack Overflow or by Shimon Newman
Published on 2009-10-05T10:52:52Z Indexed on 2010/03/12 22:47 UTC
Read the original article Hit count: 190

Filed under:

My code:

MEMORY_BASIC_INFORMATION meminf;
::VirtualQuery(box.pBits, &meminf, sizeof(meminf));

The results:

   meminf:
    BaseAddress          0x40001000    void *
    AllocationBase       0x00000000    void *
    AllocationProtect    0x00000000    unsigned long
    RegionSize           0x0de0f000    unsigned long
    State                0x00010000    unsigned long
    Protect              0x00000001    unsigned long
    Type                 0x00000000    unsigned long

Notes:

(1) AllocationBase is NULL while BaseAddress is not NULL
(2) AllocationProtect is 0 (not a protection value)

Is it a bug of VirtualQuery?

© Stack Overflow or respective owner

Related posts about virtualquery