widl: Generate proxy code for user marshalled types.

This commit is contained in:
Dan Hipschman 2006-08-15 18:35:01 -07:00 committed by Alexandre Julliard
parent c526c980d7
commit a5ff173cc3
1 changed files with 49 additions and 0 deletions

View File

@ -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 *arg )
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 *arg )
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 *arg )
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: