MiMakePageBad

VOID __stdcall MiMakePageBad(_MMPFN *Pfn1, UINT64 InsertNow, UINT8 a3){
  char v3; 
  int v5; 
  UINT8 v6; 
  int v7; 
  UINT8 v8; 

  v3 = InsertNow;
  v5 = InsertNow & 1;
  if( (InsertNow & 1) != 0 )
    v6 = MiLockPageInline(Pfn1);
  else
    v6 = 17;
  LOBYTE(v7) = MiIsPageOnBadList((INT64)Pfn1);
  if( !v7 )
  {
    if( (*((_BYTE *)&Pfn1->u3 + 3) & 0x40) == 0 )
    {
      MiAcquireNonPagedResources(
        *(_MI_PARTITION **)(*(&stru_140C4DB30 + 267) + 8 * (((unsigned __int64)Pfn1->u4._bf_0 >> 39) & 0x3FF)),
        1ui64);
      MiSetPfnRemovalRequested((INT64)Pfn1, 1i64);
    }
    if( (v3 & 2) != 0 )
      MiInsertPageInList(Pfn1, 0x20ui64, v8);
    if( v5 )
    {
      _InterlockedAnd64(&Pfn1->u2.Lock, 0x7FFFFFFFFFFFFFFFui64);
      __writecr8(v6);
    }
    _InterlockedIncrement((_DWORD *)&stru_140C4DB30 + 635);
  }
}

Referenced by:

MiScrubLargeMappedPage
MiScrubNode
MiScrubProcessPhysicalPages