QueryVirtualMemoryInformation function

The QueryVirtualMemoryInformation function returns information about a page or a set of pages within the virtual address space of the specified process.

Syntax

BOOL QueryVirtualMemoryInformation(
  HANDLE                         Process,
  const VOID                     *VirtualAddress,
  WIN32_MEMORY_INFORMATION_CLASS MemoryInformationClass,
  PVOID                          MemoryInformation,
  SIZE_T                         MemoryInformationSize,
  PSIZE_T                        ReturnSize
);

Parameters

Process

A handle for the process in whose context the pages to be queried reside.

VirtualAddress

The address of the region of pages to be queried. This value is rounded down to the next host-page-address boundary.

MemoryInformationClass

The memory information class about which to retrieve information. The only supported value is MemoryRegionInfo.

MemoryInformation

A pointer to a buffer that receives the specified information.

If the MemoryInformationClass parameter has a value of MemoryRegionInfo, this parameter must point to a WIN32_MEMORY_REGION_INFORMATION structure.

MemoryInformationSize

Specifies the length in bytes of the memory information buffer.

ReturnSize

An optional pointer which, if specified, receives the number of bytes placed in the memory information buffer.

Return Value

Returns TRUE on success. Returns FALSE for failure. To get extended error information, call GetLastError.

Remarks

If the MemoryInformationClass parameter has a value of MemoryRegionInfo, the MemoryInformation parameter must point to a WIN32_MEMORY_REGION_INFORMATION structure. The VirtualAddress parameter must point to an address within a valid memory allocation. If the VirtualAddress parameter points to an unallocated memory region, the function fails.

Requirements

   
Windows version Windows 10, version 1607 [desktop apps only] Windows Server 2016 [desktop apps only]
Target Platform Windows
Header memoryapi.h (include Windows.h)
Library Onecore.lib
DLL Api-ms-win-core-memory-l1-1-4.dll

See Also

GetLastError

MEMORY_BASIC_INFORMATION

WIN32_MEMORY_REGION_INFORMATION