RegSetValueEx function Null safety advapi32

int RegSetValueEx (
  1. int hKey,
  2. Pointer<Utf16> lpValueName,
  3. int Reserved,
  4. int dwType,
  5. Pointer<Uint8> lpData,
  6. int cbData
)

Sets the data and type of a specified value under a registry key.

LSTATUS RegSetValueExW(
  HKEY       hKey,
  LPCWSTR    lpValueName,
  DWORD      Reserved,
  DWORD      dwType,
  const BYTE *lpData,
  DWORD      cbData
);

Implementation

int RegSetValueEx(int hKey, Pointer<Utf16> lpValueName, int Reserved,
    int dwType, Pointer<Uint8> lpData, int cbData) {
  final _RegSetValueEx = _advapi32.lookupFunction<
      Int32 Function(IntPtr hKey, Pointer<Utf16> lpValueName, Uint32 Reserved,
          Uint32 dwType, Pointer<Uint8> lpData, Uint32 cbData),
      int Function(int hKey, Pointer<Utf16> lpValueName, int Reserved,
          int dwType, Pointer<Uint8> lpData, int cbData)>('RegSetValueExW');
  return _RegSetValueEx(hKey, lpValueName, Reserved, dwType, lpData, cbData);
}