[NTOS:MM] Do not queue debugger events after notifying process exit. CORE-13393
authorMark Jansen <mark.jansen@reactos.org>
Thu, 8 Jun 2017 20:34:47 +0000 (20:34 +0000)
committerMark Jansen <mark.jansen@reactos.org>
Thu, 8 Jun 2017 20:34:47 +0000 (20:34 +0000)
Patch suggested by Thomas.

svn path=/trunk/; revision=74969

reactos/ntoskrnl/mm/ARM3/miarm.h
reactos/ntoskrnl/mm/ARM3/section.c
reactos/ntoskrnl/mm/marea.c
reactos/ntoskrnl/mm/section.c

index af8c830..ac72224 100644 (file)
@@ -2104,7 +2104,7 @@ NTAPI
 MiRosUnmapViewOfSection(
     IN PEPROCESS Process,
     IN PVOID BaseAddress,
-    IN ULONG Flags
+    IN BOOLEAN SkipDebuggerNotify
 );
 
 VOID
index ab45672..6b5aadd 100644 (file)
@@ -834,7 +834,7 @@ MiUnmapViewOfSection(IN PEPROCESS Process,
     if ((MemoryArea) && (MemoryArea->Type != MEMORY_AREA_OWNED_BY_ARM3))
     {
         /* Call Mm API */
-        return MiRosUnmapViewOfSection(Process, BaseAddress, Flags);
+        return MiRosUnmapViewOfSection(Process, BaseAddress, Process->ProcessExiting);
     }
 
     /* Check if we should attach to the process */
index ffb8efe..0771fe9 100644 (file)
@@ -545,7 +545,7 @@ MiRosCleanupMemoryArea(
 
     if (MemoryArea->Type == MEMORY_AREA_SECTION_VIEW)
     {
-        Status = MiRosUnmapViewOfSection(Process, BaseAddress, 0);
+        Status = MiRosUnmapViewOfSection(Process, BaseAddress, Process->ProcessExiting);
     }
     else if (MemoryArea->Type == MEMORY_AREA_CACHE)
     {
index dc78680..4bfb793 100644 (file)
@@ -4142,7 +4142,7 @@ NTSTATUS
 NTAPI
 MiRosUnmapViewOfSection(IN PEPROCESS Process,
                         IN PVOID BaseAddress,
-                        IN ULONG Flags)
+                        IN BOOLEAN SkipDebuggerNotify)
 {
     NTSTATUS Status;
     PMEMORY_AREA MemoryArea;
@@ -4230,7 +4230,7 @@ MiRosUnmapViewOfSection(IN PEPROCESS Process,
     MmUnlockAddressSpace(AddressSpace);
 
     /* Notify debugger */
-    if (ImageBaseAddress) DbgkUnMapViewOfSection(ImageBaseAddress);
+    if (ImageBaseAddress && !SkipDebuggerNotify) DbgkUnMapViewOfSection(ImageBaseAddress);
 
     return(STATUS_SUCCESS);
 }