MiReleasePartitionHugeIoSpace
NTSTATUS __stdcall MiReleasePartitionHugeIoSpace(PVOID BugCheckParameter2){
INT64 v1;
__int64 v3;
_MI_PARTITION *v4;
_RTL_BALANCED_NODE **v5;
_RTL_BALANCED_NODE *v6;
_RTL_AVL_TREE *p_HugePfnBadPages;
_RTL_BALANCED_NODE *Root;
BOOL v9;
_RTL_BALANCED_NODE *v10;
void *v11;
INT64 Flags;
INT64 a6;
_KLOCK_QUEUE_HANDLE LockHandle;
v1 = *((_QWORD *)BugCheckParameter2 + 771) << 18;
memset(&LockHandle, 0, sizeof(LockHandle));
v3 = *((_QWORD *)BugCheckParameter2 + 22);
v4 = **(_MI_PARTITION ***)(v3 + 56);
if( v1 )
{
LODWORD(a6) = 1;
LODWORD(Flags) = 769;
LODWORD(v3) = MiAllocatePartitionPhysicalPages((_MI_PARTITION *)BugCheckParameter2, v4, v1, 0i64, Flags, a6);
}
v5 = (_RTL_BALANCED_NODE **)((char *)BugCheckParameter2 + 4896);
if( *((_QWORD *)BugCheckParameter2 + 612) )
{
KeAcquireInStackQueuedSpinLock(&v4->PageLists.BadPageListHead.Lock, &LockHandle);
v6 = *v5;
if( !*v5 )
goto LABEL_14;
p_HugePfnBadPages = &v4->PageLists.HugePfnBadPages;
while( 1 )
{
RtlAvlRemoveNode((UINT64 *)BugCheckParameter2 + 612, (INT64 *)v6);
Root = p_HugePfnBadPages->Root;
v9 = 0;
if( !p_HugePfnBadPages->Root )
goto LABEL_13;
while( ((unsigned __int64)v6[1].Children[0] & 0x3FFFF) < ((unsigned __int64)Root[1].Children[0] & 0x3FFFF) )
{
v10 = Root->Children[0];
if( !Root->Children[0] )
goto LABEL_13;
LABEL_11:
Root = v10;
}
v10 = Root->Children[1];
if( v10 )
goto LABEL_11;
v9 = 1;
LABEL_13:
RtlAvlInsertNodeEx(&v4->PageLists.HugePfnBadPages.Root, (UINT64)Root, v9, v6);
--*((_QWORD *)BugCheckParameter2 + 53);
++v4->Core.TotalHugeIoRanges;
v6 = *v5;
if( !*v5 )
{
LABEL_14:
LODWORD(v3) = (unsigned int)KeReleaseInStackQueuedSpinLock(&LockHandle);
break;
}
}
}
v11 = (void *)*((_QWORD *)BugCheckParameter2 + 53);
if( v11 )
KeBugCheckEx(0x1Au, (PVOID)0x30000003, BugCheckParameter2, v11, *((PVOID *)BugCheckParameter2 + 771));
return v3;
}Referenced by:
MiReturnPartitionPagesToParent