Alexandre Julliard : widl: Output the list of rundown routines in server files.

Alexandre Julliard julliard at winehq.org
Tue Jun 14 11:57:45 CDT 2011


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jun 13 20:31:42 2011 +0200

widl: Output the list of rundown routines in server files.

---

 tools/widl/header.c    |    2 +-
 tools/widl/server.c    |   26 +++++++++++++++++++++++++-
 tools/widl/widltypes.h |    1 +
 3 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/tools/widl/header.c b/tools/widl/header.c
index 8abce70..9d12696 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -39,7 +39,7 @@
 static int indentation = 0;
 static int is_object_interface = 0;
 user_type_list_t user_type_list = LIST_INIT(user_type_list);
-static context_handle_list_t context_handle_list = LIST_INIT(context_handle_list);
+context_handle_list_t context_handle_list = LIST_INIT(context_handle_list);
 generic_handle_list_t generic_handle_list = LIST_INIT(generic_handle_list);
 
 static void write_type_def_or_decl(FILE *f, type_t *t, int field, const char *name);
diff --git a/tools/widl/server.c b/tools/widl/server.c
index 19293ae..3a8810e 100644
--- a/tools/widl/server.c
+++ b/tools/widl/server.c
@@ -307,6 +307,26 @@ static void write_routinetable(type_t *iface)
 }
 
 
+static void write_rundown_routines(void)
+{
+    context_handle_t *ch;
+    int count = list_count( &context_handle_list );
+
+    if (!count) return;
+    print_server( "static const NDR_RUNDOWN RundownRoutines[] =\n" );
+    print_server( "{\n" );
+    indent++;
+    LIST_FOR_EACH_ENTRY( ch, &context_handle_list, context_handle_t, entry )
+    {
+        print_server( "%s_rundown", ch->name );
+        if (--count) fputc( ',', server );
+        fputc( '\n', server );
+    }
+    indent--;
+    print_server( "};\n\n" );
+}
+
+
 static void write_serverinfo(type_t *iface)
 {
     print_server( "static const MIDL_SERVER_INFO %s_ServerInfo =\n", iface->name );
@@ -345,7 +365,10 @@ static void write_stubdescriptor(type_t *iface, int expr_eval_routines)
     print_server("0,\n");
     indent--;
     print_server("},\n");
-    print_server("0,\n");
+    if (!list_empty( &context_handle_list ))
+        print_server("RundownRoutines,\n");
+    else
+        print_server("0,\n");
     print_server("0,\n");
     if (expr_eval_routines)
         print_server("ExprEvalRoutines,\n");
@@ -505,6 +528,7 @@ static void write_server_routines(const statement_list_t *stmts)
     if (expr_eval_routines)
         write_expr_eval_routine_list(server, server_token);
     write_user_quad_list(server);
+    write_rundown_routines();
 
     write_server_stmts(stmts, expr_eval_routines, &proc_offset);
 
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index b2ac116..ccb9d1a 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -533,6 +533,7 @@ typedef enum {
 
 extern syskind_t typelib_kind;
 extern user_type_list_t user_type_list;
+extern context_handle_list_t context_handle_list;
 extern generic_handle_list_t generic_handle_list;
 void check_for_additional_prototype_types(const var_list_t *list);
 




More information about the wine-cvs mailing list