SeAssignSecurity

NTSTATUS __stdcall SeAssignSecurity(
        VOID *ParentDescriptor,
        VOID *ExplicitDescriptor,
        VOID **NewDescriptor,
        UINT8 IsDirectoryObject,
        _SECURITY_SUBJECT_CONTEXT *SubjectContext,
        _GENERIC_MAPPING *GenericMapping,
        POOL_TYPE PoolType){
  int v7; 
  UINT64 v9; 
  UINT64 AutoInheritFlags; 

  v7 = 0;
  if( ParentDescriptor )
  {
    if( (!ExplicitDescriptor || (*((_BYTE *)ExplicitDescriptor + 2) & 4) == 0)
      && (*((_WORD *)ParentDescriptor + 1) & 0x400) != 0 )
    {
      v7 = 1;
    }
    if( (!ExplicitDescriptor || (*((_BYTE *)ExplicitDescriptor + 2) & 0x10) == 0)
      && (*((_WORD *)ParentDescriptor + 1) & 0x800) != 0 )
    {
      v7 |= 2u;
    }
  }
  LODWORD(AutoInheritFlags) = v7;
  LODWORD(v9) = 0;
  return RtlpNewSecurityObject(
           ParentDescriptor,
           ExplicitDescriptor,
           NewDescriptor,
           0i64,
           v9,
           IsDirectoryObject,
           AutoInheritFlags,
           SubjectContext,
           GenericMapping,
           0i64);
}

Referenced by:

CmFcInitSystem2
CmpCreateChild
CmpCreateHiveRootCell