Alexandre Julliard : widl: Implemented RpcAbnormalTermination in the generic exception handling code.

Alexandre Julliard julliard at winehq.org
Tue Sep 16 06:54:07 CDT 2008


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Sep 15 18:18:16 2008 +0200

widl: Implemented RpcAbnormalTermination in the generic exception handling code.

---

 tools/widl/typegen.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 096216a..5a6e592 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -3388,6 +3388,7 @@ void write_exceptions( FILE *file )
     fprintf( file, "#undef RpcFinally\n");
     fprintf( file, "#undef RpcEndFinally\n");
     fprintf( file, "#undef RpcExceptionCode\n");
+    fprintf( file, "#undef RpcAbnormalTermination\n");
     fprintf( file, "\n");
     fprintf( file, "struct __exception_frame;\n");
     fprintf( file, "typedef int (*__filter_func)(EXCEPTION_RECORD *, struct __exception_frame *);\n");
@@ -3399,6 +3400,7 @@ void write_exceptions( FILE *file )
     fprintf( file, "    __finally_func                finally; \\\n");
     fprintf( file, "    sigjmp_buf                    jmp; \\\n");
     fprintf( file, "    DWORD                         code; \\\n");
+    fprintf( file, "    unsigned char                 abnormal_termination; \\\n");
     fprintf( file, "    unsigned char                 filter_level; \\\n");
     fprintf( file, "    unsigned char                 finally_level;\n");
     fprintf( file, "\n");
@@ -3416,7 +3418,10 @@ void write_exceptions( FILE *file )
     fprintf( file, "    if (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND | EH_NESTED_CALL))\n");
     fprintf( file, "    {\n" );
     fprintf( file, "        if (exc_frame->finally_level && (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND)))\n");
+    fprintf( file, "        {\n" );
+    fprintf( file, "            exc_frame->abnormal_termination = 1;\n");
     fprintf( file, "            exc_frame->finally( exc_frame );\n");
+    fprintf( file, "        }\n" );
     fprintf( file, "        return ExceptionContinueSearch;\n");
     fprintf( file, "    }\n" );
     fprintf( file, "    exc_frame->code = record->ExceptionCode;\n");
@@ -3425,6 +3430,7 @@ void write_exceptions( FILE *file )
     fprintf( file, "        __wine_rtl_unwind( frame, record );\n");
     fprintf( file, "        if (exc_frame->finally_level > exc_frame->filter_level)\n" );
     fprintf( file, "        {\n");
+    fprintf( file, "            exc_frame->abnormal_termination = 1;\n");
     fprintf( file, "            exc_frame->finally( exc_frame );\n");
     fprintf( file, "            __wine_pop_frame( frame );\n");
     fprintf( file, "        }\n");
@@ -3464,11 +3470,14 @@ void write_exceptions( FILE *file )
     fprintf( file, "\n");
     fprintf( file, "#define RpcEndFinally\n");
     fprintf( file, "\n");
+    fprintf( file, "#define RpcAbnormalTermination() (__frame->abnormal_termination)\n");
+    fprintf( file, "\n");
     fprintf( file, "#define RpcExceptionInit(filter_func,finally_func) \\\n");
     fprintf( file, "    do { \\\n");
     fprintf( file, "        __frame->frame.Handler = __widl_exception_handler; \\\n");
     fprintf( file, "        __frame->filter = (__filter_func)(filter_func); \\\n" );
     fprintf( file, "        __frame->finally = (__finally_func)(finally_func); \\\n");
+    fprintf( file, "        __frame->abnormal_termination = 0; \\\n");
     fprintf( file, "        __frame->filter_level = 0; \\\n");
     fprintf( file, "        __frame->finally_level = 0; \\\n");
     fprintf( file, "    } while (0)\n");




More information about the wine-cvs mailing list