MiInitializeImageExtents

NTSTATUS __stdcall MiInitializeImageExtents(_CONTROL_AREA *ControlArea){
  _SUBSECTION *v2; 
  int FileExtents; 
  __int64 CommittedPages; 
  UINT64 v6; 

  v2 = (_SUBSECTION *)&ControlArea[1];
  FileExtents = 0;
  while( v2 )
  {
    LODWORD(v6) = 0;
    FileExtents = MiAllocateFileExtents(v2, 0i64, v2->SubsectionBase, v2->PtesInSubsection, v6);
    if( FileExtents < 0 )
    {
      CommittedPages = MiGetCommittedPages(ControlArea);
      if( CommittedPages )
        ControlArea->Segment->NumberOfCommittedPages = 0i64;
      MiDeleteSegmentPages(ControlArea);
      if( CommittedPages )
        ControlArea->Segment->NumberOfCommittedPages = CommittedPages;
      return FileExtents;
    }
    v2 = v2->NextSubsection;
  }
  return FileExtents;
}

Referenced by:

MiCreateImageFileMap