MiAllocateSkipPagesForMdl
INT64 __fastcall MiAllocateSkipPagesForMdl(INT64 a1, INT64 a2, INT64 a3){
int v3;
__int64 StartingPfn;
int v5;
UINT64 v6;
UINT64 v8;
UINT64 v9;
unsigned __int64 v10;
UINT64 SizeInPages;
int v12;
INT64 result;
UINT64 PreferredNode;
UINT64 PreferredChannel;
UINT64 Flags;
v3 = a3;
StartingPfn = *(_QWORD *)(a1 + 64);
v5 = a2;
v6 = *(_QWORD *)(a1 + 32);
v8 = *(_QWORD *)(a1 + 16);
v9 = *(_QWORD *)(a1 + 24);
v10 = (unsigned __int64)*(unsigned int *)(StartingPfn + 40) >> 12;
if( v6 )
SizeInPages = *(_QWORD *)(a1 + 32);
else
SizeInPages = *(_QWORD *)(a1 + 40) - v10;
v12 = v3 | 0x60000000;
while( 1 )
{
LODWORD(Flags) = v12;
LODWORD(PreferredChannel) = 0x80000000;
LODWORD(PreferredNode) = v5;
result = MiFindContiguousPages(
*(_MI_PARTITION **)a1,
v8,
v9,
v6,
SizeInPages,
(_MI_PFN_CACHE_ATTRIBUTE)*(_DWORD *)(a1 + 60),
PreferredNode,
PreferredChannel,
Flags,
(UINT64 *)StartingPfn);
if( (int)result < 0 )
break;
v10 += SizeInPages;
if( v10 == *(_QWORD *)(a1 + 40) )
break;
v9 = -2i64;
result = -1i64 - v8;
if( -1i64 - v8 < SizeInPages )
break;
v6 = *(_QWORD *)(a1 + 32);
StartingPfn = *(_QWORD *)(a1 + 64);
}
return result;
}Referenced by:
MiFindPagesForMdl