Commit 0d76bb7e authored by Alexandre Julliard's avatar Alexandre Julliard

widl: Clear out more types of parameters in the proxy error handlers.

parent 8b73720d
...@@ -147,20 +147,9 @@ static int need_delegation_indirect(const type_t *iface) ...@@ -147,20 +147,9 @@ static int need_delegation_indirect(const type_t *iface)
static void free_variable( const var_t *arg, const char *local_var_prefix ) static void free_variable( const var_t *arg, const char *local_var_prefix )
{ {
unsigned int type_offset = arg->type->typestring_offset; unsigned int type_offset = arg->type->typestring_offset;
expr_t *iid;
type_t *type = arg->type; type_t *type = arg->type;
expr_t *size = get_size_is_expr(type, arg->name);
if (size) write_parameter_conf_or_var_exprs(proxy, indent, local_var_prefix, PHASE_FREE, arg, FALSE);
{
print_proxy( "__frame->_StubMsg.MaxCount = " );
write_expr(proxy, size, 0, 1, NULL, NULL, local_var_prefix);
fprintf(proxy, ";\n\n");
print_proxy( "NdrClearOutParameters( &__frame->_StubMsg, ");
fprintf(proxy, "&__MIDL_TypeFormatString.Format[%u], ", type_offset );
fprintf(proxy, "(void*)%s );\n", arg->name );
return;
}
switch (typegen_detect_type(type, arg->attrs, TDT_IGNORE_STRINGS)) switch (typegen_detect_type(type, arg->attrs, TDT_IGNORE_STRINGS))
{ {
...@@ -174,23 +163,11 @@ static void free_variable( const var_t *arg, const char *local_var_prefix ) ...@@ -174,23 +163,11 @@ static void free_variable( const var_t *arg, const char *local_var_prefix )
break; break;
case TGT_IFACE_POINTER: case TGT_IFACE_POINTER:
iid = get_attrp( arg->attrs, ATTR_IIDIS );
if( iid )
{
print_proxy( "__frame->_StubMsg.MaxCount = (ULONG_PTR) " );
write_expr(proxy, iid, 1, 1, NULL, NULL, local_var_prefix);
print_proxy( ";\n\n" );
}
/* fall through */
case TGT_POINTER: case TGT_POINTER:
if (get_pointer_fc(type, arg->attrs, TRUE) == RPC_FC_FP) case TGT_ARRAY:
{ print_proxy( "NdrClearOutParameters( &__frame->_StubMsg, ");
print_proxy( "NdrClearOutParameters( &__frame->_StubMsg, "); fprintf(proxy, "&__MIDL_TypeFormatString.Format[%u], ", type_offset );
fprintf(proxy, "&__MIDL_TypeFormatString.Format[%u], ", type_offset ); fprintf(proxy, "(void *)%s );\n", arg->name );
fprintf(proxy, "(void*)%s );\n", arg->name );
}
else
print_proxy("/* FIXME: %s code for %s type %d missing */\n", __FUNCTION__, arg->name, type_get_type(type) );
break; break;
default: default:
......
...@@ -4035,8 +4035,8 @@ expr_t *get_size_is_expr(const type_t *t, const char *name) ...@@ -4035,8 +4035,8 @@ expr_t *get_size_is_expr(const type_t *t, const char *name)
return x; return x;
} }
static void write_parameter_conf_or_var_exprs(FILE *file, int indent, const char *local_var_prefix, void write_parameter_conf_or_var_exprs(FILE *file, int indent, const char *local_var_prefix,
enum remoting_phase phase, const var_t *var) enum remoting_phase phase, const var_t *var, int valid_variance)
{ {
const type_t *type = var->type; const type_t *type = var->type;
/* get fundamental type for the argument */ /* get fundamental type for the argument */
...@@ -4057,9 +4057,14 @@ static void write_parameter_conf_or_var_exprs(FILE *file, int indent, const char ...@@ -4057,9 +4057,14 @@ static void write_parameter_conf_or_var_exprs(FILE *file, int indent, const char
if (type_array_has_variance(type)) if (type_array_has_variance(type))
{ {
print_file(file, indent, "__frame->_StubMsg.Offset = 0;\n"); /* FIXME */ print_file(file, indent, "__frame->_StubMsg.Offset = 0;\n"); /* FIXME */
print_file(file, indent, "__frame->_StubMsg.ActualCount = (ULONG_PTR)"); if (valid_variance)
write_expr(file, type_array_get_variance(type), 1, 1, NULL, NULL, local_var_prefix); {
fprintf(file, ";\n\n"); print_file(file, indent, "__frame->_StubMsg.ActualCount = (ULONG_PTR)");
write_expr(file, type_array_get_variance(type), 1, 1, NULL, NULL, local_var_prefix);
fprintf(file, ";\n\n");
}
else
print_file(file, indent, "__frame->_StubMsg.ActualCount = __frame->_StubMsg.MaxCount;\n\n");
} }
} }
break; break;
...@@ -4135,7 +4140,7 @@ static void write_remoting_arg(FILE *file, int indent, const var_t *func, const ...@@ -4135,7 +4140,7 @@ static void write_remoting_arg(FILE *file, int indent, const var_t *func, const
if (phase == PHASE_BUFFERSIZE && get_required_buffer_size( var, &alignment, pass )) return; if (phase == PHASE_BUFFERSIZE && get_required_buffer_size( var, &alignment, pass )) return;
write_parameter_conf_or_var_exprs(file, indent, local_var_prefix, phase, var); write_parameter_conf_or_var_exprs(file, indent, local_var_prefix, phase, var, TRUE);
switch (typegen_detect_type(type, var->attrs, TDT_ALL_TYPES)) switch (typegen_detect_type(type, var->attrs, TDT_ALL_TYPES))
{ {
......
...@@ -68,6 +68,8 @@ void write_typeformatstring(FILE *file, const statement_list_t *stmts, type_pred ...@@ -68,6 +68,8 @@ void write_typeformatstring(FILE *file, const statement_list_t *stmts, type_pred
void write_procformatstring_offsets( FILE *file, const type_t *iface ); void write_procformatstring_offsets( FILE *file, const type_t *iface );
void print_phase_basetype(FILE *file, int indent, const char *local_var_prefix, enum remoting_phase phase, void print_phase_basetype(FILE *file, int indent, const char *local_var_prefix, enum remoting_phase phase,
enum pass pass, const var_t *var, const char *varname); enum pass pass, const var_t *var, const char *varname);
void write_parameter_conf_or_var_exprs(FILE *file, int indent, const char *local_var_prefix,
enum remoting_phase phase, const var_t *var, int valid_variance);
void write_remoting_arguments(FILE *file, int indent, const var_t *func, const char *local_var_prefix, void write_remoting_arguments(FILE *file, int indent, const var_t *func, const char *local_var_prefix,
enum pass pass, enum remoting_phase phase); enum pass pass, enum remoting_phase phase);
unsigned int get_size_procformatstring_func(const type_t *iface, const var_t *func); unsigned int get_size_procformatstring_func(const type_t *iface, const var_t *func);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment