SeGetTrustLabelAce

_SYSTEM_PROCESS_TRUST_LABEL_ACE *__stdcall SeGetTrustLabelAce(PVOID SecurityDescriptor){
  __int16 v1; 
  unsigned int i; 
  _SYSTEM_PROCESS_TRUST_LABEL_ACE *result; 
  __int64 v5; 
  char *v6; 
  unsigned int v7; 
  v1 = *((_WORD *)SecurityDescriptor + 1);
  for( i = 0; ; ++i )
  {
    if( (v1 & 0x10) == 0 )
      goto LABEL_3;
    if( v1 >= 0 )
      break;
    v5 = *((unsigned int *)SecurityDescriptor + 3);
    if( (_DWORD)v5 )
    {
      v6 = (char *)SecurityDescriptor + v5;
      goto LABEL_9;
    }
LABEL_3:
    result = 0i64;
LABEL_4:
    if( !result )
      return result;
  }
  v6 = (char *)*((_QWORD *)SecurityDescriptor + 3);
LABEL_9:
  if( !v6 )
    goto LABEL_3;
  result = (_SYSTEM_PROCESS_TRUST_LABEL_ACE *)(v6 + 8);
  v7 = 0;
  if( !*((_WORD *)v6 + 2) )
    goto LABEL_3;
  while( v7 < i || result->Header.AceType != 20 )
  {
    ++v7;
    result = (_SYSTEM_PROCESS_TRUST_LABEL_ACE *)((char *)result + result->Header.AceSize);
    if( v7 >= *((unsigned __int16 *)v6 + 2) )
      goto LABEL_3;
  }
  i = v7;
  if( (result->Header.AceFlags & 8) != 0 )
    goto LABEL_4;
  return result;
}

Referenced by:

MiAllowImageMap
SeAdjustAccessStateForAccessConstraints
SeShouldCheckForAccessRightsFromParent
SepAdjustAccessStateForConstraints
SepTrustLevelCheck
SepVerifyDesktopAppxImage