ClusterRegSetKeySecurity function

Sets the security attributes for a cluster database key.


LONG ClusterRegSetKeySecurity(
  HKEY                 hKey,
  SECURITY_INFORMATION SecurityInformation,
  PSECURITY_DESCRIPTOR pSecurityDescriptor



Handle to a cluster database key.


A SECURITY_INFORMATION structure that indicates the content of the security descriptor pointed to by pSecurityDescriptor.


Pointer to a SECURITY_DESCRIPTOR structure that describes the security attributes to set for the key corresponding to hKey.

Return Value

If the operation succeeds, the function returns ERROR_SUCCESS (0).

If the operation fails, the function returns a system error code.


The ClusterRegSetKeySecurity function generates a CLUSTER_CHANGE_REGISTRY_ATTRIBUTES event for all registered notification ports.

Do not call ClusterRegSetKeySecurity from the following resource DLL entry point functions:

ClusterRegSetKeySecurity can be safely called from any other resource DLL entry point function or from a worker thread. For more information, see Function Calls to Avoid in Resource DLLs.


Minimum supported client None supported
Minimum supported server Windows Server 2008 Enterprise, Windows Server 2008 Datacenter
Target Platform Windows
Header clusapi.h
Library ClusAPI.lib
DLL ClusAPI.dll

See Also