Output NULL for inherited methods in the vtbl.
authorChristoph von Wittich <christoph_vw@reactos.org>
Sun, 14 Sep 2008 05:07:16 +0000 (05:07 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Sun, 14 Sep 2008 05:07:16 +0000 (05:07 +0000)
Dan Hipschman <dsh at linux.ucla.edu>

svn path=/trunk/; revision=36207

reactos/tools/widl/proxy.c

index 217c64b..07384e5 100644 (file)
@@ -461,41 +461,45 @@ static void gen_stub(type_t *iface, const func_t *cur, const char *cas,
   print_proxy("\n");
 }
 
-static int write_proxy_methods(type_t *iface)
+static int write_proxy_methods(type_t *iface, int skip)
 {
   const func_t *cur;
   int i = 0;
 
-  if (iface->ref) i = write_proxy_methods(iface->ref);
+  if (iface->ref) i = write_proxy_methods(iface->ref, iface->ref->ref != NULL);
   if (iface->funcs) LIST_FOR_EACH_ENTRY( cur, iface->funcs, const func_t, entry ) {
     var_t *def = cur->def;
     if (!is_callas(def->attrs)) {
       if (i) fprintf(proxy, ",\n");
-      print_proxy( "%s_", iface->name);
+      print_proxy( "%s%s_", skip ? "0\t/* " : "", iface->name);
       write_name(proxy, def);
-      fprintf(proxy, "_Proxy");
+      fprintf(proxy, "_Proxy%s", skip ? " */" : "");
       i++;
     }
   }
   return i;
 }
 
-static int write_stub_methods(type_t *iface)
+static int write_stub_methods(type_t *iface, int skip)
 {
   const func_t *cur;
   int i = 0;
 
-  if (iface->ref) i = write_stub_methods(iface->ref);
+  if (iface->ref) i = write_stub_methods(iface->ref, TRUE);
   else return i; /* skip IUnknown */
 
   if (iface->funcs) LIST_FOR_EACH_ENTRY( cur, iface->funcs, const func_t, entry ) {
     var_t *def = cur->def;
     if (!is_local(def->attrs)) {
-      if (i) fprintf(proxy,",\n");
-      print_proxy( "%s_", iface->name);
-      write_name(proxy, def);
-      fprintf(proxy, "_Stub");
-      i++;
+      if (skip)
+        print_proxy("STUB_FORWARDING_FUNCTION,\n");
+      else {
+        if (i) fprintf(proxy,",\n");
+        print_proxy( "%s_", iface->name);
+        write_name(proxy, def);
+        fprintf(proxy, "_Stub");
+        i++;
+      }
     }
   }
   return i;
@@ -549,7 +553,7 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset)
   print_proxy( "},\n");
   print_proxy( "{\n");
   indent++;
-  write_proxy_methods(iface);
+  write_proxy_methods(iface, FALSE);
   fprintf(proxy, "\n");
   indent--;
   print_proxy( "}\n");
@@ -561,7 +565,7 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset)
   print_proxy( "static const PRPC_STUB_FUNCTION %s_table[] =\n", iface->name);
   print_proxy( "{\n");
   indent++;
-  stubs = write_stub_methods(iface);
+  stubs = write_stub_methods(iface, FALSE);
   fprintf(proxy, "\n");
   indent--;
   fprintf(proxy, "};\n");