MiStoreEvictThread

VOID __stdcall MiStoreEvictThread(VOID *StartContext){
  int v2; 
  __int64 v3; 
  __int64 v4; 
  int v5; 
  __int64 v6; 
  unsigned int v7; 
  __int64 v8; 
  unsigned __int64 v9; 
  _EXT_SET_PARAMETERS_V0 Parameters; 
  VOID *Object[2]; 
  _KWAIT_BLOCK WaitBlockArray; 
  _KTIMER2 v13; 

  memset(&v13, 0i64, sizeof(v13));
  KeWaitForSingleObject((UINT64)StartContext + 8, 26, 0, 0, 0i64);
  v2 = *((_DWORD *)StartContext + 8);
  v3 = *(_QWORD *)StartContext;
  ExFreePoolWithTag(StartContext, 0);
  if( !v2 )
  {
    KiInitializeTimer2((INT64)&v13, 0i64, 0i64, 8i64);
    *(_QWORD *)&Parameters.Version &= v4;
    Parameters.NoWakeTolerance = -1i64;
    KeSetTimer2((INT64)&v13, -600000000i64, 600000000i64, (INT64)&Parameters);
    Object[1] = &v13;
    Object[0] = (VOID *)(v3 + 1200);
    while( 1 )
    {
      if( !KeWaitForMultipleObjects(2ui64, Object, WaitAny, WrVirtualMemory, 0, 0, 0i64, &WaitBlockArray) )
        KeResetEvent((_KEVENT *)(v3 + 1200));
      while( 1 )
      {
        v5 = *(_DWORD *)(v3 + 1168);
        v6 = 0i64;
        v7 = *(_DWORD *)(v3 + 6936);
        if( v7 )
        {
          do
          {
            v8 = *(_QWORD *)(v3 + 8 * v6 + 6944);
            if( (*(_BYTE *)(v8 + 204) & 0x40) != 0 )
            {
              MiStoreEvictPageFile(*(_MMPAGING_FILE **)(v3 + 8 * v6 + 6944));
              if( *(_DWORD *)(v8 + 200) >= 0x100u )
                LODWORD(v6) = v6 - 1;
            }
            v6 = (unsigned int)(v6 + 1);
          }
          while( (unsigned int)v6 < v7 );
        }
        v9 = (unsigned __int8)ExAcquireSpinLockExclusive((INT64 *)(v3 + 1184));
        if( v5 == *(_DWORD *)(v3 + 1168) )
          break;
        ExReleaseSpinLockExclusiveFromDpcLevel((INT64 *)(v3 + 1184));
        __writecr8(v9);
      }
      if( v5 )
      {
        *(_DWORD *)(v3 + 1168) = 0;
        KeSetEvent((PRKEVENT)(v3 + 1248), 0, 0);
      }
      ExReleaseSpinLockExclusiveFromDpcLevel((INT64 *)(v3 + 1184));
      __writecr8(v9);
    }
  }
}

Referenced by:

No references.