[This is preliminary documentation and subject to change.]
The VirtualQueryVlm function provides information about a range of pages within the virtual address space of a specified process.
DWORD VirtualQueryVlm(
HANDLE hProcess, // handle of process
PVOID64 lpAddress, // address of region
PMEMORY_BASIC_INFORMATION_VLM lpBuffer,
// address of information buffer
DWORD dwLength // size of buffer
);
If the function succeeds, the return value is the actual number of bytes returned in the buffer in the lpBuffer parameter.
If the function fails, the return value is zero.
VirtualQueryVlm provides information about a region of consecutive pages beginning at a specified address that share the following attributes:
VirtualQueryVlm determines the attributes of the first page in the region and then scans subsequent pages. This scan continues until VirtualQueryVlm either scans the entire range of pages or encounters a page with attributes that do not match those of the first page. VirtualQueryVlm returns the attributes and the size, in bytes, of the region of pages with attributes that match those of the first page. For example, if there is a 40-MB region of free memory and VirtualQueryVlm is called for a page that is 10 MB into the region, VirtualQueryVlm retrieves a state of MEM_FREE and a size of 30 MB.
VirtualQueryVlm is identical to the VirtualQueryEx function, except that it provides information about memory allocated using VirtualAllocVlm.
VirtualQueryVlm sets all members in the lpBuffer MEMORY_BASIC_INFORMATION_VLM structure in all cases because certain members in the structure depend on the values of other members. For example, the Type member is not filled for a MEM_FREE region, and the Protect member is not filled if region queried is not committed to memory. All members are filled with useful information wherever possible.
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
Memory Management Overview, Memory Management Functions, Very Large Memory (VLM), GetSystemInfo, MEMORY_BASIC_INFORMATION_VLM, VirtualAllocVlm, VirtualQueryEx, VirtualQuery