Kernel32FreeUserPhysicalPages(IntPtr, IntPtr, IntPtr) Method

Frees physical memory pages that are allocated previously by using AllocateUserPhysicalPages(IntPtr, IntPtr, IntPtr) or AllocateUserPhysicalPagesNuma(IntPtr, IntPtr, IntPtr, UInt32).

If any of these pages are currently mapped in the Address Windowing Extensions (AWE) region, they are automatically unmapped by this call.

This does not affect the virtual address space that is occupied by a specified Address Windowing Extensions (AWE) region.

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", SetLastError = true)]
public static bool FreeUserPhysicalPages(
	IntPtr hProcess,
	ref IntPtr refNumberOfPages,
	IntPtr pageArray
)

Parameters

hProcess  IntPtr
A handle to a process.

The function frees memory within the virtual address space of this process.

refNumberOfPages  IntPtr
The size of the physical memory to free, in pages.

On return, if the function fails, this parameter indicates the number of pages that are freed.

pageArray  IntPtr
A pointer to an array of page frame numbers of the allocated memory to be freed.

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value is , in this case, the refNumberOfPages parameter reflect how many pages have actually been released.

To get extended error information, call GetLastWin32Error.

Remarks

See Also