From 12e2c48a25240c05b73dcec86ce8ae9370b59b1c Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 19 Dec 2017 15:17:35 +0100 Subject: [PATCH] [NTOS:MM] Fix a bug in MiBuildPfnDatabase MxPfnAllocation is in pages, not in bytes! --- ntoskrnl/mm/amd64/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ntoskrnl/mm/amd64/init.c b/ntoskrnl/mm/amd64/init.c index 2acdf596e64..1f912623a23 100644 --- a/ntoskrnl/mm/amd64/init.c +++ b/ntoskrnl/mm/amd64/init.c @@ -610,9 +610,9 @@ MiBuildPfnDatabase(IN PLOADER_PARAMETER_BLOCK LoaderBlock) /* Map the PDEs and PPEs for the pfn database (ignore holes) */ #if (_MI_PAGING_LEVELS >= 3) - MiMapPPEs(MmPfnDatabase, (PUCHAR)MmPfnDatabase + MxPfnAllocation - 1); + MiMapPPEs(MmPfnDatabase, (PUCHAR)MmPfnDatabase + (MxPfnAllocation * PAGE_SIZE) - 1); #endif - MiMapPDEs(MmPfnDatabase, (PUCHAR)MmPfnDatabase + MxPfnAllocation - 1); + MiMapPDEs(MmPfnDatabase, (PUCHAR)MmPfnDatabase + (MxPfnAllocation * PAGE_SIZE) - 1); /* First initialize the color tables */ MiInitializeColorTables(); -- 2.17.1