MiSessionUpdateImageCharges

__int64 __fastcall MiSessionUpdateImageCharges(__int64 a1){
  RTL_BALANCED_NODE *v1; 
  __int64 v2; 
  __int64 v3; 
  UINT64 v4; 
  __int64 v5; 
  v1 = MiSessionLookupImage(*(_QWORD *)(a1 + 48));
  v3 = MiCountSystemImageCommitment(v2);
  v4 = (UINT64)v1[3].Children[0] - v3;
  if( v4 )
  {
    v5 = *(_QWORD *)(*((_QWORD *)KeGetCurrentThread() + 23) + 1368i64);
    MiReturnCommit(*(_MI_PARTITION **)(qword_140C4E388 + 8i64 * *(unsigned __int16 *)(v5 + 430)), v4);
    v1[3].Children[0] = (_RTL_BALANCED_NODE *)v3;
    _InterlockedExchangeAdd64((volatile signed __int64 *)(v5 + 48), -(__int64)v4);
  }
  return 0i64;
}

Referenced by:

MiDriverLoadSucceeded