UpdateResource function Null safety kernel32

int UpdateResource(
  1. int hUpdate,
  2. Pointer<Utf16> lpType,
  3. Pointer<Utf16> lpName,
  4. int wLanguage,
  5. Pointer<NativeType> lpData,
  6. int cb
)

Adds, deletes, or replaces a resource in a portable executable (PE) file.

BOOL UpdateResourceW(
  HANDLE  hUpdate,
  LPCWSTR lpType,
  LPCWSTR lpName,
  WORD    wLanguage,
  LPVOID  lpData,
  DWORD   cb
);

Implementation

int UpdateResource(int hUpdate, Pointer<Utf16> lpType, Pointer<Utf16> lpName,
    int wLanguage, Pointer lpData, int cb) {
  final _UpdateResource = _kernel32.lookupFunction<
      Int32 Function(IntPtr hUpdate, Pointer<Utf16> lpType,
          Pointer<Utf16> lpName, Uint16 wLanguage, Pointer lpData, Uint32 cb),
      int Function(int hUpdate, Pointer<Utf16> lpType, Pointer<Utf16> lpName,
          int wLanguage, Pointer lpData, int cb)>('UpdateResourceW');
  return _UpdateResource(hUpdate, lpType, lpName, wLanguage, lpData, cb);
}