EnumResourceNames function Null safety kernel32

int EnumResourceNames(
  1. int hModule,
  2. Pointer<Utf16> lpType,
  3. Pointer<NativeFunction<EnumResNameProc>> lpEnumFunc,
  4. int lParam
)

Enumerates resources of a specified type within a binary module. For Windows Vista and later, this is typically a language-neutral Portable Executable (LN file), and the enumeration will also include resources from the corresponding language-specific resource files (.mui files) that contain localizable language resources. It is also possible for hModule to specify an .mui file, in which case only that file is searched for resources.

BOOL EnumResourceNamesW(
  HMODULE          hModule,
  LPCWSTR          lpType,
  ENUMRESNAMEPROCW lpEnumFunc,
  LONG_PTR         lParam
);

Implementation

int EnumResourceNames(int hModule, Pointer<Utf16> lpType,
    Pointer<NativeFunction<EnumResNameProc>> lpEnumFunc, int lParam) {
  final _EnumResourceNames = _kernel32.lookupFunction<
      Int32 Function(IntPtr hModule, Pointer<Utf16> lpType,
          Pointer<NativeFunction<EnumResNameProc>> lpEnumFunc, IntPtr lParam),
      int Function(
          int hModule,
          Pointer<Utf16> lpType,
          Pointer<NativeFunction<EnumResNameProc>> lpEnumFunc,
          int lParam)>('EnumResourceNamesW');
  return _EnumResourceNames(hModule, lpType, lpEnumFunc, lParam);
}