MmEnoughMemoryForWrite

UINT8 __stdcall MmEnoughMemoryForWrite(_SECTION_OBJECT_POINTERS *SectionObjectPointer){
  _CONTROL_AREA *v1; 
  bool v2; 
  UINT8 v3; 
  _CONTROL_AREA *v4; 
  _MI_PARTITION *v5; 
  UINT8 v7; 

  v1 = 0i64;
  v2 = 0;
  v3 = 17;
  v7 = 17;
  if( SectionObjectPointer )
  {
    v4 = MiLockSectionControlArea((_MI_SECTION_OBJECT_POINTERS *)SectionObjectPointer, 1ui64, &v7);
    v1 = v4;
    if( !v4 )
      return 1;
    v3 = v7;
    v5 = *(_MI_PARTITION **)(*(&stru_140C4DB30 + 267) + 8i64 * (v4->u1.Flags._bf_0 & 0x3FF));
  }
  else
  {
    v5 = &Irp;
  }
  if( MiSufficientAvailablePages((INT64)v5, (_BYTE)dword_140CFA19C != 0 ? 0x4000i64 : 450i64) )
  {
    v2 = 1;
  }
  else if( v5->Vp.ModifiedPageListHead.Total < v5->Vp.TotalPagesForPagingFile + 800 )
  {
    v2 = MiSufficientAvailablePages((INT64)v5, 0x50ui64) != 0;
  }
  if( v3 != 17 )
  {
    ExReleaseSpinLockExclusiveFromDpcLevel((INT64 *)&v1->ControlAreaLock);
    __writecr8(v3);
  }
  return v2;
}

Referenced by:

CcCanIWriteStreamEx