Alexandre Julliard : widl: In 64-bit mode, pass all arguments to NdrClientCall instead of a pointer to the first one.
Alexandre Julliard
julliard at winehq.org
Wed Jun 8 11:26:59 CDT 2011
Module: wine
Branch: master
Commit: d9cd0d8cac36c1cc9748a91518185c39af3697c9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d9cd0d8cac36c1cc9748a91518185c39af3697c9
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Jun 8 11:34:46 2011 +0200
widl: In 64-bit mode, pass all arguments to NdrClientCall instead of a pointer to the first one.
---
tools/widl/client.c | 20 +++++++++++++++-----
tools/widl/proxy.c | 13 +++++++++++--
2 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/tools/widl/client.c b/tools/widl/client.c
index ea0c2cc..27093a5 100644
--- a/tools/widl/client.c
+++ b/tools/widl/client.c
@@ -107,15 +107,25 @@ static void write_function_stub( const type_t *iface, const var_t *func,
fprintf(client, "{\n");
indent++;
if (has_ret) print_client( "%s", "CLIENT_CALL_RETURN _RetVal;\n\n" );
- print_client( "%s%s( &%s_StubDesc, &__MIDL_ProcFormatString.Format[%u], ",
+ print_client( "%s%s( &%s_StubDesc, &__MIDL_ProcFormatString.Format[%u]",
has_ret ? "_RetVal = " : "",
stub_mode == MODE_Oif ? "NdrClientCall2" : "NdrClientCall",
iface->name, proc_offset );
if (args)
- fprintf( client, "(unsigned char *)&%s );\n",
- LIST_ENTRY( list_head(args), const var_t, entry )->name );
- else
- fprintf( client, "(unsigned char *)0 );\n" );
+ {
+ const var_t *arg;
+ if (pointer_size == 8)
+ {
+ LIST_FOR_EACH_ENTRY( arg, args, const var_t, entry )
+ fprintf( client, ",\n%*s%s", 4 * indent + 16, "", arg->name );
+ }
+ else
+ {
+ arg = LIST_ENTRY( list_head(args), const var_t, entry );
+ fprintf( client, ", &%s", arg->name );
+ }
+ }
+ fprintf( client, " );\n" );
if (has_ret)
{
print_client( "return (" );
diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c
index e889423..7d4ebe8 100644
--- a/tools/widl/proxy.c
+++ b/tools/widl/proxy.c
@@ -280,11 +280,20 @@ static void gen_proxy(type_t *iface, const var_t *func, int idx,
print_proxy( "{\n");
indent++;
if (has_ret) print_proxy( "%s", "CLIENT_CALL_RETURN _RetVal;\n\n" );
- print_proxy( "%s%s( &Object_StubDesc, &__MIDL_ProcFormatString.Format[%u], ",
+ print_proxy( "%s%s( &Object_StubDesc, &__MIDL_ProcFormatString.Format[%u],",
has_ret ? "_RetVal = " : "",
stub_mode == MODE_Oif ? "NdrClientCall2" : "NdrClientCall",
proc_offset );
- fprintf( proxy, "(unsigned char *)&This );\n" );
+ if (pointer_size == 8)
+ {
+ const var_t *arg;
+ fprintf( proxy, "\n%*sThis", 4 * indent + 16, "" );
+ if (args)
+ LIST_FOR_EACH_ENTRY( arg, args, const var_t, entry )
+ fprintf( proxy, ",\n%*s%s", 4 * indent + 16, "", arg->name );
+ }
+ else fprintf( proxy, " &This" );
+ fprintf( proxy, " );\n" );
if (has_ret)
{
print_proxy( "return (" );
More information about the wine-cvs
mailing list