MiReleasePageFileInfo
VOID __stdcall MiReleasePageFileInfo(_MI_PARTITION *Partition, _MMPTE PteContents, UINT64 Flags){
unsigned __int64 Long;
unsigned __int64 v4;
unsigned __int64 v5;
unsigned __int64 v6;
_MMPAGING_FILE *v7;
INT64 *p_SpinLock;
int v9;
unsigned __int8 v10;
_MI_PAGING_FILE_SPACE_BITMAPS *Bitmaps;
unsigned __int64 v12;
int v14;
char v15;
v15 = Flags;
Long = PteContents.u.Long;
if( *(&stru_140C4DB30 + 42) && (PteContents.u.Long & 0x10) == 0 )
Long = PteContents.u.Long & ~*(&stru_140C4DB30 + 42);
v4 = HIDWORD(Long);
v5 = (PteContents.u.Long >> 1) & 1;
v6 = (PteContents.u.Long >> 2) & 1;
v14 = 0;
v7 = Partition->Vp.PagingFile[LOWORD(PteContents.u.Long) >> 12];
p_SpinLock = (INT64 *)&v7->SpinLock;
v9 = Flags & 1;
if( (Flags & 1) != 0 )
{
ExAcquireSpinLockExclusiveAtDpcLevel(p_SpinLock);
v10 = 2;
}
else
{
v10 = ExAcquireSpinLockExclusive(p_SpinLock);
}
Bitmaps = v7->Bitmaps;
if( (_DWORD)v5 )
{
_bittestandreset((signed __int32 *)Bitmaps->ReservationBitmap.Buffer, v4);
++v7->FreeReservationSpace;
}
if( (_DWORD)v6 )
{
if( (v15 & 2) == 0 )
MiClearPageFileHash(v7, (unsigned int)v4);
if( (v7->_bf_cc & 0x40) != 0 )
{
MiStoreSetEvictPageFile(v7, (unsigned int)v4);
goto LABEL_13;
}
_bittestandreset((signed __int32 *)Bitmaps->AllocationBitmap.Buffer, v4);
v12 = ++v7->FreeSpace;
if( (unsigned int)v4 < v7->AllocationBitmapHint )
v7->AllocationBitmapHint = v4;
++v7->RefreshAllocationCluster;
if( v12 == 1 && (v7->_bf_cc & 0x10000) != 0 )
v14 = 1;
}
if( ((_DWORD)v5 || !_bittest64((const signed __int64 *)Bitmaps->ReservationBitmap.Buffer, v4))
&& ((_DWORD)v6 || !_bittest64((const signed __int64 *)Bitmaps->AllocationBitmap.Buffer, v4)) )
{
MiCoalescePageFileBitmapsCache(v7, (unsigned int)v5, (unsigned int)v4);
_InterlockedExchange(
&v7->Partition->Modwriter.ModWriteData.ReservationClusterInfo._bf_0,
(v7->Partition->Modwriter.ModWriteData.ReservationClusterInfo._bf_0 & 0xFFFFFC00 | 0x200) + 1024);
}
LABEL_13:
ExReleaseSpinLockExclusiveFromDpcLevel((INT64 *)&v7->SpinLock);
if( !v9 )
__writecr8(v10);
if( v14 == 1 )
KeSetEvent((PRKEVENT)Partition->Modwriter.gap1B8, 0, 0);
}Referenced by:
MiAllocateWsle
MiBuildForkPte
MiBuildReservationCluster
MiCompleteProtoPteFault
MiCompleteSecureProcessFault
MiConvertPrivateToProto
MiConvertStandbyToProto
MiDecommitPages
MiDeleteBatch
MiDeleteClusterPage
MiDeletePteList
MiDeletePteRun
MiDeleteSubsectionPages
MiDeleteTransitionPte
MiDeleteVa
MiDeleteValidSystemPage
MiFinishHardFault
MiFreeModifiedReservations
MiFreeReservationRun
MiHandleForkTransitionPte
MiInPageSingleKernelStack
MiLockCode
MiLockDriverPageRange
MiLockPageAndSetDirty
MiLockPageTablePage
MiLockPagedAddress
MiMakeOutswappedPageResident
MiMigratePfn
MiMoveDirtyBitsToPfns
MiOutSwapWorkingSetPte
MiPfnShareCountIsZero
MiPurgeImageSection
MiReleasePageFileSpace
MiReservePageFileSpace
MiReservePageFileSpaceForPage
MiResolveProtoCombine
MiResolveTransitionFault
MiRevertValidPte
MiScanPagefileSpace
MiSetPagesModified
MiSetSystemCodeProtection
MiStoreMarkLockedPagesModified
MiStoreWriteModifiedPages
MiTrimSystemImagePages
MiTrimUnusedPageFileRegionsWorker
MiUnlockStoreLockedPages
MiUpdateImportRelocationsOnDriverPrivatePages
MiWalkEntireImage
MiWalkVaRange
MiWriteComplete
MiWsleFree
MiZeroCfgSystemWideBitmapWorker
MmDbgMarkPfnModifiedWorker
MmProtectPool
MmReplaceImportEntry
MmSetAddressRangeModifiedEx
MmUnlockPages
MmUnmapViewInSystemCache
MmUpdateUserShadowStackValue