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

# QueryRegistryValue(3w)

## NAME

**QueryRegistryValue** (SETUPAPI.@)

## SYNOPSIS

LONG QueryRegistryValue\
  (\
   HKEY    *hKey*,\
   LPCWSTR *lpValueName*,\
   LPBYTE\* *lpData*,\
   LPDWORD *lpType*,\
   LPDWORD *lpcbData*\
  )

## DESCRIPTION

Retrieves value data from the registry and allocates memory for the value data.

## PARAMS

*hKey* **\[In\]**  Handle of the key to query.

*lpValueName* **\[In\]**  Name of value under hkey to query.

*lpData* **\[Out\]**  Destination for the values contents,.

*lpType* **\[Out\]**  Destination for the value type.

*lpcbData* **\[Out\]**  Destination for the size of data.

## RETURNS

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

**Failure:** Otherwise.

## NOTES

Use MyFree to release the *lpData* buffer.

## IMPLEMENTATION

Declared in **"setupapi.h"**.

Implemented in **"dlls/setupapi/misc.c"**.

Debug channel **"setupapi"**.
