int get_registry_key_security(handle key, security_information information_type, void* security_descriptor, unsigned* security_descriptor_length)
This function obtains a copy of the security for the key.
The handle of the key whose security is being obtained.
The type of security information being queried.
A pointer to a buffer to hold the security information for the key.
A pointer to a variable holding the size of the buffer provided by the previous parameter. Upon return, the variable contains the number of bytes written to the buffer.
|The function succeeded.
|The call failed - a Win32 error code is returned.
To read the owner, group or discretionary access list for the , the caller should have opened the key with access_type::read. To be granted read access to the security descriptor, the caller must be the owner or be mentioned in the discretionary access list of the descriptor.
To read the system access list of the descriptor, the caller must have access_type::system_security. The way to obtain such access is to request it upon opening the key whilst having PrivilegeSecurity enabled.