Platform SDK: Memory |
The AllocateUserPhysicalPages function allocates physical memory pages to be mapped and unmapped within any Address Windowing Extensions (AWE) region of the specified process.
BOOL AllocateUserPhysicalPages( HANDLE hProcess, // handle to process PULONG_PTR NumberOfPages, // number of pages PULONG_PTR UserPfnArray // address of storage );
Do not attempt to modify this buffer. It contains operating system data, corruption of which could be catastrophic. There is no information in it that is useful to your application.
If the function succeeds, the return value is TRUE. Fewer pages than requested may actually be allocated. The caller must check the value of the NumberOfPages parameter on return to see how many pages were allocated. All allocated page frame numbers are sequentially placed in the memory pointed to by the UserPfnArray parameter.
If the function fails, the return value is FALSE and no frames are allocated. To get extended error information, call GetLastError.
The AllocateUserPhysicalPages function is used to allocate physical memory. Memory allocated by this function must be physically present in the system. Once allocated, it is locked down and unavailable to the rest of the virtual memory management system of Windows 2000.
Note that a given physical page cannot be simultaneously mapped at more than one virtual address.
Physical pages can reside at any physical address. You should make no assumptions about the contiguity of the physical pages.
Use the GetSystemInfo function to determine the page size of the computer.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Unsupported.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.
Memory Management Overview, Memory Management Functions, Address Windowing Extensions, MapUserPhysicalPages, MapUserPhysicalPagesScatter, FreeUserPhysicalPages, GetSystemInfo