MiReferencePfBackedSection

_SUBSECTION *__stdcall MiReferencePfBackedSection(_MMPTE *ProtoPte){
  _QWORD *v1; 
  _SUBSECTION *v2; 
  KIRQL v4; 
  _QWORD *v5; 
  unsigned __int64 v6; 
  __int64 v7; 
  unsigned __int64 v8; 
  _QWORD *v9; 
  __int64 a2; 
  v1 = 0i64;
  v2 = 0i64;
LABEL_2:
  v4 = ExAcquireSpinLockShared(&dword_140C4C880);
  v5 = qword_140C4C878;
  v6 = v4;
  while( 1 )
  {
    v7 = 0i64;
    if( !v5 )
      break;
    a2 = 0i64;
    v8 = MiObtainProtoBaseFromNode(v5, &a2);
    if( (unsigned __int64)ProtoPte < v8 )
    {
      v5 = (_QWORD *)*v5;
    }
    else
    {
      if( (unsigned __int64)ProtoPte < v8 + 8 * a2 )
      {
        if( (v5[3] & 7) != 1 )
          break;
        v7 = *(v5 - 7);
        if( !(unsigned int)ExTryAcquireSpinLockExclusiveAtDpcLevel((INT64 *)(v7 + 72)) )
        {
          ExReleaseSpinLockSharedFromDpcLevel(&dword_140C4C880);
          __writecr8(v6);
          goto LABEL_2;
        }
        if( (*(_DWORD *)(v7 + 56) & 3) == 0 )
        {
          MiBuildWakeList((_CONTROL_AREA *)v7, 4ui64);
          ++*(_DWORD *)(v7 + 76);
          v1 = v9;
          MiRemoveUnusedSegment((_CONTROL_AREA *)v7);
          v2 = (_SUBSECTION *)(v5 - 7);
        }
        break;
      }
      v5 = (_QWORD *)v5[1];
    }
  }
  ExReleaseSpinLockSharedFromDpcLevel(&dword_140C4C880);
  if( v7 )
    ExReleaseSpinLockExclusiveFromDpcLevel((INT64 *)(v7 + 72));
  __writecr8(v6);
  if( v1 )
    MiReleaseControlAreaWaiters(v1);
  return v2;
}

Referenced by:

MiGetPageFileSectionForReservation
MiTrimSharedPage