diff --git a/tools/widl/client.c b/tools/widl/client.c index ea0c2cc936d..27093a5f336 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 e889423e68a..7d4ebe85fdf 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 (" );