SECRegistry::Create

Creates key in registry.

Defined in: SECREG.CPP

Syntax

Create( LPCTSTR lpszSubkeyName, LPCTSTR lpszClassName, CreateOptionsoptions, CreatePermissions permissions, LPSECURITY_ATTRIBUTESpSecurityAttributes, CreationDisposition * pDisposition);

Create(LPCTSTR lpszSubkeyName, LPCTSTR lpszClassName);

Return Value

Nonzero if subkey was successfully created, otherwise 0.

Parameters

lpszSubkeyName

(32-bit) Name of the subkey to create.

name_of_subkey

(16-bit) Name of the subkey to create.

lpszClassName

Name of the class to associate with the created key.

options

Specifies special options for the created key. See Comments for more information.

permissions

Specifies access permissions for the key. See Comments for more information.

pSecurityAttributes

Points to a SECURITY_ATTRIBUTES structure containing security attributes for the new key.

pDisposition

Points to a variable to receive disposition information. See Comments for further information.

Comments

Creates a new registry subkey. Based on RegCreateKey API for 16-bit, and RegCreateKeyEx for 32-bit. Possible values for options include :

REG_OPTION_VOLATILE

This key is volatile; the information is stored in memory and is not preserved when the system is restarted. The RegSaveKey function does not save volatile keys.

REG_OPTION_NON_VOLATILE

This key is not volatile; the information is stored in a file and is preserved when the system is restarted. The RegSaveKey function saves keys that are not volatile.

Possible values for permissions include:

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_CREATE_SUB_KEY

Permission to create subkeys.

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 set subkey data.

KEY_WRITE

Combination of KEY_SET_VALUE and KEY_CREATE_SUB_KEY access.

Possible return values for pDisposition include:

REG_CREATED_NEW_KEY

The key did not exist and was created.

REG_OPENED_EXISTING_KEY

The key existed and was simply opened without being changed.

See Also

SECRegistry  Open  Close