+static void write_parameter_conf_or_var_exprs(FILE *file, int indent,
+ enum remoting_phase phase,
+ const var_t *var)
+{
+ const type_t *type = var->type;
+ /* get fundamental type for the argument */
+ for (;;)
+ {
+ if (is_attr(type->attrs, ATTR_WIREMARSHAL))
+ break;
+ else if (is_attr(type->attrs, ATTR_CONTEXTHANDLE))
+ break;
+ else if (is_array(type) || is_string_type(var->attrs, type))
+ {
+ if (is_conformance_needed_for_phase(phase))
+ {
+ if (type->size_is)
+ {
+ print_file(file, indent, "_StubMsg.MaxCount = (unsigned long)");
+ write_expr(file, type->size_is, 1, 1, NULL, NULL);
+ fprintf(file, ";\n\n");
+ }
+ if (type->length_is)
+ {
+ print_file(file, indent, "_StubMsg.Offset = (unsigned long)0;\n"); /* FIXME */
+ print_file(file, indent, "_StubMsg.ActualCount = (unsigned long)");
+ write_expr(file, type->length_is, 1, 1, NULL, NULL);
+ fprintf(file, ";\n\n");
+ }
+ }
+ break;
+ }
+ else if (type->type == RPC_FC_NON_ENCAPSULATED_UNION)
+ {
+ if (is_conformance_needed_for_phase(phase))
+ {
+ print_file(file, indent, "_StubMsg.MaxCount = (unsigned long)");
+ write_expr(file, get_attrp(var->attrs, ATTR_SWITCHIS), 1, 1, NULL, NULL);
+ fprintf(file, ";\n\n");
+ }
+ break;
+ }
+ else if (type->type == RPC_FC_IP)
+ {
+ expr_t *iid;
+
+ if (is_conformance_needed_for_phase(phase) && (iid = get_attrp( var->attrs, ATTR_IIDIS )))
+ {
+ print_file( file, indent, "_StubMsg.MaxCount = (unsigned long) " );
+ write_expr( file, iid, 1, 1, NULL, NULL );
+ fprintf( file, ";\n\n" );
+ }
+ break;
+ }
+ else if (is_ptr(type))
+ type = type->ref;
+ else
+ break;
+ }
+}
+