AuthzBasepRollbackSecurityAttributeChanges

CHAR __fastcall AuthzBasepRollbackSecurityAttributeChanges(_DWORD *a1, INT64 a2){
  CHAR v2; 
  INT64 v4; 
  INT64 v5; 
  INT64 *v6; 
  int v7; 
  INT64 v8; 
  _QWORD *v9; 
  _QWORD *v10; 
  int v11; 
  v2 = 1;
  AuthzBasepRemoveSecurityAttributeFromLists((DEVICE_OBJECT *)a1);
  v7 = *(_DWORD *)(v4 + 56);
  if( (v7 & 4) != 0 )
  {
    v8 = v4;
    if( (v7 & 1) == 0 )
    {
      AuthzBasepFreeSecurityAttributeValues(v4, 0i64, v5, v6);
      return v2;
    }
    *(_DWORD *)(v4 + 56) = v7 & 0xFFFFFFFB;
    LOBYTE(v4) = 1;
    AuthzBasepFreeSecurityAttributeValues(v8, v4, v5, v6);
  }
  v9 = (_QWORD *)(a2 + 96);
  while( 1 )
  {
    v10 = (_QWORD *)*v9;
    if( (_QWORD *)*v9 == v9 )
      break;
    AuthzBasepRemoveSecurityAttributeValueFromLists((_DWORD *)a2, v10 - 2, 0);
    v11 = *((_DWORD *)v10 + 4);
    if( (v11 & 4) != 0 )
    {
      --*(_DWORD *)(a2 + 64);
      *((_DWORD *)v10 + 4) &= ~4u;
      v11 = *((_DWORD *)v10 + 4);
    }
    if( (v11 & 1) == 0 )
      ExFreePoolWithTag(v10 - 2, 0);
  }
  return(*(_BYTE *)(a2 + 56) & 1) == 0;
}

Referenced by:

AuthzBasepFinaliseSecurityAttributesList