Kernel32MapUserPhysicalPages(IntPtr, UIntPtr, UIntPtr) Method

Maps previously allocated physical memory pages at a specified address in an Address Windowing Extensions (AWE) region.

The contents of discarded memory is undefined and must be rewritten by the application.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", ExactSpelling = true, SetLastError = true)]
public static bool MapUserPhysicalPages(
	IntPtr address,
	ref UIntPtr refNumberOfPages,
	UIntPtr pageArray
)

Parameters

address  IntPtr
A pointer to the starting address of the region of memory to remap.

The value of address must be within the address range that the VirtualAlloc(IntPtr, IntPtr, MemoryAllocationType, MemoryProtectionOptions) function returns when the Address Windowing Extensions (AWE) region is allocated.

refNumberOfPages  UIntPtr
The size of the physical memory and virtual address space for which to establish translations, in pages.

The virtual address range is contiguous starting at address. The physical frames are specified by the pageArray.

The total number of pages cannot extend from the starting address beyond the end of the range that is specified in AllocateUserPhysicalPages(IntPtr, IntPtr, IntPtr).

pageArray  UIntPtr
A pointer to an array of physical page frame numbers.

These frames are mapped by the argument address on return from this function.

The size of the memory that is allocated should be at least the refNumberOfPages times the size of the data type ULONG_PTR.

Caution: Do not attempt to modify this buffer. It contains operating system data, and corruption could be catastrophic. The information in the buffer is not useful to an application.

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value is and no mapping is done—partial or otherwise.

To get extended error information, call GetLastWin32Error.

Remarks

See Also