From df00880ca78ffb8decc118e0a227b3d53583ae63 Mon Sep 17 00:00:00 2001 From: Dmitry Gorbachev Date: Tue, 10 Mar 2009 17:47:11 +0000 Subject: [PATCH] Fix bug #4249 and crash in QEMU. Alex Ionescu, bug #4249. svn path=/trunk/; revision=39934 --- reactos/ntoskrnl/mm/i386/page.c | 4 ++-- reactos/ntoskrnl/mm/section.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reactos/ntoskrnl/mm/i386/page.c b/reactos/ntoskrnl/mm/i386/page.c index 03876d50bfc..da71842a8c2 100644 --- a/reactos/ntoskrnl/mm/i386/page.c +++ b/reactos/ntoskrnl/mm/i386/page.c @@ -1086,7 +1086,7 @@ MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) if (Process != NULL && Process != PsGetCurrentProcess()) { - Pde = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase[0])); + Pde = MiMapPagesToZeroInHyperSpace(PTE_TO_PFN(Process->Pcb.DirectoryTableBase[0])); } else { @@ -1101,7 +1101,7 @@ MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) } if (Pde != (PULONG)PAGEDIRECTORY_MAP) { - MmDeleteHyperspaceMapping(Pde); + MiUnmapPagesInZeroSpace(Pde); } } diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 7d1d8813255..f80eff34aee 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -691,7 +691,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, return Status; } } - PageAddr = MmCreateHyperspaceMapping(*Page); + PageAddr = MiMapPagesToZeroInHyperSpace(*Page); CacheSegOffset = BaseOffset + CacheSeg->Bcb->CacheSegmentSize - FileOffset; Length = RawLength - SegOffset; if (Length <= CacheSegOffset && Length <= PAGE_SIZE) @@ -714,7 +714,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, &CacheSeg); if (!NT_SUCCESS(Status)) { - MmDeleteHyperspaceMapping(PageAddr); + MiUnmapPagesInZeroSpace(PageAddr); return(Status); } if (!UptoDate) @@ -727,7 +727,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, if (!NT_SUCCESS(Status)) { CcRosReleaseCacheSegment(Bcb, CacheSeg, FALSE, FALSE, FALSE); - MmDeleteHyperspaceMapping(PageAddr); + MiUnmapPagesInZeroSpace(PageAddr); return Status; } } @@ -741,7 +741,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, } } CcRosReleaseCacheSegment(Bcb, CacheSeg, TRUE, FALSE, FALSE); - MmDeleteHyperspaceMapping(PageAddr); + MiUnmapPagesInZeroSpace(PageAddr); } return(STATUS_SUCCESS); }