Piotr Caban : msvcrt: Handle seh exceptions rethrowing in cxx_frame_handler.

Alexandre Julliard julliard at winehq.org
Wed Apr 30 13:32:52 CDT 2014


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Apr 30 13:51:35 2014 +0200

msvcrt: Handle seh exceptions rethrowing in cxx_frame_handler.

---

 dlls/msvcrt/except_i386.c |   20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/dlls/msvcrt/except_i386.c b/dlls/msvcrt/except_i386.c
index 7f521cc..2a4ef9d 100644
--- a/dlls/msvcrt/except_i386.c
+++ b/dlls/msvcrt/except_i386.c
@@ -522,17 +522,21 @@ DWORD CDECL cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* frame
     }
     if (!descr->tryblock_count) return ExceptionContinueSearch;
 
-    if(rec->ExceptionCode == CXX_EXCEPTION)
+    if(rec->ExceptionCode == CXX_EXCEPTION &&
+            rec->ExceptionInformation[1] == 0 && rec->ExceptionInformation[2] == 0)
     {
-        if (rec->ExceptionInformation[1] == 0 && rec->ExceptionInformation[2] == 0)
-        {
-            EXCEPTION_RECORD *exc_record = msvcrt_get_thread_data()->exc_record;
-            rec->ExceptionInformation[1] = exc_record->ExceptionInformation[1];
-            rec->ExceptionInformation[2] = exc_record->ExceptionInformation[2];
-            TRACE("detect rethrow: obj: %lx, type: %lx\n",
-                    rec->ExceptionInformation[1], rec->ExceptionInformation[2]);
+        *rec = *msvcrt_get_thread_data()->exc_record;
+        rec->ExceptionFlags &= ~EH_UNWINDING;
+        if(TRACE_ON(seh)) {
+            TRACE("detect rethrow: exception code: %x\n", rec->ExceptionCode);
+            if(rec->ExceptionCode == CXX_EXCEPTION)
+                TRACE("re-propage: obj: %lx, type: %lx\n",
+                        rec->ExceptionInformation[1], rec->ExceptionInformation[2]);
         }
+    }
 
+    if(rec->ExceptionCode == CXX_EXCEPTION)
+    {
         exc_type = (cxx_exception_type *)rec->ExceptionInformation[2];
 
         if (rec->ExceptionInformation[0] > CXX_FRAME_MAGIC_VC8 &&




More information about the wine-cvs mailing list