GetProcessHeap (kernel32)
Last changed: -77.64.121.106

.
Summary

C# Signature:

[DllImport("kernel32.dll", SetLastError = true)]
public static extern UInt32 GetProcessHeaps(
    UInt32 NumberOfHeaps,
    IntPtr[] ProcessHeaps);

VB Signature:

Declare Function GetProcessHeaps Lib "kernel32" (ByVal NumberOfHeaps As Integer, ByRef ProcessHeaps As Integer) As Integer

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Although the parameter ProcessHeaps is declared as out in the MSDN, it is in. How else should the method be able to recieve a buffer?

Sample Code:

IntPtr[] buffer;
uint count = GetProcessHeaps(0, null);
buffer = new IntPtr[count];
GetProcessHeaps(count, buffer);

Alternative Managed API:

Do you know one? Please contribute it!

Documentation