_RegCreateKey

include vmm.h

LONG _RegCreateKey(HKEY hkey, LPTSTR lpszSubKey, PHKEY phkResult)
 

Creates the specified key or opens the key if it already exists in the registry. Caller should use RegCloseKey to close the returned key. See the documentation for the Win32 function of the same name for additional information.

ERROR_KEY_DELETED
ERROR_BADKEY
ERROR_REGISTRY_IO_FAILED
ERROR_REGISTRY_CORRUPT
ERROR_BADDB
ERROR_OUTOFMEMORY

hkey
Handle of the open key or one of the predefined keys::
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
HKEY_CURRENT_CONFIG

lpszSubKey
Address of null-terminated string specifying the name of a key that this service creates or opens.
phkResult
Points to a variable that receives the handle of the opened or created key.

The key addressed by lpszSubKey must be a subkey of the key identified by hkey.

The key referenced by hkey cannot have HKEY_DYN_DATA as an ancestor (see RegCreateDynKey).

The lpszSubKey parameter cannot be NULL unless hkey is one of the predefined keys.

This service can be used to create keys several levels deep by specifying a subkey string with several keys separated by backslashes.

Of the predefined key values, only HKEY_LOCAL_MACHINE is available to VxDs during initialization time. The entire registry space can only be accessed after VxD initialization is complete.

See Also

_RegDeleteKey