Retrieves a handle to the default 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.
Remarks
The
GetProcessHeap function obtains a handle to the default heap for the calling process. A process can use this handle to allocate memory from the process heap without having to first create a private heap using the
HeapCreate function.
Windows Server 2003, Windows XP, and Windows 2000 with SP4 and hotfix KB 816542: To enable the low-fragmentation heap for the default heap of the process, call the
HeapSetInformation function with the handle returned by
GetProcessHeap.
Examples
For an example, see Getting Process Heaps.
Requirements
| Minimum supported client | Windows 2000 Professional |
| Minimum supported server | Windows 2000 Server |
| Header | Winbase.h (include Windows.h) |
| Library | Kernel32.lib |
| DLL | Kernel32.dll |
See Also
- Heap Functions
- HeapCreate
- Memory
Management Functions
Send comments about this topic to Microsoft
Build date: 11/19/2009