MiRemoveUnusedSubsection

VOID __stdcall MiRemoveUnusedSubsection(_MSUBSECTION *MappedSubsection){
  __int64 v2; 
  _QWORD *v3; 
  __int64 v4; 
  _QWORD *v5; 
  v2 = *(_QWORD *)(qword_140C4E388 + 8i64 * (*(_WORD *)(*(_QWORD *)MappedSubsection + 60i64) & 0x3FF));
  ExAcquireSpinLockExclusiveAtDpcLevel((INT64 *)(v2 + 1344));
  v3 = (_QWORD *)((char *)MappedSubsection + 80);
  v4 = *((_QWORD *)MappedSubsection + 10);
  if( *(_MSUBSECTION **)(v4 + 8) != (_MSUBSECTION *)((char *)MappedSubsection + 80)
    || (v5 = (_QWORD *)*((_QWORD *)MappedSubsection + 11), (_QWORD *)*v5 != v3) )
  {
    __fastfail(3u);
  }
  *v5 = v4;
  *(_QWORD *)(v4 + 8) = v5;
  *((_WORD *)MappedSubsection + 17) &= ~8u;
  *((_QWORD *)MappedSubsection + 11) = (char *)MappedSubsection + 80;
  *v3 = v3;
  MiReduceUnusedSubsectionCount(MappedSubsection);
  ExReleaseSpinLockExclusiveFromDpcLevel((INT64 *)(v2 + 1344));
}

Referenced by:

MiDereferenceControlAreaPfnList
MiFlushSectionInternal
MiPrepareSegmentForDeletion
MiReferenceActiveSubsection
MiReferenceSubsection
MmPurgeSection