GlobalAlloc function kernel32

Win32Result<HGLOBAL> GlobalAlloc(
  1. GLOBAL_ALLOC_FLAGS uFlags,
  2. int dwBytes
)

Allocates the specified number of bytes from the heap.

To learn more, see learn.microsoft.com/windows/win32/api/winbase/nf-winbase-globalalloc.

Implementation

Win32Result<HGLOBAL> GlobalAlloc(GLOBAL_ALLOC_FLAGS uFlags, int dwBytes) {
  final result_ = GlobalAlloc_Wrapper(uFlags, dwBytes);
  return Win32Result(value: HGLOBAL(result_.value.ptr), error: result_.error);
}