OpenProcess function Null safety kernel32

int OpenProcess (
  1. int dwDesiredAccess,
  2. int bInheritHandle,
  3. int dwProcessId
)

Opens an existing local process object.

HANDLE OpenProcess(
  DWORD dwDesiredAccess,
  BOOL  bInheritHandle,
  DWORD dwProcessId
);

Implementation

int OpenProcess(int dwDesiredAccess, int bInheritHandle, int dwProcessId) {
  final _OpenProcess = _kernel32.lookupFunction<
      IntPtr Function(
          Uint32 dwDesiredAccess, Int32 bInheritHandle, Uint32 dwProcessId),
      int Function(int dwDesiredAccess, int bInheritHandle,
          int dwProcessId)>('OpenProcess');
  return _OpenProcess(dwDesiredAccess, bInheritHandle, dwProcessId);
}