MiRelinkStandbyPage

UINT64 __stdcall MiRelinkStandbyPage(_MMPFN *Pfn1, UINT64 NewPriority, UINT16 NewPartitionId){
  int v3; 
  v3 = NewPriority;
  if( *((_WORD *)Pfn1 + 16) )
  {
    if( (_DWORD)NewPriority != 0xFFFFFF )
      *((_BYTE *)Pfn1 + 35) ^= (NewPriority ^ *((_BYTE *)Pfn1 + 35)) & 7;
  }
  else
  {
    if( !(unsigned int)MiUnlinkPageFromList(Pfn1, 0i64) )
    {
      MiRestoreTransitionPte(Pfn1, 0i64);
      *((_QWORD *)Pfn1 + 5) &= ~0x8000000000000000ui64;
      *((_BYTE *)Pfn1 + 34) &= 0xC7u;
      *((_BYTE *)Pfn1 + 35) &= ~0x20u;
      *((_BYTE *)Pfn1 + 34) = *((_BYTE *)Pfn1 + 34) & 0xF8 | 5;
      *((_QWORD *)Pfn1 + 3) |= 0x4000000000000000ui64;
      MiInsertPageInFreeOrZeroedList((Pfn1 - MmGetPfnDb()) / 48, 2ui64);
      return 0i64;
    }
    if( v3 != 0xFFFFFF )
      *((_BYTE *)Pfn1 + 35) ^= (v3 ^ *((_BYTE *)Pfn1 + 35)) & 7;
    MiInsertPageInList(Pfn1, 4ui64);
  }
  return 1i64;
}

Referenced by:

MiEmptyDecayClusterTimers
MiUpdatePfnPriority
MiUpdatePfnPriorityByPte
MmSetPfnListInfo