[NTOS:MM] Fix ViewSize parameter passed to MiInsertVadEx() from MiCreatePebOrTeb()
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 29 Jan 2018 11:37:26 +0000 (12:37 +0100)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 22 Apr 2018 13:06:19 +0000 (15:06 +0200)
The size is in bytes, not in pages! On x86 we got away with it, since PEB and TEB require only a single page and the 1 passed to MiInsertVadEx() was aligned up to PAGE_SIZE. On x64 this doesn't work, since the size is 2 pages.

ntoskrnl/mm/ARM3/procsup.c

index 95e760a..009168e 100644 (file)
@@ -88,7 +88,7 @@ MiCreatePebOrTeb(IN PEPROCESS Process,
     *BaseAddress = 0;
     Status = MiInsertVadEx((PMMVAD)Vad,
                            BaseAddress,
-                           BYTES_TO_PAGES(Size),
+                           Size,
                            HighestAddress,
                            PAGE_SIZE,
                            MEM_TOP_DOWN);