RegCreateKeyEx function advapi32

WIN32_ERROR RegCreateKeyEx(
  1. HKEY hKey,
  2. PCWSTR lpSubKey,
  3. PCWSTR? lpClass,
  4. REG_OPEN_CREATE_OPTIONS dwOptions,
  5. REG_SAM_FLAGS samDesired,
  6. Pointer<SECURITY_ATTRIBUTES>? lpSecurityAttributes,
  7. Pointer<Pointer<NativeType>> phkResult,
  8. Pointer<Uint32>? lpdwDisposition,
)

Creates the specified registry key.

If the key already exists, the function opens it. Note that key names are not case sensitive.

To learn more, see learn.microsoft.com/windows/win32/api/winreg/nf-winreg-regcreatekeyexw.

Implementation

@pragma('vm:prefer-inline')
WIN32_ERROR RegCreateKeyEx(
  HKEY hKey,
  PCWSTR lpSubKey,
  PCWSTR? lpClass,
  REG_OPEN_CREATE_OPTIONS dwOptions,
  REG_SAM_FLAGS samDesired,
  Pointer<SECURITY_ATTRIBUTES>? lpSecurityAttributes,
  Pointer<Pointer> phkResult,
  Pointer<Uint32>? lpdwDisposition,
) => WIN32_ERROR(
  _RegCreateKeyEx(
    hKey,
    lpSubKey,
    NULL,
    lpClass ?? nullptr,
    dwOptions,
    samDesired,
    lpSecurityAttributes ?? nullptr,
    phkResult,
    lpdwDisposition ?? nullptr,
  ),
);