MiIssuePageExtendRequest
VOID __fastcall MiIssuePageExtendRequest(
_MI_PARTITION *Partition,
UINT64 QuotaCharge,
UINT64 PageFileNumber,
UINT64 IncreaseMinimumSize){
char v5;
volatile unsigned int v7;
_ETHREAD *CurrentThread;
int v9;
int v10;
__int64 *v11;
int v12;
char v13;
UINT64 v14;
__int64 *v15;
volatile unsigned int NumberOfPagingFiles;
char v17;
volatile unsigned int v18;
_MMPAGING_FILE **PagingFile;
char v20;
char v21;
char v22;
unsigned __int64 v23;
__int64 v24;
__int64 v25;
__int64 **v26;
__int64 v27[12];
v5 = PageFileNumber;
v7 = IncreaseMinimumSize;
memset(v27, 0i64, 0x58u);
CurrentThread = (_ETHREAD *)KeGetCurrentThread();
v9 = v5 & 8;
if( (v5 & 8) != 0 && !Partition->Segments.SegmentDereferenceThreadExists )
return;
v10 = v5 & 2;
if( (v5 & 2) != 0 )
{
v11 = (__int64 *)((char *)Partition + (v9 != 0 ? 1432i64 : 440i64));
if( _InterlockedCompareExchange((volatile signed __int32 *)v11 + 18, 1, 0) )
return;
v12 = *((unsigned __int8 *)v11 + 79);
QuotaCharge = (QuotaCharge + 4095) & 0xFFFFFFFFFFFFF000ui64;
if( (v5 & 4) != 0 )
v13 = v12 | 1;
else
v13 = v12 & 0xFE;
*((_BYTE *)v11 + 79) = v13;
v14 = 0i64;
v15 = 0i64;
goto LABEL_27;
}
if( CurrentThread->Win32StartAddress == MiDereferenceSegmentThread || KeGetCurrentIrql() >= 2u )
return;
if( (v5 & 8) != 0 )
QuotaCharge = (QuotaCharge + 0xFFFF) & 0xFFFFFFFFFFFF0000ui64;
NumberOfPagingFiles = Partition->Vp.NumberOfPagingFiles;
v11 = v27;
LODWORD(v27[9]) = 1;
v27[0] = 0i64;
BYTE4(v27[9]) = v7;
if( (v5 & 1) != 0 )
v17 = HIBYTE(v27[9]) & 0xE8 | 2;
else
v17 = HIBYTE(v27[9]) & 0xE8;
HIBYTE(v27[9]) = v17;
v27[8] = (__int64)&v27[7];
v27[7] = (__int64)&v27[7];
LOWORD(v27[6]) = 0;
BYTE2(v27[6]) = 6;
HIDWORD(v27[6]) = 0;
if( (v5 & 8) != 0 )
{
v15 = &MiOneSecond;
LABEL_26:
v14 = 1i64;
LABEL_27:
v20 = *((_BYTE *)v11 + 79);
if( v9 )
v21 = v20 | 8;
else
v21 = v20 & 0xF7;
*((_BYTE *)v11 + 79) = v21;
v11[5] = 0i64;
v11[10] = 0i64;
v22 = *((_BYTE *)v11 + 79);
v11[4] = QuotaCharge;
v11[3] = (__int64)Partition;
*((_BYTE *)v11 + 79) = v22 & 0xDF | (&MiOneSecond != v15 ? 0x20 : 0);
MiQueuePageFileExtension((_MMPAGE_FILE_EXPANSION *)v11, v14);
if( !v10 && KeWaitForSingleObject((UINT64)(v11 + 6), 0, 0, 0, (INT64)v15) == 258 )
{
v23 = (unsigned __int8)ExAcquireSpinLockExclusive((INT64 *)&Partition->Segments.SegmentListLock);
if( !*((_DWORD *)v11 + 13) )
{
v24 = v11[10];
if( v24 )
{
*(_QWORD *)(v24 + 80) = 0i64;
}
else
{
v25 = v11[1];
v26 = (__int64 **)v11[2];
if( *(__int64 **)(v25 + 8) != v11 + 1 || *v26 != v11 + 1 )
__fastfail(3u);
*v26 = (__int64 *)v25;
*(_QWORD *)(v25 + 8) = v26;
}
v11[5] = 0i64;
}
ExReleaseSpinLockExclusiveFromDpcLevel((INT64 *)&Partition->Segments.SegmentListLock);
__writecr8(v23);
}
return;
}
if( v7 < NumberOfPagingFiles )
{
v15 = 0i64;
goto LABEL_26;
}
v15 = &MiOneSecond;
v18 = 0;
if( NumberOfPagingFiles )
{
PagingFile = Partition->Vp.PagingFile;
do
{
if( ((*PagingFile)->_bf_cc & 0x50) == 0 && (*PagingFile)->Size < (*PagingFile)->MaximumSize )
break;
++v18;
++PagingFile;
}
while( v18 < NumberOfPagingFiles );
}
if( v18 != NumberOfPagingFiles )
goto LABEL_26;
}Referenced by:
MiChargeCommit
MiCreatePagingFile
MiExtendWorkingSetSwapPagefile
MiPageFileNoFreeSpace
MmResourcesAvailable