widl: Do not create duplicate type info entries when tag and typedef names are the same.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
This commit is contained in:
Dmitry Timoshkov 2015-10-05 20:36:02 +08:00 committed by Alexandre Julliard
parent d050343c50
commit fb5293f0ce
2 changed files with 22 additions and 12 deletions

View File

@ -3780,7 +3780,6 @@ todo_wine
VariantInit(&ret);
hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_SETAUTOLOGONPOLICY, &IID_NULL, 0,
DISPATCH_METHOD, &params, &ret, NULL, NULL);
todo_wine
ok(hr == S_OK, "error %#x\n", hr);
IWinHttpRequest_Release(request);

View File

@ -1836,7 +1836,7 @@ static msft_typeinfo_t *create_msft_typeinfo(msft_typelib_t *typelib, enum type_
MSFT_TypeInfoBase *typeinfo;
MSFT_GuidEntry guidentry;
chat("create_msft_typeinfo: name %s kind %d\n", name, kind);
chat("create_msft_typeinfo: name %s kind %d index %d\n", name, kind, typelib->typelib_header.nrtypeinfos);
msft_typeinfo = xmalloc(sizeof(*msft_typeinfo));
memset( msft_typeinfo, 0, sizeof(*msft_typeinfo) );
@ -2143,20 +2143,31 @@ static void add_enum_typeinfo(msft_typelib_t *typelib, type_t *enumeration)
static void add_typedef_typeinfo(msft_typelib_t *typelib, type_t *tdef)
{
msft_typeinfo_t *msft_typeinfo;
int alignment;
msft_typeinfo_t *msft_typeinfo = NULL;
int alignment, datatype1, datatype2, size;
type_t *type;
if (-1 < tdef->typelib_idx)
return;
tdef->typelib_idx = typelib->typelib_header.nrtypeinfos;
msft_typeinfo = create_msft_typeinfo(typelib, TKIND_ALIAS, tdef->name, tdef->attrs);
encode_type(typelib, get_type_vt(type_alias_get_aliasee(tdef)),
type_alias_get_aliasee(tdef),
&msft_typeinfo->typeinfo->datatype1,
&msft_typeinfo->typeinfo->size,
&alignment, &msft_typeinfo->typeinfo->datatype2);
msft_typeinfo->typeinfo->typekind |= (alignment << 11 | alignment << 6);
type = type_alias_get_aliasee(tdef);
if (!type->name || strcmp(tdef->name, type->name) != 0)
{
tdef->typelib_idx = typelib->typelib_header.nrtypeinfos;
msft_typeinfo = create_msft_typeinfo(typelib, TKIND_ALIAS, tdef->name, tdef->attrs);
}
encode_type(typelib, get_type_vt(type), type,
&datatype1, &size, &alignment, &datatype2);
if (msft_typeinfo)
{
msft_typeinfo->typeinfo->datatype1 = datatype1;
msft_typeinfo->typeinfo->size = size;
msft_typeinfo->typeinfo->datatype2 = datatype2;
msft_typeinfo->typeinfo->typekind |= (alignment << 11 | alignment << 6);
}
}
static void add_coclass_typeinfo(msft_typelib_t *typelib, type_t *cls)