RtlpValidFilterAclSubjectContext

NTSTATUS __stdcall RtlpValidFilterAclSubjectContext(_ACL *pAcl, VOID *TokenTrustLevel){
  _DWORD *AceByType; 
  UINT8 v5; 
  _DWORD *v6; 
  int v8; 
  UINT64 pIndex; 
  int v10; 
  unsigned __int16 v11; 

  v10 = 0;
  pIndex = 0i64;
  v11 = 256;
  while( 1 )
  {
    AceByType = RtlFindAceByType(pAcl, 0x15ui64, &pIndex);
    v6 = AceByType;
    if( AceByType )
    {
      if( (AceByType[1] & 0xFF000000) != 0 )
        return -1073741811;
      if( (*((_BYTE *)AceByType + 1) & 0x40) != 0 )
      {
        if( !(unsigned __int8)RtlpValidTrustSubjectContext(
                                 TokenTrustLevel,
                                 AceByType + 2,
                                 v5,
                                 (INT64 *)((char *)&pIndex + 4)) )
          return -1073741790;
        goto LABEL_12;
      }
      v8 = *(_DWORD *)((char *)AceByType + 10) - v10;
      if( !v8 )
        v8 = *((unsigned __int16 *)AceByType + 7) - v11;
      if( v8 || *((_BYTE *)AceByType + 9) != 1 || AceByType[4] )
        return -1073741811;
    }
LABEL_12:
    LODWORD(pIndex) = pIndex + 1;
    if( !v6 )
      return HIDWORD(pIndex);
  }
}

Referenced by:

RtlpSetSecurityObject