Alexandre Julliard : ntdll: Ignore spurious write faults for a write watch that has been reset already .

Alexandre Julliard julliard at winehq.org
Tue Jan 27 09:07:51 CST 2009


Module: wine
Branch: master
Commit: 5e7f7db92386b2cd5109dd76948dff5a15ce1f31
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5e7f7db92386b2cd5109dd76948dff5a15ce1f31

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Jan 27 11:22:06 2009 +0100

ntdll: Ignore spurious write faults for a write watch that has been reset already.

---

 dlls/ntdll/virtual.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 16e1e50..0b14564 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -1474,11 +1474,15 @@ NTSTATUS virtual_handle_fault( LPCVOID addr, DWORD err )
             VIRTUAL_SetProt( view, page, page_size, *vprot & ~VPROT_GUARD );
             ret = STATUS_GUARD_PAGE_VIOLATION;
         }
-        if ((err & EXCEPTION_WRITE_FAULT) && (*vprot & VPROT_WRITEWATCH))
+        if ((err & EXCEPTION_WRITE_FAULT) && (view->protect & VPROT_WRITEWATCH))
         {
-            *vprot &= ~VPROT_WRITEWATCH;
-            VIRTUAL_SetProt( view, page, page_size, *vprot );
-            ret = STATUS_SUCCESS;
+            if (*vprot & VPROT_WRITEWATCH)
+            {
+                *vprot &= ~VPROT_WRITEWATCH;
+                VIRTUAL_SetProt( view, page, page_size, *vprot );
+            }
+            /* ignore fault if page is writable now */
+            if (VIRTUAL_GetUnixProt( *vprot ) & PROT_WRITE) ret = STATUS_SUCCESS;
         }
     }
     server_leave_uninterrupted_section( &csVirtual, &sigset );




More information about the wine-cvs mailing list