[NTOS:MM] Properly handle the 1-offset of paging files

This commit is contained in:
Jérôme Gardou 2020-12-07 10:22:28 +01:00
parent a46ee7dafe
commit 857dd4ae36

View file

@ -189,7 +189,7 @@ NTSTATUS
NTAPI
MmReadFromSwapPage(SWAPENTRY SwapEntry, PFN_NUMBER Page)
{
return MiReadPageFile(Page, FILE_FROM_ENTRY(SwapEntry), OFFSET_FROM_ENTRY(SwapEntry) - 1);
return MiReadPageFile(Page, FILE_FROM_ENTRY(SwapEntry), OFFSET_FROM_ENTRY(SwapEntry));
}
NTSTATUS
@ -215,6 +215,9 @@ MiReadPageFile(
return(STATUS_UNSUCCESSFUL);
}
/* Normalize offset. */
PageFileOffset--;
ASSERT(PageFileIndex < MAX_PAGING_FILES);
PagingFile = MmPagingFile[PageFileIndex];