Alexandre Julliard : widl: Output a format string table and server info structure for stubs.
Alexandre Julliard
julliard at winehq.org
Mon Oct 25 10:58:17 CDT 2010
Module: wine
Branch: master
Commit: 955152430896da6f72e669e8baa7f083e44daa5a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=955152430896da6f72e669e8baa7f083e44daa5a
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Oct 22 20:22:57 2010 +0200
widl: Output a format string table and server info structure for stubs.
---
tools/widl/proxy.c | 36 ++++++++++++++++++++++++++++++++----
tools/widl/widltypes.h | 1 +
2 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c
index ca0717b..3e8be5d 100644
--- a/tools/widl/proxy.c
+++ b/tools/widl/proxy.c
@@ -579,7 +579,7 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset)
/* FIXME: check for [oleautomation], shouldn't generate proxies/stubs if specified */
STATEMENTS_FOR_EACH_FUNC(stmt, type_iface_get_stmts(iface)) {
- const var_t *func = stmt->u.var;
+ var_t *func = stmt->u.var;
if (first_func) {
fprintf(proxy, "/*****************************************************************************\n");
fprintf(proxy, " * %s interface\n", iface->name);
@@ -601,6 +601,7 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset)
}
}
}
+ func->procstring_offset = *proc_offset;
gen_proxy(iface, func, idx, *proc_offset);
gen_stub(iface, func, cname, *proc_offset);
*proc_offset += get_size_procformatstring_func( func );
@@ -609,6 +610,19 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset)
count = count_methods(iface);
+ /* proc format string offsets */
+ print_proxy( "static const unsigned short %s_FormatStringOffsetTable[] =\n", iface->name );
+ print_proxy( "{\n" );
+ indent++;
+ STATEMENTS_FOR_EACH_FUNC(stmt, type_iface_get_stmts(iface))
+ {
+ var_t *func = stmt->u.var;
+ if (is_local( func->attrs )) continue;
+ print_proxy( "%u, /* %s */\n", func->procstring_offset, func->name );
+ }
+ indent--;
+ print_proxy( "};\n\n" );
+
/* proxy vtable */
print_proxy( "static %sCINTERFACE_PROXY_VTABLE(%d) _%sProxyVtbl =\n",
need_delegation_indirect(iface) ? "" : "const ", count, iface->name);
@@ -626,8 +640,22 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset)
indent--;
print_proxy( "}\n");
indent--;
- print_proxy( "};\n");
- fprintf(proxy, "\n\n");
+ print_proxy( "};\n\n");
+
+ /* server info */
+ print_proxy( "static const MIDL_SERVER_INFO %s_ServerInfo =\n", iface->name );
+ print_proxy( "{\n" );
+ indent++;
+ print_proxy( "&Object_StubDesc,\n" );
+ print_proxy( "0,\n" );
+ print_proxy( "__MIDL_ProcFormatString.Format,\n" );
+ print_proxy( "&%s_FormatStringOffsetTable[-3],\n", iface->name );
+ print_proxy( "0,\n" );
+ print_proxy( "0,\n" );
+ print_proxy( "0,\n" );
+ print_proxy( "0\n" );
+ indent--;
+ print_proxy( "};\n\n" );
/* stub vtable */
print_proxy( "static const PRPC_STUB_FUNCTION %s_table[] =\n", iface->name);
@@ -645,7 +673,7 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset)
print_proxy( "{\n");
indent++;
print_proxy( "&IID_%s,\n", iface->name);
- print_proxy( "0,\n");
+ print_proxy( "&%s_ServerInfo,\n", iface->name );
print_proxy( "%d,\n", count);
print_proxy( "&%s_table[-3],\n", iface->name);
indent--;
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 89b19e5..40962ed 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -420,6 +420,7 @@ struct _var_t {
attr_list_t *attrs;
expr_t *eval;
enum storage_class stgclass;
+ unsigned int procstring_offset;
struct _loc_info_t loc_info;
More information about the wine-cvs
mailing list