MiFinishHoldingDirtyFaults

VOID __fastcall MiFinishHoldingDirtyFaults(_QWORD *a1){
  _ETHREAD *CurrentThread; 
  __int64 v3; 
  INT64 *SharedVm; 
  KIRQL v5; 
  _QWORD *v6; 
  _QWORD **v7; 
  _QWORD *v8; 
  _QWORD *v9; 
  __int64 v10; 
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  v3 = *((_QWORD *)CurrentThread + 23);
  SharedVm = MiGetSharedVm(v3 + 1664);
  v5 = ExAcquireSpinLockExclusive((PEX_SPIN_LOCK)SharedVm);
  *((_DWORD *)SharedVm + 1) = 0;
  v6 = (_QWORD *)*a1;
  if( *(_QWORD **)(*a1 + 8i64) != a1 || (v7 = (_QWORD **)a1[1], *v7 != a1) )
LABEL_9:
    __fastfail(3u);
  *v7 = v6;
  v6[1] = v7;
  MiUnlockWorkingSetExclusive(v3 + 1664, v5);
  v8 = a1 + 4;
  while( 1 )
  {
    v9 = (_QWORD *)*v8;
    if( (_QWORD *)*v8 == v8 )
      break;
    if( (_QWORD *)v9[1] != v8 )
      goto LABEL_9;
    v10 = *v9;
    if( *(_QWORD **)(*v9 + 8i64) != v9 )
      goto LABEL_9;
    *v8 = v10;
    *(_QWORD *)(v10 + 8) = v8;
    KeSetEvent((PRKEVENT)(v9 + 2), 0);
  }
  KiLeaveGuardedRegionUnsafe((__int64)CurrentThread);
}

Referenced by:

MiReleaseHotPatchResources