Export (0) Print
Expand All

GetSecurityDescriptor method of the StdRegProv class

The GetSecurityDescriptor method returns the security descriptor that controls access to the specified registry key. The security descriptor is returned as an instance of __SecurityDescriptor. For more information, see Changing Access Security on Securable Objects.

Syntax


uint32 GetSecurityDescriptor(
  [in]   uint32 hDefKey = HKEY_LOCAL_MACHINE,
  [in]   string sSubKeyName,
  [out]  __SecurityDescriptor Descriptor
);

Parameters

hDefKey [in]

A registry tree, also known as a hive, that contains the sSubKeyName path. The default value is HKEY_LOCAL_MACHINE.

The following trees are defined in WinReg.h.

HKEY_CLASSES_ROOT (2147483648 (0x80000000))
HKEY_CURRENT_USER (2147483649 (0x80000001))
HKEY_LOCAL_MACHINE (2147483650 (0x80000002))
HKEY_USERS (2147483651 (0x80000003))
HKEY_CURRENT_CONFIG (2147483653 (0x80000005))
sSubKeyName [in]

The name of the registry key that has the security descriptor.

Descriptor [out]

The security descriptor from the key.

Remarks

The Win32_SecurityDescriptor instance represents a SECURITY_DESCRIPTOR_CONTROL data type and contains a discretionary access control list (DACL) and a system access control list (SACL). For more information, see Access Control Lists.

If the SeSecurityPrivilege is not granted or enabled when getting a security descriptor, then only the DACL is returned in the returned security descriptor. For more information, see Privilege Constants and Executing Privileged Operations.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Namespace

\root\default

MOF

RegEvent.mof

DLL

Stdprov.dll

See also

StdRegProv
Modifying the System Registry
WMI Tasks: Registry

 

 

Show:
© 2014 Microsoft