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

# RegQueryValueExA(3w)

## NAME

**RegQueryValueExA** (ADVAPI32.@)

## SYNOPSIS

LSTATUS RegQueryValueExA\
  (\
   HKEY    *hkey*,\
   LPCSTR  *name*,\
   LPDWORD *reserved*,\
   LPDWORD *type*,\
   LPBYTE  *data*,\
   LPDWORD *count*\
  )

## DESCRIPTION

Get the *type* and contents of a specified value under with a key.

## PARAMS

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

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

*reserved* **\[In\]**  Reserved **-** must be **NULL**.

*type* **\[Out\]**  Destination for the value *type*, or **NULL** if not required.

*data* **\[Out\]**  Destination for the values contents, or **NULL** if not required.

*count* **\[In/Out\]**  Size of *data*, updated with the number of bytes returned.

## RETURNS

**Success:** **ERROR\_SUCCESS**. \**count* is updated with the number of bytes copied to *data*.

**Failure:** **ERROR\_INVALID\_HANDLE**, if *hkey* is invalid. **ERROR\_INVALID\_PARAMETER**, if any other parameter is invalid. **ERROR\_MORE\_DATA**, if on input \**count* is too small to hold the contents.

## NOTES

**MSDN** states that if *data* is too small it is partially filled. In reality it remains untouched.

## IMPLEMENTATION

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

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

Debug channel **"reg"**.
