MiInitializeMdlPages

_MDL *__stdcall MiInitializeMdlPages(
        _MDL *MemoryDescriptorList,
        UINT64 Flags,
        _MI_PFN_CACHE_ATTRIBUTE CacheAttribute,
        UINT64 MdlPageSpan,
        UINT64 ZeroingNecessary){
  _MDL *v5; 
  unsigned __int64 v6; 
  int v7; 
  _MDL *v8; 
  INT64 v9; 
  unsigned __int8 CurrentIrql; 
  unsigned __int64 v11; 
  _MDL *result; 
  INT64 v13; 
  UINT64 v15; 
  v5 = MemoryDescriptorList + 1;
  v6 = (unsigned __int64)MemoryDescriptorList->ByteCount >> 12;
  v7 = Flags;
  v8 = MemoryDescriptorList;
  if( (Flags & 0x80000200) != 0 )
    v9 = 0i64;
  else
    v9 = MiSwizzleInvalidPte(128i64);
  v15 = *((_QWORD *)KeGetCurrentThread() + 23);
  CurrentIrql = KeGetCurrentIrql();
  __writecr8(2ui64);
  v11 = 0i64;
  if( v6 )
  {
    do
    {
      LODWORD(v13) = v7;
      MiInitializeMdlLeafPfns((INT64)MmGetPfnDb() + 48 * (__int64)v5->Next, 1i64, v15, v9, v13);
      if( CurrentIrql < 2u && (v11 & 0xF) == 0 && KeShouldYieldProcessor() )
      {
        __writecr8(CurrentIrql);
        CurrentIrql = KeGetCurrentIrql();
        __writecr8(2ui64);
      }
      ++v11;
      v5 = (_MDL *)((char *)v5 + 8);
    }
    while( v11 < v6 );
    v8 = MemoryDescriptorList;
  }
  __writecr8(CurrentIrql);
  v8->Process = 0i64;
  result = (_MDL *)2;
  v8->MdlFlags |= 2u;
  return result;
}

Referenced by:

MiAllocatePagesForMdl
MiReturnMdlExcess