RegSetValue function Null safety advapi32

int RegSetValue(
  1. int hKey,
  2. Pointer<Utf16> lpSubKey,
  3. int dwType,
  4. Pointer<Utf16> lpData,
  5. int cbData
)

Sets the data for the default or unnamed value of a specified registry key. The data must be a text string.

LSTATUS RegSetValueW(
  HKEY    hKey,
  LPCWSTR lpSubKey,
  DWORD   dwType,
  LPCWSTR lpData,
  DWORD   cbData);

Implementation

int RegSetValue(int hKey, Pointer<Utf16> lpSubKey, int dwType,
    Pointer<Utf16> lpData, int cbData) {
  final _RegSetValue = _advapi32.lookupFunction<
      Int32 Function(IntPtr hKey, Pointer<Utf16> lpSubKey, Uint32 dwType,
          Pointer<Utf16> lpData, Uint32 cbData),
      int Function(int hKey, Pointer<Utf16> lpSubKey, int dwType,
          Pointer<Utf16> lpData, int cbData)>('RegSetValueW');
  return _RegSetValue(hKey, lpSubKey, dwType, lpData, cbData);
}