ExpScanSystemLookasideList

VOID __stdcall ExpScanSystemLookasideList(){
  __int64 v0; 
  unsigned int v1; 
  __int64 v2; 
  _GENERAL_LOOKASIDE **v3; 
  _GENERAL_LOOKASIDE *v4; 
  UINT64 v5; 
  __int64 v6; 
  __int64 v7; 
  UINT64 v8; 
  UINT64 v9; 
  UINT64 v10; 
  unsigned int i; 
  __int64 v12; 
  INT64 *v13; 
  _GENERAL_LOOKASIDE **p_L; 
  _GENERAL_LOOKASIDE *v15; 
  UINT64 v16; 

  v0 = 9i64;
  v1 = 3 * KeNumberProcessors_0;
  if( ExpPoolScanCount == (_DWORD)KeNumberProcessors_0 )
  {
    p_L = &KeGetCurrentPrcb()->PPLookasideList[0].L;
    do
    {
      v15 = *p_L;
      if( *p_L )
      {
        v16 = v15->AllocateMisses - v15->LastAllocateMisses;
        v15->LastAllocateMisses = v15->AllocateMisses;
        ExpComputeLookasideDepth(v15, v16, v1);
      }
      p_L += 2;
      --v0;
    }
    while( v0 );
  }
  else
  {
    v2 = (__int64)*(&KiProcessorBlock + (unsigned int)ExpPoolScanCount);
    v3 = (_GENERAL_LOOKASIDE **)(v2 + 2048);
    do
    {
      v4 = *v3;
      if( *v3 )
      {
        v5 = v4->AllocateMisses - v4->LastAllocateMisses;
        v4->LastAllocateMisses = v4->AllocateMisses;
        ExpComputeLookasideDepth(v4, v5, v1);
      }
      v3 += 2;
      --v0;
    }
    while( v0 );
    v6 = v2 + 2388;
    v7 = 32i64;
    do
    {
      v8 = (unsigned int)(*(_DWORD *)(v6 - 64) - *(_DWORD *)(v6 - 4) - (*(_DWORD *)(v6 - 60) - *(_DWORD *)v6));
      *(_DWORD *)v6 = *(_DWORD *)(v6 - 60);
      ExpComputeLookasideDepth((_GENERAL_LOOKASIDE *)(v6 - 84), v8, v1);
      v9 = (unsigned int)(*(_DWORD *)(v6 + 3008)
                        - *(_DWORD *)(v6 + 3068)
                        - (*(_DWORD *)(v6 + 3012)
                         - *(_DWORD *)(v6 + 3072)));
      *(_DWORD *)(v6 + 3072) = *(_DWORD *)(v6 + 3012);
      ExpComputeLookasideDepth((_GENERAL_LOOKASIDE *)(v6 + 2988), v9, v1);
      v10 = (unsigned int)(*(_DWORD *)(v6 + 6080)
                         - *(_DWORD *)(v6 + 6140)
                         - (*(_DWORD *)(v6 + 6084)
                          - *(_DWORD *)(v6 + 6144)));
      *(_DWORD *)(v6 + 6144) = *(_DWORD *)(v6 + 6084);
      ExpComputeLookasideDepth((_GENERAL_LOOKASIDE *)(v6 + 6060), v10, v1);
      v6 += 96i64;
      --v7;
    }
    while( v7 );
  }
  for( i = 0; i < dword_140C57DD0; ++i )
  {
    v12 = 2i64;
    v13 = (INT64 *)((char *)&unk_140C57E40 + 8384 * i);
    do
    {
      RtlpDynamicLookasideRebalance(v13);
      v13 += 520;
      --v12;
    }
    while( v12 );
  }
  if( ++ExpPoolScanCount > (unsigned int)KeNumberProcessors_0 )
    ExpPoolScanCount = 0;
}

Referenced by:

KeBalanceSetManager