ULONG
RtlLengthUsedSecurityDescriptor(
  IN  PSECURITY_DESCRIPTOR SecurityDescriptor
  );

Routine Description:

    This routine returns the length, in bytes, in use in a structurally valid
    SECURITY_DESCRIPTOR.

    This is the number of bytes necessary to capture the security descriptor,
    which may be less the the current actual length of the security descriptor
    (RtlLengthSecurityDescriptor() is used to retrieve the actual length).

    Notice that the used length and actual length may differ if either the SACL
    or DACL include padding bytes.

    The length includes the length of all associated data structures (like SIDs
    and ACLs).  The length also takes into account the alignment requirements
    of each component.

    The minimum length of a security descriptor (one which has no associated
    SIDs or ACLs) is SECURITY_DESCRIPTOR_MIN_LENGTH.


Arguments:

    SecurityDescriptor - Points to the SECURITY_DESCRIPTOR whose used
        length is to be returned.  The SECURITY_DESCRIPTOR's
        structure is assumed to be valid.

Return Value:

    ULONG - Number of bytes of the SECURITY_DESCRIPTOR that are in use.