NTSTATUS
RtlpLengthInheritAcl(
  IN  PACL Acl,
  IN  BOOLEAN IsDirectoryObject,
  IN  PSID ClientOwnerSid,
  IN  PSID ClientGroupSid,
  IN  PSID ServerOwnerSid OPTIONAL,
  IN  PSID ServerGroupSid OPTIONAL,
  IN  PGENERIC_MAPPING GenericMapping,
  OUT PULONG NewAclLength
  );

Routine Description:

    This is a private routine that calculates the length needed to
    produce an inheritable ACL.

Arguments:

    Acl - Supplies the acl being inherited.

    IsDirectoryObject - Specifies if the new acl is for a directory.

    OwnerSid - Specifies the owner Sid to use.

    GroupSid - Specifies the group SID to use.

    GenericMapping - Specifies the generic mapping to use.

    NewAclLength - Receives the length of the inherited ACL.

Return Value:

    STATUS_SUCCESS - An inheritable ACL buffer successfully allocated.

    STATUS_NO_INHERITANCE - An inheritable ACL was not successfully generated.
        This is a warning completion status.

    STATUS_BAD_INHERITANCE_ACL - Indicates the acl built was not a valid ACL.
        This can becaused by a number of things.  One of the more probable
        causes is the replacement of a CreatorId with an SID that didn't fit
        into the ACE or ACL.