MiMoveBadPageCrossPartition
INT64 __fastcall MiMoveBadPageCrossPartition(INT64 a1, INT64 a2, UINT64 *a3){
__int64 v5;
__int64 v6;
__int64 v7;
__int64 v8;
WORK_QUEUE_TYPE v9;
PVOID v10;
UINT64 v11;
WORK_QUEUE_TYPE v12;
PVOID v13;
unsigned __int64 v14;
INT64 result;
struct _KPRCB *CurrentPrcb;
__int64 v17;
bool v18;
_BYTE LockHandle[56];
*(_QWORD *)&LockHandle[16] = 0i64;
LODWORD(v5) = MiSearchNumaNodeTable((PVOID)((a1 - (__int64)MmGetPfnDb()) / 48));
v6 = *(_QWORD *)(a2 + 16);
v7 = *(unsigned int *)(v5 + 8);
*(_QWORD *)LockHandle = 0i64;
v8 = 4544 * v7;
*(_QWORD *)&LockHandle[8] = 4544 * v7 + v6 + 4328;
KxAcquireQueuedSpinLock((PIO_WORKITEM)LockHandle, *(PIO_WORKITEM_ROUTINE *)&LockHandle[8], v9, v10);
--*(_QWORD *)(v8 + v6 + 4352);
KeReleaseInStackQueuedSpinLockFromDpcLevel((_KLOCK_QUEUE_HANDLE *)LockHandle);
v11 = a3[2];
*(_QWORD *)LockHandle = 0i64;
*(_QWORD *)&LockHandle[8] = v8 + v11 + 4328;
KxAcquireQueuedSpinLock((PIO_WORKITEM)LockHandle, *(PIO_WORKITEM_ROUTINE *)&LockHandle[8], v12, v13);
v14 = 1i64;
++*(_QWORD *)(v8 + v11 + 4352);
KeReleaseInStackQueuedSpinLockFromDpcLevel((_KLOCK_QUEUE_HANDLE *)LockHandle);
MiAcquireNonPagedResources((_MI_PARTITION *)a3, 1ui64);
MiReturnCommit((_MI_PARTITION *)a2, 1ui64);
result = (INT64)&MiSystemPartition;
if( (ULONG_PTR *)a2 != &MiSystemPartition )
goto LABEL_12;
CurrentPrcb = KeGetCurrentPrcb();
v17 = *((int *)CurrentPrcb + 8391);
if( (_DWORD)v17 == -1 )
goto LABEL_12;
if( (unsigned __int64)(v17 + 1) > 0x100 )
{
LABEL_7:
if( (int)v17 > 192 && (_DWORD)v17 != -1 )
{
result = (unsigned int)_InterlockedCompareExchange((volatile signed __int32 *)CurrentPrcb + 8391, 192, v17);
if( (_DWORD)v17 == (_DWORD)result )
{
result = (unsigned int)(v17 - 192);
v14 = (int)result + 1i64;
}
}
if( !v14 )
return result;
LABEL_12:
_InterlockedExchangeAdd64((volatile signed __int64 *)(a2 + 7168), v14);
return result;
}
while( 1 )
{
result = (unsigned int)_InterlockedCompareExchange((volatile signed __int32 *)CurrentPrcb + 8391, v17 + 1, v17);
v18 = (_DWORD)v17 == (_DWORD)result;
v17 = (int)result;
if( v18 )
return result;
if( (_DWORD)result != -1 )
{
result = (int)result + 1i64;
if( (unsigned __int64)(v17 + 1) <= 0x100 )
continue;
}
goto LABEL_7;
}
}Referenced by:
MiActOnPartitionNodePages
MiMoveLargeFreePage
MiTransferPartitionPageRun