XMemMapPhysicalPagesScatter
Maps physical pages into virtual memory.Syntax
Parameters
*VirtualAddressArray _In_Type: PVOID The array of virtual addresses at which the pages should be mapped. This parameter cannot be set to
NULL. Use XMemVirtualAlloc with MEM_RESERVE and XMEM_MAPPABLE to reserve a memory address range to use with XMemMapPhysicalPagesScatter. The reserved virtual addresses must also be created with 64k pages through the MEM_64K_PAGES option with XMemVirtualAlloc.
NumberOfPages _In_Type: ULONG_PTR The number of entries in PageArray and VirtualAddressArray. Only 64k pages reserved through XMemVirtualAlloc using the MEM_64K_PAGES option are supported. PageArray _In_reads_opt_(NumberOfPages)
Type: PULONG_PTR The array of Page Frame Numbers (PFNs) representing the physical pages to map. This parameter can be set to
NULL. If PageArray is set to NULL, then this function performs an unmap operation. If an individual entry in the array is set to NULL, then the corresponding Virtual Address is unmapped.
Return value
Type: BOOL ReturnsTRUE if mapping was successful, otherwise, FALSE if there was a mapping failure.
Remarks
This function treatsVirtualAddressArray and PageArray as parallel arrays with the same length, as specified by NumberOfPages. Each virtual address in an array element of VirtualAddressArray is mapped or unmapped depending on PageArray:
- If an array element in
PageArrayis set to a PFN, then the virtual address in the corresponding array element inVirtualAddressArrayis mapped to that PFN. - If an array element in
PageArrayis set toNULL, then the virtual address in the corresponding array element inVirtualAddressArrayis unmapped. - If
PageArrayis set toNULL, then every virtual address inVirtualAddressArrayis unmapped.
Requirements
Header: xmem.h Library: xmem.lib Supported platforms: XBOX One family consoles and XBOX Series consolesSee also
XMemVirtualAllocXMem
