Alexandre Julliard : widl: Include the parent interfaces in the proxy thunk table too.

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


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jun 13 23:16:36 2011 +0200

widl: Include the parent interfaces in the proxy thunk table too.

---

 tools/widl/proxy.c |   25 ++++++++++++++-----------
 1 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c
index e5b2f9f..f4bd8d8 100644
--- a/tools/widl/proxy.c
+++ b/tools/widl/proxy.c
@@ -630,25 +630,28 @@ static int write_stub_methods(type_t *iface, int skip)
   return i;
 }
 
-static void write_thunk_methods( type_t *iface )
+static void write_thunk_methods( type_t *iface, int skip )
 {
     const statement_t *stmt;
-    int i = 0;
+
+    if (type_iface_get_inherit( iface ))
+        write_thunk_methods( type_iface_get_inherit(iface), need_delegation(iface) );
+    else
+        return; /* skip IUnknown */
 
     STATEMENTS_FOR_EACH_FUNC( stmt, type_iface_get_stmts(iface) )
     {
         var_t *func = stmt->u.var;
-        const var_t *cas = is_callas(func->attrs);
+        const statement_t * callas_source = NULL;
 
-        if (is_local( func->attrs )) continue;
-        if (i) fprintf(proxy, ",\n");
-        if (cas && is_interpreted_func( iface, func ))
-            print_proxy( "%s_%s_Thunk", iface->name, func->name );
+        if (is_callas(func->attrs)) continue;
+        if (is_local(func->attrs)) callas_source = get_callas_source(iface, func);
+
+        if (!skip && callas_source && is_interpreted_func( iface, func ))
+            print_proxy( "%s_%s_Thunk,\n", iface->name, get_name(callas_source->u.var) );
         else
-            print_proxy( "0" );
-        i++;
+            print_proxy( "0, /* %s::%s */\n", iface->name, get_name(func) );
     }
-    fputc( '\n', proxy );
 }
 
 static void write_proxy(type_t *iface, unsigned int *proc_offset)
@@ -744,7 +747,7 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset)
       print_proxy( "static const STUB_THUNK %s_StubThunkTable[] =\n", iface->name);
       print_proxy( "{\n");
       indent++;
-      write_thunk_methods( iface );
+      write_thunk_methods( iface, 0 );
       indent--;
       print_proxy( "};\n\n");
   }




More information about the wine-cvs mailing list