[NTOS:MM] Fix Lazarus hang when closing running project with "X" (#8331)

CORE-20172
Make DbgkUnMapViewOfSection in function MiRosUnmapViewOfSection contingent on MapCount being 0.
This commit is contained in:
Doug Lyons
2025-08-20 14:18:25 -05:00
committed by GitHub
parent 693e1ebc4c
commit 05caf99940

View File

@@ -3663,6 +3663,7 @@ MiRosUnmapViewOfSection(
PMM_IMAGE_SECTION_OBJECT ImageSectionObject;
PMM_SECTION_SEGMENT SectionSegments;
PMM_SECTION_SEGMENT Segment;
ULONG MapCount;
Segment = MemoryArea->SectionData.Segment;
ImageSectionObject = ImageSectionObjectFromSegment(Segment);
@@ -3700,7 +3701,9 @@ MiRosUnmapViewOfSection(
}
}
DPRINT("One mapping less for %p\n", ImageSectionObject->FileObject->SectionObjectPointer);
InterlockedDecrement(&ImageSectionObject->MapCount);
MapCount = InterlockedDecrement(&ImageSectionObject->MapCount);
if (MapCount != 0)
ImageBaseAddress = NULL;
}
else
{