Alexandre Julliard : widl: Avoid using GetExceptionCode outside of an exception handler.

Alexandre Julliard julliard at winehq.org
Fri Feb 6 09:56:17 CST 2009


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Feb  6 14:03:29 2009 +0100

widl: Avoid using GetExceptionCode outside of an exception handler.

---

 tools/widl/server.c  |    5 ++++-
 tools/widl/typegen.c |    3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/widl/server.c b/tools/widl/server.c
index 3b0e2f4..359d2e9 100644
--- a/tools/widl/server.c
+++ b/tools/widl/server.c
@@ -392,7 +392,10 @@ static void init_server(void)
     print_server("\n");
     print_server("static int __server_filter( struct __server_frame *__frame )\n");
     print_server( "{\n");
-    print_server( "    return RPC_BAD_STUB_DATA_EXCEPTION_FILTER;\n");
+    print_server( "    return (__frame->code == STATUS_ACCESS_VIOLATION) ||\n");
+    print_server( "           (__frame->code == STATUS_DATATYPE_MISALIGNMENT) ||\n");
+    print_server( "           (__frame->code == RPC_X_BAD_STUB_DATA) ||\n");
+    print_server( "           (__frame->code == RPC_S_INVALID_BOUND);\n");
     print_server( "}\n");
     print_server( "\n");
 }
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 599e2fe..d16f1fd 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -3686,7 +3686,8 @@ void write_exceptions( FILE *file )
     fprintf( file, "#else /* USE_COMPILER_EXCEPTIONS */\n");
     fprintf( file, "\n");
     fprintf( file, "#define RpcExceptionInit(filter_func,finally_func) do {} while(0)\n");
-    fprintf( file, "#define __DECL_EXCEPTION_FRAME\n");
+    fprintf( file, "#define __DECL_EXCEPTION_FRAME \\\n");
+    fprintf( file, "    DWORD code;\n");
     fprintf( file, "\n");
     fprintf( file, "#endif /* USE_COMPILER_EXCEPTIONS */\n");
 }




More information about the wine-cvs mailing list