GetProcAddress function Null safety kernel32

int GetProcAddress(
  1. int hModule,
  2. Pointer<Utf8> lpProcName

Retrieves the address of an exported function or variable from the specified dynamic-link library (DLL).

FARPROC GetProcAddress(
  HMODULE hModule,
  LPCSTR  lpProcName


int GetProcAddress(int hModule, Pointer<Utf8> lpProcName) {
  final _GetProcAddress = _kernel32.lookupFunction<
      IntPtr Function(IntPtr hModule, Pointer<Utf8> lpProcName),
      int Function(int hModule, Pointer<Utf8> lpProcName)>('GetProcAddress');
  return _GetProcAddress(hModule, lpProcName);