EnumResourceTypes function Null safety kernel32

int EnumResourceTypes(
  1. int hModule,
  2. Pointer<NativeFunction<EnumResTypeProc>> lpEnumFunc,
  3. int lParam
)

Enumerates resource types within a binary module. Starting with Windows Vista, this is typically a language-neutral Portable Executable (LN file), and the enumeration also includes resources from one of the corresponding language-specific resource files (.mui files)—if one exists—that contain localizable language resources. It is also possible to use hModule to specify a .mui file, in which case only that file is searched for resource types.

BOOL EnumResourceTypesW(
  HMODULE          hModule,
  ENUMRESTYPEPROCW lpEnumFunc,
  LONG_PTR         lParam
);

Implementation

int EnumResourceTypes(int hModule,
    Pointer<NativeFunction<EnumResTypeProc>> lpEnumFunc, int lParam) {
  final _EnumResourceTypes = _kernel32.lookupFunction<
      Int32 Function(IntPtr hModule,
          Pointer<NativeFunction<EnumResTypeProc>> lpEnumFunc, IntPtr lParam),
      int Function(
          int hModule,
          Pointer<NativeFunction<EnumResTypeProc>> lpEnumFunc,
          int lParam)>('EnumResourceTypesW');
  return _EnumResourceTypes(hModule, lpEnumFunc, lParam);
}