原文来自MSDN Library for Visual Studio 2008 SP1,翻译部分仅为个人观点,想要看更多信息请看MSDN,如有版权问题请联系QQ 64316601,邮件643166601@qq.com
GetProcessHeap Function
Retrieves a handle to the heap of the calling process. This handle can then be used in subsequent calls to the heap functions.
获得一个句柄指向调用进程堆。这个句柄就可以在后来调用堆函数中被使用。
Syntax
HANDLE WINAPI GetProcessHeap(void);
Parameters
This function has no parameters.
这个函数没有参数。
Return Value
If the function succeeds, the return value is a handle to the calling process's heap.
如果函数成功,返回值是一个句柄指向调用进程的堆。
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
如果函数失败,返回值是NULL。获得额外信息。请调用GetLastError。
Remarks
The GetProcessHeap function allows you to allocate memory from the process heap without having to first create a heap using the HeapCreate function.
这个GetProcessHeap函数允许你从进程堆申请内存,不用首先使用HeapCreate函数创建一个堆。
By default, the process heap is a standard heap. To use the low-fragmentation heap, call the HeapSetInformation function.
默认情况下,这个进程堆是一个标准的堆。要使用低碎片堆,调用HeapSetInformation函数。
Example Code
For an example, see AWE Example.
一个例子,请看AWE Example
Requirements
Client Requires Windows Vista, Windows XP, or Windows 2000 Professional.
Server Requires Windows Server 2008, Windows Server 2003, or Windows 2000 Server.
Header Declared in Winbase.h; include Windows.h.
Library Use Kernel32.lib.
DLL Requires Kernel32.dll.
See Also
Heap Functions
HeapAlloc
HeapCreate
HeapDestroy
HeapFree
HeapReAlloc
HeapSize
Memory Management Functions
Send comments about this topic to Microsoft
Build date: 4/24/2008