EnumProcessModules function Null safety psapi

int EnumProcessModules (
  1. int hProcess,
  2. Pointer<IntPtr> lphModule,
  3. int cb,
  4. Pointer<Uint32> lpcbNeeded
)

Retrieves a handle for each module in the specified process.

BOOL EnumProcessModules(
  HANDLE  hProcess,
  HMODULE *lphModule,
  DWORD   cb,
  LPDWORD lpcbNeeded
);

Implementation

int EnumProcessModules(int hProcess, Pointer<IntPtr> lphModule, int cb,
    Pointer<Uint32> lpcbNeeded) {
  final _EnumProcessModules = _psapi.lookupFunction<
      Int32 Function(IntPtr hProcess, Pointer<IntPtr> lphModule, Uint32 cb,
          Pointer<Uint32> lpcbNeeded),
      int Function(int hProcess, Pointer<IntPtr> lphModule, int cb,
          Pointer<Uint32> lpcbNeeded)>('EnumProcessModules');
  return _EnumProcessModules(hProcess, lphModule, cb, lpcbNeeded);
}