RegSetKeyValue function Null safety advapi32

int RegSetKeyValue(
  1. int hKey,
  2. Pointer<Utf16> lpSubKey,
  3. Pointer<Utf16> lpValueName,
  4. int dwType,
  5. Pointer<NativeType> lpData,
  6. int cbData
)

Sets the data for the specified value in the specified registry key and subkey.

LSTATUS RegSetKeyValueW(
  HKEY    hKey,
  LPCWSTR lpSubKey,
  LPCWSTR lpValueName,
  DWORD   dwType,
  LPCVOID lpData,
  DWORD   cbData);

Implementation

int RegSetKeyValue(int hKey, Pointer<Utf16> lpSubKey,
    Pointer<Utf16> lpValueName, int dwType, Pointer lpData, int cbData) {
  final _RegSetKeyValue = _advapi32.lookupFunction<
      Int32 Function(
          IntPtr hKey,
          Pointer<Utf16> lpSubKey,
          Pointer<Utf16> lpValueName,
          Uint32 dwType,
          Pointer lpData,
          Uint32 cbData),
      int Function(
          int hKey,
          Pointer<Utf16> lpSubKey,
          Pointer<Utf16> lpValueName,
          int dwType,
          Pointer lpData,
          int cbData)>('RegSetKeyValueW');
  return _RegSetKeyValue(hKey, lpSubKey, lpValueName, dwType, lpData, cbData);
}