Author: tkreuzer
Date: Sat Nov 23 00:43:06 2013
New Revision: 61081
URL:
http://svn.reactos.org/svn/reactos?rev=61081&view=rev
Log:
[NTOSKRNL]
- Add hacks to MmMapViewInSessionSpace and MmUnmapViewInSessionSpace to check for legacy
(non ARM3) sections (image sections) and (un)map them in system space instead.
- Fix MmCommitSessionMappedView (it wasn't resetting the PointerPte to the start, when
processing the PTE range a second time)
- Remove an ASSERT that didn't allow unmapping session space mappings, since that
works (see CORE-6729)
- Change a write to a PTE to using MI_WRITE_VALID_PTE
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/section.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/section.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/section.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] Sat Nov 23 00:43:06 2013
@@ -1917,7 +1917,7 @@
ASSERT(PointerPte->u.Hard.Valid == 1);
ASSERT(TempPte.u.Hard.Valid == 1);
ASSERT(PointerPte->u.Hard.PageFrameNumber == TempPte.u.Hard.PageFrameNumber);
- *PointerPte = TempPte;
+ MI_WRITE_VALID_PTE(PointerPte, TempPte);
//
// Flush the TLB
@@ -2256,9 +2256,6 @@
ULONG Size;
PCONTROL_AREA ControlArea;
PAGED_CODE();
-
- /* Only global mappings supported for now */
- ASSERT(Session == &MmSession);
/* Remove this mapping */
KeAcquireGuardedMutex(Session->SystemSpaceViewLockPointer);
@@ -2783,6 +2780,12 @@
{
PAGED_CODE();
+ // HACK
+ if (MiIsRosSectionObject(Section))
+ {
+ return MmMapViewInSystemSpace(Section, MappedBase, ViewSize);
+ }
+
/* Process must be in a session */
if (PsGetCurrentProcess()->ProcessInSession == FALSE)
{
@@ -2806,6 +2809,12 @@
MmUnmapViewInSessionSpace(IN PVOID MappedBase)
{
PAGED_CODE();
+
+ // HACK
+ if (!MI_IS_SESSION_ADDRESS(MappedBase))
+ {
+ return MmUnmapViewInSystemSpace(MappedBase);
+ }
/* Process must be in a session */
if (PsGetCurrentProcess()->ProcessInSession == FALSE)
@@ -2990,6 +2999,7 @@
ASSERT(TempPte.u.Long != 0);
/* Loop all prototype PTEs to be committed */
+ PointerPte = ProtoPte;
while (PointerPte < LastProtoPte)
{
/* Make sure the PTE is already invalid */