MiFaultGetFileExtents
NTSTATUS __stdcall MiFaultGetFileExtents(INT64 a1, INT64 a2){
_SUBSECTION *v2;
_MMPTE *v4;
_CONTROL_AREA *ControlArea;
unsigned int SessionId;
NTSTATUS FileExtents;
UINT64 AllocationFlags;
v2 = *(_SUBSECTION **)(a2 + 208);
v4 = *(_MMPTE **)(a2 + 232);
ControlArea = v2->ControlArea;
if( (v2->u.SubsectionFlags._bf_2 & 2) != 0 )
{
SessionId = MmGetSessionIdEx(KeGetCurrentThread()->ApcState.Process);
v4 = &v2->SubsectionBase[((char *)v4 - (char *)MiGetSharedProtos(ControlArea, SessionId, v2)[3].Children[0]) >> 3];
}
MiRetainSubsection(v2);
ExAcquireSpinLockExclusiveAtDpcLevel((INT64 *)&ControlArea->ControlAreaLock);
++ControlArea->NumberOfMappedViews;
++ControlArea->NumberOfUserReferences;
ExReleaseSpinLockExclusiveFromDpcLevel((INT64 *)&ControlArea->ControlAreaLock);
MiReleaseFaultSynchronization(a1);
LODWORD(AllocationFlags) = 2;
FileExtents = MiAllocateFileExtents(v2, v4 - v2->SubsectionBase, v4, 1ui64, AllocationFlags);
MiFreeInPageSupportBlock((_MMINPAGE_SUPPORT *)a2);
MiDereferenceControlArea(ControlArea);
MiReleaseFaultCharges(v2);
return FileExtents;
}Referenced by:
MmAccessFault