From 35beef2751a82bb9950103806a00deb8808e6e8a Mon Sep 17 00:00:00 2001 From: Sir Richard Date: Tue, 5 Oct 2010 04:57:32 +0000 Subject: [PATCH] [NTOS]: Nobody actually writes TRUE for WriteCopyView in the MEMORY_AREA data structure, so this field is useless (always false). Remove all instances of its use. svn path=/trunk/; revision=48988 --- reactos/ntoskrnl/mm/section.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 2efc904ed23..a405a6ab8eb 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -839,7 +839,7 @@ MmNotPresentFaultSectionView(PMMSUPPORT AddressSpace, /* * Check if this page needs to be mapped COW */ - if ((Segment->WriteCopy || MemoryArea->Data.SectionData.WriteCopyView) && + if ((Segment->WriteCopy) && (Region->Protect == PAGE_READWRITE || Region->Protect == PAGE_EXECUTE_READWRITE)) { @@ -1331,7 +1331,7 @@ MmAccessFaultSectionView(PMMSUPPORT AddressSpace, /* * Check if we are doing COW */ - if (!((Segment->WriteCopy || MemoryArea->Data.SectionData.WriteCopyView) && + if (!((Segment->WriteCopy) && (Region->Protect == PAGE_READWRITE || Region->Protect == PAGE_EXECUTE_READWRITE))) { @@ -2015,7 +2015,7 @@ MmAlterViewAttributes(PMMSUPPORT AddressSpace, MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress); Segment = MemoryArea->Data.SectionData.Segment; - if ((Segment->WriteCopy || MemoryArea->Data.SectionData.WriteCopyView) && + if ((Segment->WriteCopy) && (NewProtect == PAGE_READWRITE || NewProtect == PAGE_EXECUTE_READWRITE)) { DoCOW = TRUE; @@ -3518,7 +3518,6 @@ MmMapViewOfSegment(PMMSUPPORT AddressSpace, MArea->Data.SectionData.Segment = Segment; MArea->Data.SectionData.Section = Section; MArea->Data.SectionData.ViewOffset = ViewOffset; - MArea->Data.SectionData.WriteCopyView = FALSE; MmInitializeRegion(&MArea->Data.SectionData.RegionListHead, ViewSize, 0, Protect);