GetSecurityDescriptorLength

  DWORD GetSecurityDescriptorLength(SecurityDescriptor)    
  PSECURITY_DESCRIPTOR SecurityDescriptor;    

The GetSecurityDescriptorLength function returns the length, in bytes, of a structurally valid SECURITY_DESCRIPTOR. The length includes the length of all associated data structures, such as SIDs and ACLs.

The minimum length of a security descriptor is SECURITY_DESCRIPTOR_MIN_LENGTH. Such a minimal security descriptor has no associated SIDs or ACLs.

Parameters

SecurityDescriptor

Pointer to the SECURITY_DESCRIPTOR data structure whose length the function will return. The SECURITY_DESCRIPTOR's structure is assumed to be valid.

Return Value

If the function is successful, the return value is the length in bytes of the SECURITY_DESCRIPTOR.

If the SECURITY_DESCRIPTOR's structure is invalid, the return value is undefined.

See Also

GetSecurityDescriptorGroup, GetSecurityDescriptorControl, GetSecurityDescriptorDacl, GetSecurityDescriptorOwner, GetSecurityDescriptorSacl, InitializeSecurityDescriptor, IsValidSecurityDescriptor, SetSecurityDescriptorDacl, SetSecurityDescriptorGroup, SetSecurityDescriptorOwner, SetSecurityDescriptorSacl