EnumProcessModulesEx function Null safety psapi

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

Retrieves a handle for each module in the specified process that meets the specified filter criteria.

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

Implementation

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