MiUpdatePageFileList

void __fastcall MiUpdatePageFileList(__int64 a1, int a2){
  __int64 *v4; 
  unsigned __int64 v5; 
  unsigned __int64 v6; 
  bool v7; 
  _QWORD *v8; 
  _QWORD *v9; 
  if( !*(_QWORD *)(a1 + 56) )
    return;
  v4 = (__int64 *)(a1 + 256);
  v5 = ExAcquireSpinLockExclusive(&dword_140C4E9F8);
  if( !a2 )
  {
    RtlAvlRemoveNode((unsigned __int64 *)&qword_140C4E9F0, v4);
    goto LABEL_5;
  }
  v6 = *(_QWORD *)(a1 + 56);
  *(_WORD *)(a1 + 204) |= 0x100u;
  v7 = 0;
  v8 = (_QWORD *)qword_140C4E9F0;
  if( !qword_140C4E9F0 )
    goto LABEL_4;
  while( v6 < *(v8 - 25) )
  {
    v9 = (_QWORD *)*v8;
    if( !*v8 )
      goto LABEL_4;
LABEL_9:
    v8 = v9;
  }
  v9 = (_QWORD *)v8[1];
  if( v9 )
    goto LABEL_9;
  v7 = 1;
LABEL_4:
  RtlAvlInsertNodeEx((unsigned __int64 *)&qword_140C4E9F0, (__int64)v8, v7, v4);
LABEL_5:
  ExReleaseSpinLockExclusiveFromDpcLevel((INT64 *)&dword_140C4E9F8);
  __writecr8(v5);
}

Referenced by:

MiDeletePagefile
MiIncreaseCommitLimits
MiInsertPageFileInList