Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than kernel32, prefix the name with the module name and a period.
HeapCreate (kernel32)
.
Creates a private heap object that can be used by the calling process. The function reserves space in the virtual
address space of the process and allocates physical storage for a specified initial portion of this block.
C# Signature:
/// <summary>
/// HeapCreate - Creates a private heap object that can be used by the calling process.
/// The function reserves space in the virtual address space of the process and allocates
/// physical storage for a specified initial portion of this block.
/// Ref: https://learn.microsoft.com/en-us/windows/win32/api/heapapi/nf-heapapi-heapcreate
/// </summary>
/// <param name="flOptions"></param>
/// <param name="dwInitialSize"></param>
/// <param name="dwMaximumSize"></param>
/// <returns></returns>
[DllImport("kernel32.dll", SetLastError = true)]
static extern IntPtr HeapCreate(UInt32 flOptions, UIntPtr dwInitialSize, UIntPtr dwMaximumSize);
Conversion of Int/Unit32/long/UIntPtr/IntPtr - much debate, this code could be checked properly.
Conversion of Int/Unit32/long/UIntPtr/IntPtr - much debate, this is code be checked properly.
Tips & Tricks:
Please add some!
Sample Code:
/// <summary>
/// HeapCreateMemory - Creates a private heap object that can be used by the
/// calling process. The function reserves space in the virtual address space
/// of the process and allocates physical storage for a specified initial portion of this block.
/// </summary>
/// <param name="optionType"></param>
/// <param name="initialbyteSize"></param>
/// <param name="MaxByteSize"></param>
/// <returns></returns>
public static IntPtr HeapCreateMemory(FLOptionType optionType, int initialbyteSize, int MaxByteSize)
{
try
{
return HeapCreate((UInt32)optionType, (UIntPtr)initialbyteSize, (UIntPtr)MaxByteSize);
}
catch (Exception e)
{
throw e;
}
}
Alternative Managed API:
Do you know one? Please contribute it!
The HeapCreate API
1/26/2023 2:30:07 PM - shtolliver-47.227.243.115
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).