GetModuleBaseName function Null safety kernel32

int GetModuleBaseName(
  1. int hProcess,
  2. int hModule,
  3. Pointer<Utf16> lpBaseName,
  4. int nSize
)

Retrieves the base name of the specified module.

DWORD K32GetModuleBaseNameW(
  HANDLE  hProcess,
  HMODULE hModule,
  LPWSTR  lpBaseName,
  DWORD   nSize
);

Implementation

int GetModuleBaseName(
    int hProcess, int hModule, Pointer<Utf16> lpBaseName, int nSize) {
  final _GetModuleBaseName = _kernel32.lookupFunction<
      Uint32 Function(IntPtr hProcess, IntPtr hModule,
          Pointer<Utf16> lpBaseName, Uint32 nSize),
      int Function(int hProcess, int hModule, Pointer<Utf16> lpBaseName,
          int nSize)>('K32GetModuleBaseNameW');
  return _GetModuleBaseName(hProcess, hModule, lpBaseName, nSize);
}