MiCheckPteForWriteCluster

_MMPFN *__stdcall MiCheckPteForWriteCluster(
        _RTL_BITMAP *AllocationBitmap,
        ULONG_PTR PointerPte,
        _MMPTE ComparePte,
        _MMPTE *OwningPte,
        UINT64 ContainingFrame,
        _BYTE *PageIrql){
  _MMPFN *result; 
  unsigned __int64 v9; 

  result = MiLockTransitionLeafPage(PointerPte, PageIrql);
  if( !result )
    return 0i64;
  if( (*(_BYTE *)(&result->u3 + 1) & 7) != 3
    || result->u3.ReferenceCount
    || (result->OriginalPte.u.Long & 0xFFFFFFFFFC00FC1Fui64) != ComparePte.u.Long )
  {
    goto LABEL_11;
  }
  if( *(&stru_140C4DB30 + 42) )
  {
    if( (ComparePte.u.Long & 0x10) == 0 )
      ComparePte.u.Long &= ~*(&stru_140C4DB30 + 42);
  }
  if( _bittest64((const signed __int64 *)AllocationBitmap->Buffer, HIDWORD(ComparePte.u.Long)) )
  {
LABEL_11:
    v9 = (unsigned __int8)*PageIrql;
    _InterlockedAnd64(&result->u2.Lock, 0x7FFFFFFFFFFFFFFFui64);
    __writecr8(v9);
    return 0i64;
  }
  return result;
}

Referenced by:

MiGetPageForWriteCluster