MiAllocateFastLargePagesForMdl
INT64 __stdcall MiAllocateFastLargePagesForMdl(UINT64 rcx0, UINT64 edx0, INT8 a3){
unsigned int v4;
int v6;
__int64 v7;
__int64 v8;
int v9;
int v10;
unsigned __int64 v11;
CHAR v12;
INT64 LargeZeroPages;
int v14;
unsigned __int8 CurrentIrql;
__int64 v16;
_QWORD *v17;
INT64 *v18;
unsigned __int64 v19;
INT64 v20;
unsigned int v21;
__int64 v22;
__int64 v23;
UINT64 ProtectionMask;
INT64 v25[2];
__int128 v26;
INT64 result[23];
int v28;
v4 = edx0;
memset((INT64)result, 0i64);
v6 = *(_DWORD *)(rcx0 + 60);
v7 = *(_QWORD *)(rcx0 + 64);
v8 = 4i64;
*(_OWORD *)v25 = 0i64;
v26 = 0i64;
if( v6 )
{
if( v6 == 2 )
{
v9 = 28;
}
else
{
v9 = 4;
if( v6 == 3 )
v9 = 0;
}
}
else
{
v9 = 12;
}
v10 = a3 & 1;
v11 = (unsigned __int64)*(unsigned int *)(v7 + 40) >> 12;
v12 = (2 * v10 + 1) | 4;
if( *(_QWORD *)(rcx0 + 16) != 0x100000i64 )
v12 = 2 * v10 + 1;
LODWORD(ProtectionMask) = v9;
LargeZeroPages = MiAllocateLargeZeroPages(
*(_QWORD *)rcx0,
*(_QWORD *)(rcx0 + 40) - v11,
*(_QWORD *)(rcx0 + 32),
v4,
ProtectionMask,
(INT64)v25,
v12);
v14 = LargeZeroPages;
if( LargeZeroPages )
{
CurrentIrql = KeGetCurrentIrql();
MiInitializeDpcGang((INT64)result, v4, CurrentIrql < 2u ? 0 : 2);
v28 |= 0x40u;
v16 = 0i64;
*(_QWORD *)(rcx0 + 72) = *((_QWORD *)KeGetCurrentThread() + 23);
result[0] = rcx0;
v17 = (_QWORD *)(v7 + 48 + 8 * v11);
do
{
v18 = (INT64 *)v25[v16];
v19 = MiLargePageSizes[v16];
if( v18 )
{
do
{
v20 = *v18;
v21 = 0;
v22 = ((char *)v18 - (char *)MmGetPfnDb()) / 48;
if( v19 )
{
v23 = 0i64;
do
{
++v21;
*v17++ = v22 + v23;
v23 = v21;
}
while( v21 < v19 );
}
MiInsertDpcGang((INT64)result, v18);
v18 = (INT64 *)v20;
}
while( v20 );
}
++v16;
--v8;
}
while( v8 );
*(_DWORD *)(v7 + 40) += v14 << 12;
MiStartDpcGang((UINT64 *)result);
MiEndDpcGang((INT64)result);
*(_QWORD *)(v7 + 16) = 0i64;
LargeZeroPages = 2i64;
*(_WORD *)(v7 + 10) |= 2u;
if( v10 )
*(_QWORD *)(v7 + 24) = 1i64;
}
return LargeZeroPages;
}Referenced by:
MiFindPagesForMdl