RegSaveKeyEx function Null safety advapi32

int RegSaveKeyEx(
  1. int hKey,
  2. Pointer<Utf16> lpFile,
  3. Pointer<SECURITY_ATTRIBUTES> lpSecurityAttributes,
  4. int Flags
)

Saves the specified key and all of its subkeys and values to a registry file, in the specified format.

LSTATUS RegSaveKeyExW(
  HKEY                        hKey,
  LPCWSTR                     lpFile,
  const LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  DWORD                       Flags);

Implementation

int RegSaveKeyEx(int hKey, Pointer<Utf16> lpFile,
    Pointer<SECURITY_ATTRIBUTES> lpSecurityAttributes, int Flags) {
  final _RegSaveKeyEx = _advapi32.lookupFunction<
      Int32 Function(IntPtr hKey, Pointer<Utf16> lpFile,
          Pointer<SECURITY_ATTRIBUTES> lpSecurityAttributes, Uint32 Flags),
      int Function(
          int hKey,
          Pointer<Utf16> lpFile,
          Pointer<SECURITY_ATTRIBUTES> lpSecurityAttributes,
          int Flags)>('RegSaveKeyExW');
  return _RegSaveKeyEx(hKey, lpFile, lpSecurityAttributes, Flags);
}