---
name: "RegReplaceKeyW"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/RegReplaceKeyW"
---

# RegReplaceKeyW(3w)

## NAME

**RegReplaceKeyW** (ADVAPI32.@)

## SYNOPSIS

LSTATUS RegReplaceKeyW\
  (\
   HKEY    *hkey*,\
   LPCWSTR *lpSubKey*,\
   LPCWSTR *lpNewFile*,\
   LPCWSTR *lpOldFile*\
  )

## DESCRIPTION

Replace the file backing a registry key and all its subkeys with another file.

## PARAMS

*hkey* **\[In\]**  Handle of open key.

*lpSubKey* **\[In\]**  Address of name of subkey.

*lpNewFile* **\[In\]**  Address of filename for file with new data.

*lpOldFile* **\[In\]**  Address of filename for backup file.

## RETURNS

**Success:** **ERROR\_SUCCESS**

**Failure:** nonzero error code from Winerror.h

## IMPLEMENTATION

Declared in **"winreg.h"**.

Implemented in **"dlls/advapi32/registry.c"**.

Debug channel **"reg"**.
