SepBlockAccessForLogonSession

NTSTATUS __stdcall SepBlockAccessForLogonSession(LUID *LogonId){
  __int64 v2; 
  __int64 v3; 
  _ETHREAD *CurrentThread; 
  struct _ERESOURCE *v5; 
  NTSTATUS v6; 
  v2 = (1529154084 * LogonId->LowPart) >> 28;
  v3 = SepLogonSessions + 8 * v2;
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  --*((_WORD *)CurrentThread + 242);
  v5 = &SepRmDbLock + (v2 & 3);
  ExAcquireResourceExclusiveLite(v5, 1u);
  v6 = 0;
  while( 1 )
  {
    v3 = *(_QWORD *)v3;
    if( !v3 )
      break;
    if( *(_EJOB **)(v3 + 160) == PsGetCurrentServerSilo()
      && LogonId->LowPart == *(_DWORD *)(v3 + 8)
      && LogonId->HighPart == *(_DWORD *)(v3 + 12) )
    {
      *(_DWORD *)(v3 + 32) |= 0x20u;
      goto LABEL_7;
    }
  }
  v6 = -1073741729;
LABEL_7:
  ExReleaseResourceLite(v5);
  KeLeaveCriticalRegionThread((__int64)KeGetCurrentThread());
  return v6;
}

Referenced by:

SepRmInteractiveLogoffLogonSessionCompletedWrkr