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

# RegCreateKeyExA(3w)

## NAME

**RegCreateKeyExA** (ADVAPI32.@)

## SYNOPSIS

LSTATUS RegCreateKeyExA\
  (\
   HKEY                 *hkey*,\
   LPCSTR               *name*,\
   DWORD                *reserved*,\
   LPSTR                *class*,\
   DWORD                *options*,\
   REGSAM               *access*,\
   SECURITY\_ATTRIBUTES\* *sa*,\
   PHKEY                *retkey*,\
   LPDWORD              *dispos*\
  )

## DESCRIPTION

Open a registry key, creating it if it doesn't exist.

## PARAMS

*hkey* **\[In\]**  Handle of the parent registry key.

*name* **\[In\]**  Name of the new key to open or create.

*reserved* **\[In\]**  Reserved, pass **0.**

*class* **\[In\]**  The object type of the new key.

*options* **\[In\]**  Flags controlling the key creation (**REG\_OPTION\_**\* flags from **"winnt.h"**).

*access* **\[In\]**  Access level desired.

*sa* **\[In\]**  Security attributes for the key.

*retkey* **\[Out\]**  Destination for the resulting handle.

*dispos* **\[Out\]**  Receives **REG\_CREATED\_NEW\_KEY** or **REG\_OPENED\_EXISTING\_KEY**.

## RETURNS

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

**Failure:** A standard Win32 error code. *retkey* remains untouched.

## FIXME

**MAXIMUM\_ALLOWED** in *access* mask not supported by server

## IMPLEMENTATION

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

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

Debug channel **"reg"**.
