RegReplaceKey function advapi32

WIN32_ERROR RegReplaceKey(
  1. HKEY hKey,
  2. PCWSTR? lpSubKey,
  3. PCWSTR lpNewFile,
  4. PCWSTR lpOldFile,
)

Replaces the file backing a registry key and all its subkeys with another file, so that when the system is next started, the key and subkeys will have the values stored in the new file.

To learn more, see learn.microsoft.com/windows/win32/api/winreg/nf-winreg-regreplacekeyw.

Implementation

@pragma('vm:prefer-inline')
WIN32_ERROR RegReplaceKey(
  HKEY hKey,
  PCWSTR? lpSubKey,
  PCWSTR lpNewFile,
  PCWSTR lpOldFile,
) => WIN32_ERROR(
  _RegReplaceKey(hKey, lpSubKey ?? nullptr, lpNewFile, lpOldFile),
);