ClusterRegCreateKey
The ClusterRegCreateKey function creates a specified cluster database key. If the key already exists in the database, ClusterRegCreateKey opens it without making changes.
LONG WINAPI ClusterRegCreateKey(
HKEY hKey,
LPCWSTR lpszSubKey,
DWORD dwOptions,
REGSAM samDesired,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
PHKEY phkResult,
LPDWORD lpdwDisposition
);
Parameters
-
hKey
-
[in] Handle to an open cluster database key. This parameter cannot be NULL.
-
lpszSubKey
-
[in] Pointer to a NULL-terminated string specifying the name of the subkey to be created or opened. The lpszSubKey parameter must point to a subkey that:
-
Is a child key of the key identified by hKey.
-
Must not begin with the backslash character ( \ ).
-
Must not be NULL.
The lpszSubKey parameter can point to an empty string, causing ClusterRegCreateKey to return a handle to the database key represented by hKey.
-
dwOptions
-
[in] Specifies special options for this key. Currently, dwOptions can only be set to:
-
REG_OPTION_VOLATILE
-
The opened or created key is volatile; the information is stored in memory and is not preserved when the system is restarted.
-
samDesired
-
[in] Access mask that specifies the desired security access for the new key. Valid values are:
-
KEY_ALL_ACCESS
-
Combination of KEY_QUERY_VALUE, KEY_ENUMERATE_SUB_KEYS, KEY_NOTIFY, KEY_CREATE_SUB_KEY, KEY_CREATE_LINK, and KEY_SET_VALUE access.
-
KEY_CREATE_LINK
-
Permission to create a symbolic link.
-
KEY_ENUMERATE_SUB_KEYS
-
Permission to enumerate subkeys.
-
KEY_EXECUTE
-
Permission for read access.
-
KEY_NOTIFY
-
Permission for change notification.
-
KEY_QUERY_VALUE
-
Permission to query subkey data.
-
KEY_READ
-
Combination of KEY_QUERY_VALUE, KEY_ENUMERATE_SUB_KEYS, and KEY_NOTIFY access.
-
KEY_SET_VALUE
-
Permission to change subkey data.
-
KEY_WRITE
-
Combination of KEY_SET_VALUE and KEY_CREATE_SUB_KEY access.
-
lpSecurityAttributes
-
[in] Pointer to a SECURITY_ATTRIBUTES structure that contains the security descriptor for the new key in the contents of the lpSecurityDescriptor member or NULL. If lpSecurityAttributes is NULL, the key gets a default security descriptor. Since cluster database handles are not inheritable, the bInheritHandle member of the SECURITY_ATTRIBUTES structure must be FALSE.
-
phkResult
-
[out] Pointer to the handle of the opened or created key.
-
lpdwDisposition
-
[out] Pointer to a value that describes whether the key pointed to by lpszSubKey was opened or created. Valid values are:
-
REG_CREATED_NEW_KEY
-
The key did not exist and was created.
-
REG_OPENED_EXISTING_KEY
-
The key existed and was opened.
Return Values
-
ERROR_SUCCESS
-
The operation was successful.
If the operation was unsuccessful, ClusterRegCreateKey returns a Win32 error value.
Remarks
Callers should call ClusterRegCloseKey to close the key handle created by ClusterRegCreateKey when they are done with it. For more information, see the related Win32 registry functions RegCreateKey and RegCreateKeyEx.
QuickInfo
Version: Use Windows NT Server Enterprise Edition 4.0.
Windows CE: Unsupported.
Header: Declared in clusapi.h.