GetModuleHandle function Null safety kernel32

int GetModuleHandle(
  1. Pointer<Utf16> lpModuleName
)

Retrieves a module handle for the specified module. The module must have been loaded by the calling process.

HMODULE GetModuleHandleW(
  LPCWSTR lpModuleName
);

Implementation

int GetModuleHandle(Pointer<Utf16> lpModuleName) {
  final _GetModuleHandle = _kernel32.lookupFunction<
      IntPtr Function(Pointer<Utf16> lpModuleName),
      int Function(Pointer<Utf16> lpModuleName)>('GetModuleHandleW');
  return _GetModuleHandle(lpModuleName);
}