[NTOS:MM] Do not chunk-read file when we are the modified-page-writer thread

This commit is contained in:
Jérôme Gardou 2021-02-23 11:07:35 +01:00
parent 35c091adaf
commit a93e065ebc

View file

@ -1200,8 +1200,10 @@ MmMakeSegmentResident(
if (!NT_SUCCESS(Status))
return Status;
/* If the file is not random access, read a 64K Chunk. */
if (!FlagOn(FileObject->Flags, FO_RANDOM_ACCESS))
/* If the file is not random access and we are not the page out thread
* read a 64K Chunk. */
if (((ULONG_PTR)IoGetTopLevelIrp() != FSRTL_MOD_WRITE_TOP_LEVEL_IRP)
&& !FlagOn(FileObject->Flags, FO_RANDOM_ACCESS))
{
RangeStart = Offset - (Offset % _64K);
if (RangeEnd % _64K)