Module: wine Branch: master Commit: a5ff173cc3dccbe63185420158fcc8a620a6cc1d URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=a5ff173cc3dccbe631854201...
Author: Dan Hipschman dsh@linux.ucla.edu Date: Tue Aug 15 18:35:01 2006 -0700
widl: Generate proxy code for user marshalled types.
---
tools/widl/proxy.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c index f060a23..1943b22 100644 --- a/tools/widl/proxy.c +++ b/tools/widl/proxy.c @@ -232,6 +232,34 @@ int cant_be_null(var_t *v) return 1; /* Default is RPC_FC_RP. */ }
+static int is_user_derived(var_t *v) +{ + const attr_t *attrs = v->attrs; + const type_t *type = v->type; + + if (! attrs && type) + { + attrs = type->attrs; + type = type->ref; + } + + while (attrs) + { + if (is_attr(attrs, ATTR_WIREMARSHAL)) + return 1; + + if (type) + { + attrs = type->attrs; + type = type->ref; + } + else + attrs = NULL; + } + + return 0; +} + static void proxy_check_pointers( var_t *arg ) { END_OF_LIST(arg); @@ -263,6 +291,13 @@ static void marshall_size_arg( var_t *ar return; }
+ if (is_user_derived(arg)) + { + print_proxy("NdrUserMarshalBufferSize( &_StubMsg, (unsigned char*)%s, ", arg->name); + fprintf(proxy, "&__MIDL_TypeFormatString.Format[%d] );\n", index); + return; + } + switch( type->type ) { case RPC_FC_BYTE: @@ -355,6 +390,13 @@ static void marshall_copy_arg( var_t *ar return; }
+ if (is_user_derived(arg)) + { + print_proxy("NdrUserMarshalMarshall( &_StubMsg, (unsigned char*)%s, ", arg->name); + fprintf(proxy, "&__MIDL_TypeFormatString.Format[%d] );\n", index); + return; + } + switch( type->type ) { case RPC_FC_BYTE: @@ -454,6 +496,13 @@ static void unmarshall_copy_arg( var_t * return; }
+ if (is_user_derived(arg)) + { + print_proxy("NdrUserMarshalUnmarshall( &_StubMsg, (unsigned char**)&%s, ", arg->name); + fprintf(proxy, "&__MIDL_TypeFormatString.Format[%d], 0 );\n", index); + return; + } + switch( type->type ) { case RPC_FC_BYTE: