mirror of
https://github.com/reactos/reactos.git
synced 2025-04-05 21:21:33 +00:00
[NTOS:MM] Do not chunk-read files marked with FO_RANDOM_ACCESS
This commit is contained in:
parent
f04890c2af
commit
35c091adaf
1 changed files with 13 additions and 3 deletions
|
@ -1200,9 +1200,19 @@ MmMakeSegmentResident(
|
|||
if (!NT_SUCCESS(Status))
|
||||
return Status;
|
||||
|
||||
RangeStart = Offset - (Offset % _64K);
|
||||
if (RangeEnd % _64K)
|
||||
RangeEnd += _64K - (RangeEnd % _64K);
|
||||
/* If the file is not random access, read a 64K Chunk. */
|
||||
if (!FlagOn(FileObject->Flags, FO_RANDOM_ACCESS))
|
||||
{
|
||||
RangeStart = Offset - (Offset % _64K);
|
||||
if (RangeEnd % _64K)
|
||||
RangeEnd += _64K - (RangeEnd % _64K);
|
||||
}
|
||||
else
|
||||
{
|
||||
RangeStart = Offset - (Offset % PAGE_SIZE);
|
||||
if (RangeEnd % PAGE_SIZE)
|
||||
RangeEnd += PAGE_SIZE - (RangeEnd % PAGE_SIZE);
|
||||
}
|
||||
|
||||
/* Clamp if needed */
|
||||
if (!FlagOn(*Segment->Flags, MM_DATAFILE_SEGMENT))
|
||||
|
|
Loading…
Reference in a new issue