GlobalFree function kernel32

Win32Result<HGLOBAL> GlobalFree(
  1. HGLOBAL? hMem
)

Frees the specified global memory object and invalidates its handle.

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

Implementation

Win32Result<HGLOBAL> GlobalFree(HGLOBAL? hMem) {
  final result_ = GlobalFree_Wrapper(hMem ?? nullptr);
  return .new(value: .new(result_.value.ptr), error: result_.error);
}