Kernel32GetProcessHeaps Method

Returns the number of active heaps and retrieves handles to all of the active heaps for the calling process.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", SetLastError = true)]
public static uint GetProcessHeaps(
	[OptionalAttribute] uint numberOfHeaps,
	[OptionalAttribute] IntPtr[] processHeaps
)

Parameters

numberOfHeaps  UInt32  (Optional)
The maximum number of heap handles that can be stored into the buffer pointed to by ProcessHeaps.
processHeaps  IntPtr  (Optional)
A pointer to a buffer that receives an array of heap handles.

Return Value

UInt32
The return value is the number of handles to heaps that are active for the calling process.

If the return value is less than or equal to numberOfHeaps, the function has stored that number of heap handles in the buffer pointed to by processHeaps.

If the return value is greater than numberOfHeaps, the buffer pointed to by processHeaps is too small to hold all the heap handles for the calling process, and the function stores numberOfHeaps handles in the buffer.

Use the return value to allocate a buffer that is large enough to receive all of the handles, and call the function again.

If the return value is zero, the function has failed because every process has at least one active heap, the default heap for the process.

Remarks

See Also