From fc7681a8ceae63a2d5c66a157e30338ed8a8f92a Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 3 Jul 2009 11:44:10 +0200 Subject: [PATCH] widl: Skip the existing correlation descriptor on unencapsulated unions when generating a different one. --- tools/widl/typegen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index b60a53c105c..861dada6f64 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -1521,8 +1521,11 @@ static void write_descriptors(FILE *file, type_t *type, unsigned int *tfsoff) type_t *ft = f->type; if (type_get_type(ft) == TYPE_UNION && is_attr(f->attrs, ATTR_SWITCHIS)) { + short reloff; unsigned int absoff = ft->typestring_offset; - short reloff = absoff - (*tfsoff + 6); + if (is_attr(ft->attrs, ATTR_SWITCHTYPE)) + absoff += 8; /* we already have a corr descr, skip it */ + reloff = absoff - (*tfsoff + 6); print_file(file, 0, "/* %d */\n", *tfsoff); print_file(file, 2, "0x%x,\t/* FC_NON_ENCAPSULATED_UNION */\n", RPC_FC_NON_ENCAPSULATED_UNION); print_file(file, 2, "0x%x,\t/* FIXME: always FC_LONG */\n", RPC_FC_LONG); @@ -2509,6 +2512,7 @@ static unsigned int write_union_tfs(FILE *file, type_t *type, unsigned int *tfso *tfsoff += write_conf_or_var_desc(file, NULL, *tfsoff, st, &dummy_expr ); print_file(file, 2, "NdrFcShort(0x2),\t/* Offset= 2 (%u) */\n", *tfsoff + 2); *tfsoff += 2; + print_file(file, 0, "/* %u */\n", *tfsoff); } print_file(file, 2, "NdrFcShort(0x%hx),\t/* %d */\n", size, size); -- 2.11.4.GIT