Skip to main content

XMemVirtualQuery

Retrieves information about a range of pages in the virtual address space of the calling process.

Syntax

Parameters

Process   _In_
Type: HANDLE
A process handle, typically obtained by calling GetCurrentProcess. Address   _In_opt_
Type: PVOID
A pointer to the base address of the region of pages to be queried. This value is rounded down to the next page boundary. If this parameter is set to an address above the highest memory address accessible to the process, the function fails with an error code set to ERROR_INVALID_PARAMETER. Buffer   _Out_
Type: PXMEM_BASIC_INFORMATION
A pointer to a XMEM_BASIC_INFORMATION structure in which information about the specified page range is returned.

Return value

Type: BOOL Returns TRUE if successful; otherwise, FALSE. To get extended error information, call GetLastError.

Remarks

Tools can pass the handle to a remote process, to query the title from outside of the current process. If the queried region of memory has an optional four-character code tag associated with it, the tag is included in the TagFourCC field and encoded as a 24-bit representation in the TagCode field of the XMEM_BASIC_INFORMATION structure returned in Buffer. Otherwise, the TagFourCC field is filled with NULL values and the TagCode field should be ignored. For more information about tags, see XMemVirtualAlloc. Example: To compute the total memory usage for the memory that is allocated by a direct call to ‘XMemVirtualAlloc’, a combination of ‘XMemSetOption’ and ‘XMemVirtualQuery’ is needed.

Requirements

Header: xmem.h Library: xmem.lib Supported platforms: XBOX One family consoles and XBOX Series consoles

See also

XMEM_BASIC_INFORMATION
XMem
Last modified on August 20, 2026