MiPageFileNoFreeSpace

VOID __stdcall MiPageFileNoFreeSpace(_MMPAGING_FILE *PagingFile, _MMMOD_WRITER_MDL_ENTRY *ModWriterEntry){
  _MI_PARTITION *Partition; 
  UINT64 v4; 
  unsigned __int64 v6; 
  int v7; 
  unsigned __int64 v8; 
  unsigned __int64 TotalCommitLimit; 
  unsigned __int64 TotalCommittedPages; 
  volatile unsigned int NumberOfPagingFiles; 
  volatile unsigned int v12; 
  _MMPAGING_FILE **v13; 
  unsigned __int64 TotalPagesForPagingFile; 

  Partition = PagingFile->Partition;
  v4 = 1i64;
  MiFreeModifiedReservations(PagingFile, 1ui64);
  v6 = 0i64;
  v7 = 0;
  v8 = (unsigned __int8)ExAcquireSpinLockExclusive((INT64 *)&PagingFile->SpinLock);
  if( PagingFile->FreeSpace )
  {
    MiMakePagefileWriterEntryAvailable(ModWriterEntry);
  }
  else
  {
    BYTE2(PagingFile->_bf_cc) |= 1u;
    v7 = 1;
  }
  ExReleaseSpinLockExclusiveFromDpcLevel((INT64 *)&PagingFile->SpinLock);
  __writecr8(v8);
  if( v7 == 1 )
  {
    ModWriterEntry->Links.Flink = (_LIST_ENTRY *)2575857425i64;
    TotalCommitLimit = Partition->Vp.TotalCommitLimit;
    TotalCommittedPages = Partition->Vp.TotalCommittedPages;
    if( TotalCommittedPages > TotalCommitLimit )
      TotalCommittedPages = Partition->Vp.TotalCommitLimit;
    if( (PagingFile->_bf_cc & 0x10) == 0 )
    {
      if( TotalCommittedPages > (((TotalCommitLimit * (unsigned __int128)0xCCCCCCCCCCCCCCCDui64) >> 64) & 0xFFFFFFFFFFFFFFF8ui64)
        && TotalCommitLimit < Partition->Commit.TotalCommitLimitMaximum )
      {
        MiCauseOverCommitPopup(Partition);
LABEL_20:
        if( Partition->Vp.TotalCommitLimit < Partition->Commit.TotalCommitLimitMaximum )
          MiIssuePageExtendRequest(Partition, v4, 6ui64, 0i64);
        return;
      }
      if( Partition->Vp.TotalPagesForPagingFile >= 0x1000 )
      {
        NumberOfPagingFiles = Partition->Vp.NumberOfPagingFiles;
        v12 = 0;
        if( NumberOfPagingFiles )
        {
          v13 = Partition->Vp.PagingFile;
          do
          {
            if( ((*v13)->_bf_cc & 0x50) == 0 )
            {
              if( v6 + (*v13)->FreeSpace < v6 )
                break;
              v6 += (*v13)->FreeSpace;
            }
            ++v12;
            ++v13;
          }
          while( v12 < NumberOfPagingFiles );
        }
        TotalPagesForPagingFile = Partition->Vp.TotalPagesForPagingFile;
        if( TotalPagesForPagingFile > v6 )
        {
          v4 = TotalPagesForPagingFile - v6;
          if( v4 )
            goto LABEL_20;
        }
      }
    }
  }
}

Referenced by:

MiGatherPagefilePages