MiReturnCrossPartitionSectionCharges
VOID __fastcall MiReturnCrossPartitionSectionCharges(_MI_CROSS_PARTITION_CHARGES *ChargeInfo, INT64 a2, UINT64 a3){
unsigned __int64 v5;
struct _KPRCB *CurrentPrcb;
__int64 CachedResidentAvailable;
bool v8;
signed __int32 v9;
if( (_DWORD)a2 )
MiReturnCommit((_MI_PARTITION *)ChargeInfo, a3);
v5 = a3;
if( ChargeInfo == (_MI_CROSS_PARTITION_CHARGES *)&Irp )
{
CurrentPrcb = KeGetCurrentPrcb();
CachedResidentAvailable = (int)CurrentPrcb->CachedResidentAvailable;
if( (_DWORD)CachedResidentAvailable != -1 )
{
if( a3 + CachedResidentAvailable <= 0x100 )
{
do
{
if( a3 >= 0x80000 )
break;
v9 = _InterlockedCompareExchange(
(volatile signed __int32 *)&CurrentPrcb->CachedResidentAvailable,
CachedResidentAvailable + a3,
CachedResidentAvailable);
v8 = (_DWORD)CachedResidentAvailable == v9;
LODWORD(CachedResidentAvailable) = v9;
if( v8 )
goto LABEL_16;
}
while( v9 != -1 && a3 + v9 <= 0x100 );
}
if( (int)CachedResidentAvailable > 192
&& (_DWORD)CachedResidentAvailable != -1
&& (_DWORD)CachedResidentAvailable == _InterlockedCompareExchange(
(volatile signed __int32 *)&CurrentPrcb->CachedResidentAvailable,
192,
CachedResidentAvailable) )
{
v5 = a3 + (int)CachedResidentAvailable - 192;
}
}
}
if( v5 )
_InterlockedExchangeAdd64((volatile signed __int64 *)&ChargeInfo[224], v5);
LABEL_16:
MiReturnCrossPartitionCharges(ChargeInfo, 0i64);
}Referenced by:
MiAddViewsForSection
MiAppendSubsectionChain
MiChargeSegmentCommit
MiCheckControlArea
MiCleanSection
MiCreatePrototypePtes
MiDecrementSubsection
MiDeleteCachedSegment
MiDeleteCachedSubsection
MiDeleteControlArea
MiDeletePartialVad
MiDeleteSubsectionPages
MiDeleteVad
MiDereferenceControlAreaPfnList
MiExtendSection
MiFlushControlArea
MiFlushRelease
MiFlushSectionInternal
MiMakeUnusedSegmentDeleteOnClose
MiProcessDeleteOnClose
MiReferenceActiveSubsection
MiReleaseFaultCharges
MiRemoveMappedPtes
MiRemoveSystemCacheReferences
MiRemoveViewsFromSectionWithPfn
MiReturnCrossPartitionControlAreaCharges
MiSegmentDelete
MiSetDeleteOnClose
MiUpControlAreaRefs
MiUpdateActiveSubsection
MiUpdateLastSubsectionSize
MmPurgeSection
MmUnmapViewInSystemCache