LoadLibrary function Null safety kernel32

int LoadLibrary(
  1. Pointer<Utf16> lpLibFileName
)

Loads the specified module into the address space of the calling process. The specified module may cause other modules to be loaded.

HMODULE LoadLibraryW(
  LPCWSTR lpLibFileName
);

Implementation

int LoadLibrary(Pointer<Utf16> lpLibFileName) {
  final _LoadLibrary = _kernel32.lookupFunction<
      IntPtr Function(Pointer<Utf16> lpLibFileName),
      int Function(Pointer<Utf16> lpLibFileName)>('LoadLibraryW');
  return _LoadLibrary(lpLibFileName);
}