HeapAlloc function Null safety kernel32

Pointer<NativeType> HeapAlloc(
  1. int hHeap,
  2. int dwFlags,
  3. int dwBytes

Allocates a block of memory from a heap. The allocated memory is not movable.

LPVOID HeapAlloc(
  HANDLE hHeap,
  DWORD  dwFlags,
  SIZE_T dwBytes


Pointer HeapAlloc(int hHeap, int dwFlags, int dwBytes) {
  final _HeapAlloc = _kernel32.lookupFunction<
      Pointer Function(IntPtr hHeap, Uint32 dwFlags, IntPtr dwBytes),
      Pointer Function(int hHeap, int dwFlags, int dwBytes)>('HeapAlloc');
  return _HeapAlloc(hHeap, dwFlags, dwBytes);