Export (0) Print
Expand All
Expand Minimize

FreeUserPhysicalPages function

Frees physical memory pages that are allocated previously by using AllocateUserPhysicalPages or AllocateUserPhysicalPagesNuma. 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.

64-bit Windows on Itanium-based systems:  Due to the difference in page sizes, FreeUserPhysicalPages is not supported for 32-bit applications.

Syntax


BOOL WINAPI FreeUserPhysicalPages(
  _In_     HANDLE hProcess,
  _Inout_  PULONG_PTR NumberOfPages,
  _In_     PULONG_PTR UserPfnArray
);

Parameters

hProcess [in]

The handle to a process.

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

NumberOfPages [in, out]

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.

UserPfnArray [in]

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

Return value

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE. In this case, the NumberOfPages parameter reflect how many pages have actually been released. To get extended error information, call GetLastError.

Remarks

In a multiprocessor environment, this function maintains coherence of the hardware translation buffer. When this function returns, all threads on all processors are guaranteed to see the correct mapping.

To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0500 or later. For more information, see Using the Windows Headers.

Examples

For an example, see AWE Example.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

WinBase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

Address Windowing Extensions
AllocateUserPhysicalPages
AllocateUserPhysicalPagesNuma
MapUserPhysicalPages
MapUserPhysicalPagesScatter
Memory Management Functions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft