InitializeSecurityDescriptor function (securitybaseapi.h)

The InitializeSecurityDescriptor function initializes a new security descriptor.

Syntax

BOOL InitializeSecurityDescriptor(
  [out] PSECURITY_DESCRIPTOR pSecurityDescriptor,
  [in]  DWORD                dwRevision
);

Parameters

[out] pSecurityDescriptor

A pointer to a SECURITY_DESCRIPTOR structure that the function initializes.

[in] dwRevision

The revision level to assign to the security descriptor. This parameter must be SECURITY_DESCRIPTOR_REVISION.

Return value

If the function succeeds, the function returns nonzero.

If the function fails, it returns zero. To get extended error information, call GetLastError.

Remarks

The InitializeSecurityDescriptor function initializes a security descriptor in absolute format, rather than self-relative format.

The InitializeSecurityDescriptor function initializes a security descriptor to have no system access control list (SACL), no discretionary access control list (DACL), no owner, no primary group, and all control flags set to FALSE (NULL). Thus, except for its revision level, it is empty.

Examples

For an example that uses this function, see Creating a Security Descriptor for a New Object.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header securitybaseapi.h (include Windows.h)
Library Advapi32.lib
DLL Advapi32.dll

See also

GetSecurityDescriptorControl

GetSecurityDescriptorDacl

GetSecurityDescriptorGroup

GetSecurityDescriptorLength

GetSecurityDescriptorOwner

GetSecurityDescriptorSacl

IsValidSecurityDescriptor

Low-level Access Control

Low-level Access Control Functions

SECURITY_DESCRIPTOR

SetSecurityDescriptorDacl

SetSecurityDescriptorGroup

SetSecurityDescriptorOwner

SetSecurityDescriptorSacl