HeapCreate function kernel32

Win32Result<HANDLE> HeapCreate(
  1. HEAP_FLAGS flOptions,
  2. int dwInitialSize,
  3. int dwMaximumSize
)

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.

To learn more, see learn.microsoft.com/windows/win32/api/heapapi/nf-heapapi-heapcreate.

Implementation

Win32Result<HANDLE> HeapCreate(
  HEAP_FLAGS flOptions,
  int dwInitialSize,
  int dwMaximumSize,
) {
  final result_ = HeapCreate_Wrapper(flOptions, dwInitialSize, dwMaximumSize);
  return .new(value: .new(result_.value.ptr), error: result_.error);
}