From 3870bf0d9e69924ac98633f5a0b541f77ec8f144 Mon Sep 17 00:00:00 2001 From: Dan Hipschman Date: Thu, 17 Aug 2006 18:09:20 -0700 Subject: [PATCH] widl: Output format-strings for interface pointers. --- tools/widl/typegen.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 2d7e07f62d9..523556f0094 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -1279,6 +1279,31 @@ static size_t write_union_tfs(FILE *file, const attr_t *attrs, return *typeformat_offset; } +static size_t write_ip_tfs(FILE *file, const attr_t *attrs, const type_t *type, + const char *name, unsigned int *typeformat_offset) +{ + size_t i; + size_t start_offset = *typeformat_offset; + const UUID *uuid = get_attrp(attrs, ATTR_UUID); + + if (! uuid) + error("%s: interface %s missing UUID\n", __FUNCTION__, name); + + print_file(file, 2, "0x2f,\t/* FC_IP */\n"); + print_file(file, 2, "0x5a,\t/* FC_CONSTANT_IID */\n"); + print_file(file, 2, "NdrFcLong(0x%08lx),\n", uuid->Data1); + print_file(file, 2, "NdrFcShort(0x%04x),\n", uuid->Data2); + print_file(file, 2, "NdrFcShort(0x%04x),\n", uuid->Data3); + for (i = 0; i < 8; ++i) + print_file(file, 2, "0x%02x,\n", uuid->Data4[i]); + + if (file) + fprintf(file, "\n"); + + *typeformat_offset += 18; + return start_offset; +} + static size_t write_typeformatstring_var(FILE *file, int indent, const var_t *var, unsigned int *typeformat_offset) { @@ -1339,6 +1364,11 @@ static size_t write_typeformatstring_var(FILE *file, int indent, int pointer_type = get_attrv(var->attrs, ATTR_POINTERTYPE); if (!pointer_type) pointer_type = RPC_FC_RP; + if (type->type == RPC_FC_IP) + { + return write_ip_tfs(file, type->attrs, type, type->name, typeformat_offset); + } + /* special case for pointers to base types */ switch (type->type) { -- 2.11.4.GIT