This topic has not yet been rated - Rate this topic

GetSecurityDescriptor method of the StdRegProv Class

Applies to: desktop apps only

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.

Note that HKEY_DYN_DATA is a valid tree for computers running Windows 95 and Windows 98 only.

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

 

 

Send comments about this topic to Microsoft

Build date: 3/9/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ