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

# RegGetValueW(3w)

## NAME

**RegGetValueW** (ADVAPI32.@)

## SYNOPSIS

LSTATUS RegGetValueW\
  (\
   HKEY    *hKey*,\
   LPCWSTR *pszSubKey*,\
   LPCWSTR *pszValue*,\
   DWORD   *dwFlags*,\
   LPDWORD *pdwType*,\
   PVOID   *pvData*,\
   LPDWORD *pcbData*\
  )

## DESCRIPTION

Retrieves the type and data for a value name associated with a key, optionally expanding its content and restricting its type.

## PARAMS

*hKey* **\[In\]**  Handle to an open key.

*pszSubKey* **\[In\]**  Name of the subkey of *hKey*.

*pszValue* **\[In\]**  Name of value under *hKey*/szSubKey to query.

*dwFlags* **\[In\]**  Flags restricting the value type to retrieve.

*pdwType* **\[Out\]**  Destination for the values type, may be **NULL**.

*pvData* **\[Out\]**  Destination for the values content, may be **NULL**.

*pcbData* **\[In/Out\]**  Size of *pvData*, updated with the size in bytes required to retrieve the whole content, including the trailing **' '** for strings.

## RETURNS

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

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

## NOTES

**-** Unless **RRF\_NOEXPAND** is specified, **REG\_EXPAND\_SZ** values are automatically expanded and *pdwType* is set to **REG\_SZ** instead.

**-** Restrictions are applied after expanding, using **RRF\_RT\_REG\_EXPAND\_SZ** without **RRF\_NOEXPAND** is thus not allowed. An exception is the case where **RRF\_RT\_ANY** is specified, because then **RRF\_NOEXPAND** is allowed.

## IMPLEMENTATION

Declared in **"shlwapi.h"**.

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

Debug channel **"reg"**.
