Author: cgutman
Date: Sun Dec 18 04:55:11 2011
New Revision: 54682
URL: http://svn.reactos.org/svn/reactos?rev=54682&view=rev
Log:
[NTOSKRNL]
- Fix COW file mappings (modifications to the mappings no longer change the file on disk)
- Fixes bug #4308
Modified:
trunk/reactos/ntoskrnl/mm/section.c
Modified: trunk/reactos/ntoskrnl/mm/section.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Sun Dec 18 04:55:11 2011
@@ -3165,7 +3165,7 @@
Segment->Protection = SectionPageProtection;
Segment->Flags = MM_DATAFILE_SEGMENT;
Segment->Characteristics = 0;
- Segment->WriteCopy = FALSE;
+ Segment->WriteCopy = (SectionPageProtection & (PAGE_WRITECOPY | PAGE_EXECUTE_WRITECOPY));
if (AllocationAttributes & SEC_RESERVE)
{
Segment->Length = Segment->RawLength = 0;
@@ -4058,6 +4058,23 @@
PMEMORY_AREA MArea;
NTSTATUS Status;
PHYSICAL_ADDRESS BoundaryAddressMultiple;
+
+ if (Segment->WriteCopy)
+ {
+ /* We have to do this because the not present fault
+ * and access fault handlers depend on the protection
+ * that should be granted AFTER the COW fault takes
+ * place to be in Region->Protect. The not present fault
+ * handler changes this to the correct protection for COW when
+ * mapping the pages into the process's address space. If a COW
+ * fault takes place, the access fault handler sets the page protection
+ * to these values for the newly copied pages
+ */
+ if (Protect == PAGE_WRITECOPY)
+ Protect = PAGE_READWRITE;
+ else if (Protect == PAGE_EXECUTE_WRITECOPY)
+ Protect = PAGE_EXECUTE_READWRITE;
+ }
BoundaryAddressMultiple.QuadPart = 0;
Author: rharabien
Date: Sun Dec 18 00:22:50 2011
New Revision: 54679
URL: http://svn.reactos.org/svn/reactos?rev=54679&view=rev
Log:
[WIN32K]
- Fail if display name device is given to EnumerateDisplayDevices and index is not set to 0. Fixes hang in Display Settings -> Advanced -> Monitor.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/display.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/display.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] Sun Dec 18 00:22:50 2011
@@ -382,6 +382,10 @@
pustrDevice = NULL;
}
+ /* If name is given only iDevNum==0 gives results */
+ if (pustrDevice && iDevNum != 0)
+ return FALSE;
+
/* Acquire global USER lock */
UserEnterShared();