网站首页  词典首页

请输入您要查询的函数:

 

术语 allocateuserphysicalpages
释义 AllocateUserPhysicalPages
语法:
C++
BOOL WINAPI AllocateUserPhysicalPages(
__in HANDLE hProcess,
__inout PULONG_PTR NumberOfPages,
__out PULONG_PTR UserPfnArray
);
AllocateUserPhysicalPages功能
分配物理内存页被映射和在任何映射的地址窗口扩展(AWE)的指明工序地区。
64位Itanium的Windows系统:由于在页面大小的差异,AllocateUserPhysicalPages不支持32位应用程序。
参数
hProcess [in]
句柄的进程。
函数分配内存,以后可以在这一进程的虚拟地址空间映射。句柄必须有PROCESS_VM_OPERATION访问权。有关更多信息,请参见过程的安全性和访问权限。
NumberOfPages [ in , out ]
的物理内存大小分配,在页。
要确定计算机的页面大小,使用的GetSystemInfo函数。对产出,该参数接收的,实际的分配,这可能是数少于要求的页数。
UserPfnArray [out]
对一个数组的指针来存储分配的内存页面帧编号。
的是分配的数组的大小应至少NumberOfPages倍的ULONG_PTR数据类型的大小。
不要试图修改此缓冲区。它包含操作系统数据,以及腐败将会是灾难性的。缓冲区中的信息是没有用的应用程序。
返回值
如果函数成功,返回值为TRUE。
不到请求的页面可以分配。调用者必须检查返回的NumberOfPages参数的值,看看有多少页均分配。所有分配的页面帧编号按顺序放置在内存中指出,由UserPfnArray参数。
如果函数失败,返回值为FALSE,并没有帧分配。为了获得更多错误信息,调用GetLastError。
备注
该AllocateUserPhysicalPages函数用于分配物理内存以后可以在进程的虚拟地址空间映射。该SeLockMemoryPrivilege特权必须启用呼叫方的令牌或函数将失败,ERROR_PRIVILEGE_NOT_HELD。有关更多信息,请参阅权限常量。
这个函数分配的内存必须实际存在于该系统。后分配内存,将被锁定和不可用的虚拟内存管理系统的其余部分。
物理页不能同时映射在多个虚拟地址。
物理页可以驻留在任何物理地址。您应该对物理页毗连的任何假设。
要编译的应用程序使用此函数,定义为0x0500或更高_WIN32_WINNT宏。有关详细信息,请参阅使用Windows头。
实例
有关示例,请参阅awe例子。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
地址窗口扩展
AllocateUserPhysicalPagesNuma
FreeUserPhysicalPages
内存管理功能
MapUserPhysicalPages
MapUserPhysicalPagesScatter
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==AllocateUserPhysicalPages Function
Allocates physical memory pages to be mapped and unmapped within any Address Windowing Extensions (AWE) region of a specified process.
64-bit Windows on Itanium-based systems: Due to the difference in page sizes, AllocateUserPhysicalPages is not supported for 32-bit applications.
Syntax
C++
BOOL WINAPI AllocateUserPhysicalPages(
__in HANDLE hProcess,
__inout PULONG_PTR NumberOfPages,
__out PULONG_PTR UserPfnArray
);
Parameters
hProcess [in]
A handle to a process.
The function allocates memory that can later be mapped within the virtual address space of this process. The handle must have the PROCESS_VM_OPERATION access right. For more information, see Process Security and Access Rights .
NumberOfPages [in, out]
The size of the physical memory to allocate, in pages.
To determine the page size of the computer, use the GetSystemInfo function. On output, this parameter receives the number of pages that are actually allocated, which might be less than the number requested.
UserPfnArray [out]
A pointer to an array to store the page frame numbers of the allocated memory.
The size of the array that is allocated should be at least the NumberOfPages times the size of the ULONG_PTR data type.
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
If the function succeeds, the return value is TRUE.
Fewer pages than requested can be allocated. The caller must check the value of the NumberOfPages parameter on return to see how many pages are 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 .
Remarks
The AllocateUserPhysicalPages function is used to allocate physical memory that can later be mapped within the virtual address space of the process. The SeLockMemoryPrivilege privilege must be enabled in the caller's token or the function will fail with ERROR_PRIVILEGE_NOT_HELD. For more information, see Privilege Constants .
Memory allocated by this function must be physically present in the system. After the memory is allocated, it is locked down and unavailable to the rest of the virtual memory management system.
Physical pages 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.
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 clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
Address Windowing Extensions
AllocateUserPhysicalPagesNuma
FreeUserPhysicalPages
Memory Management Functions
MapUserPhysicalPages
MapUserPhysicalPagesScatter
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa366528(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:25:49