MmCheckMdlPages

VOID __stdcall MmCheckMdlPages(_MDL *MemoryDescriptorList){
  UINT64 *v1; 
  __int16 v2; 
  unsigned __int64 v3; 
  ULONG_PTR v4; 
  UINT64 *v5; 
  UINT64 Param4; 
  int v7; 
  UINT64 v8; 

  v1 = (UINT64 *)&MemoryDescriptorList[1];
  v2 = MemoryDescriptorList->MdlFlags & 0x800;
  v3 = (((LODWORD(MemoryDescriptorList->StartVa) + MemoryDescriptorList->ByteOffset) & 0xFFF)
      + (unsigned __int64)MemoryDescriptorList->ByteCount
      + 4095) >> 12;
  v4 = (unsigned int)MemoryDescriptorList;
  v5 = (UINT64 *)(&MemoryDescriptorList[1].Next + v3);
  do
  {
    Param4 = *v1;
    MiIsPfn(*v1);
    if( v2 )
    {
      if( v7 != 1 )
        goto LABEL_8;
    }
    else if( !v7 )
    {
      VerifierBugCheckIfAppropriate(0xC4ui64, 0x89u, v4, (ULONG_PTR)v1, Param4, v8);
      Param4 = *v1;
    }
    if( !MmGetPfnDb()[Param4].u3.ReferenceCount )
      VerifierBugCheckIfAppropriate(0xC4ui64, 0x85u, v4, v3, (__int64)(48 * Param4) / 48, v8);
LABEL_8:
    ++v1;
  }
  while( v1 < v5 );
}

Referenced by:

ViMmMapLockedPagesSanityChecks