From 9a28119dd8e6b9fc715fe5b2f16d3e7881823bfc Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Mon, 17 Sep 2007 09:46:22 +0100 Subject: [PATCH] widl: Fix write_string_tfs for strings declared as arrays. The immediate type will be FC_*ARRAY, so rtype needs to use the referred type to get the base type. Also update the typeformat-string offset of the type. --- tools/widl/typegen.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index a15a969dee1..f585c1f0de5 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -1341,12 +1341,14 @@ static int is_declptr(const type_t *t) } static size_t write_string_tfs(FILE *file, const attr_list_t *attrs, - const type_t *type, + type_t *type, const char *name, unsigned int *typestring_offset) { size_t start_offset = *typestring_offset; unsigned char rtype; + update_tfsoff(type, start_offset, file); + if (is_declptr(type)) { unsigned char flag = is_conformant_array(type) ? 0 : RPC_FC_P_SIMPLEPOINTER; @@ -1365,7 +1367,7 @@ static size_t write_string_tfs(FILE *file, const attr_list_t *attrs, rtype = type->ref->type; } else - rtype = type->type; + rtype = type->ref->type; if ((rtype != RPC_FC_BYTE) && (rtype != RPC_FC_CHAR) && (rtype != RPC_FC_WCHAR)) {