SECRegistry::Open

Opens a registry key.

Defined in: SECREG.CPP

Syntax

(32-bit) BOOL Open( LPCTSTR lpszSubkey, const CreatePermissions security_access_mask );

(16-bit) BOOL Open( LPCTSTR lpszSubkey);

Return Value

Nonzero if key was successfully opened, otherwise 0.

Parameters

lpszSubkey

Name of key to open.

security_access_mask

Security flags to associate with the open key (see Comments).

Comments

Opens the specified key with the requested permissions. The 32-bit version encapsulates the RegOpenKeyEx API, while the 16-bit version encapsulates the RegOpenKey API. The security_access_mask can be a combination of the following parameters:

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.

See Also

SECRegistry  Close