Commit 3e7a5301 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

widl: Try to import typedefs instead of redefining them.

parent d0ab6deb
...@@ -990,40 +990,53 @@ static int encode_type( ...@@ -990,40 +990,53 @@ static int encode_type(
case VT_USERDEFINED: case VT_USERDEFINED:
{ {
importinfo_t *importinfo;
int typeinfo_offset; int typeinfo_offset;
/* typedef'd types without public attribute aren't included in the typelib */ if ((importinfo = find_importinfo(typelib, type->name)))
while (type->typelib_idx < 0 && type_is_alias(type) && !is_attr(type->attrs, ATTR_PUBLIC)) {
type = type_alias_get_aliasee(type); chat("encode_type: VT_USERDEFINED - found imported type %s in %s\n",
type->name, importinfo->importlib->name);
alloc_importinfo(typelib, importinfo);
typeinfo_offset = importinfo->offset | 0x1;
}
else
{
/* typedef'd types without public attribute aren't included in the typelib */
while (type->typelib_idx < 0 && type_is_alias(type) && !is_attr(type->attrs, ATTR_PUBLIC))
type = type_alias_get_aliasee(type);
chat("encode_type: VT_USERDEFINED - type %p name = %s real type %d idx %d\n", type, chat("encode_type: VT_USERDEFINED - type %p name = %s real type %d idx %d\n", type,
type->name, type_get_type(type), type->typelib_idx); type->name, type_get_type(type), type->typelib_idx);
if(type->typelib_idx == -1) { if (type->typelib_idx == -1)
chat("encode_type: trying to ref not added type\n"); {
switch (type_get_type(type)) { chat("encode_type: trying to ref not added type\n");
case TYPE_STRUCT: switch (type_get_type(type))
add_structure_typeinfo(typelib, type); {
break; case TYPE_STRUCT:
case TYPE_INTERFACE: add_structure_typeinfo(typelib, type);
add_interface_typeinfo(typelib, type); break;
break; case TYPE_INTERFACE:
case TYPE_ENUM: add_interface_typeinfo(typelib, type);
add_enum_typeinfo(typelib, type); break;
break; case TYPE_ENUM:
case TYPE_UNION: add_enum_typeinfo(typelib, type);
add_union_typeinfo(typelib, type); break;
break; case TYPE_UNION:
case TYPE_COCLASS: add_union_typeinfo(typelib, type);
add_coclass_typeinfo(typelib, type); break;
break; case TYPE_COCLASS:
default: add_coclass_typeinfo(typelib, type);
error("encode_type: VT_USERDEFINED - unhandled type %d\n", break;
type_get_type(type)); default:
error("encode_type: VT_USERDEFINED - unhandled type %d\n",
type_get_type(type));
}
} }
}
typeinfo_offset = typelib->typelib_typeinfo_offsets[type->typelib_idx]; typeinfo_offset = typelib->typelib_typeinfo_offsets[type->typelib_idx];
}
for (typeoffset = 0; typeoffset < typelib->typelib_segdir[MSFT_SEG_TYPEDESC].length; typeoffset += 8) { for (typeoffset = 0; typeoffset < typelib->typelib_segdir[MSFT_SEG_TYPEDESC].length; typeoffset += 8) {
typedata = (void *)&typelib->typelib_segment_data[MSFT_SEG_TYPEDESC][typeoffset]; typedata = (void *)&typelib->typelib_segment_data[MSFT_SEG_TYPEDESC][typeoffset];
if ((typedata[0] == ((0x7fff << 16) | VT_USERDEFINED)) && (typedata[1] == typeinfo_offset)) break; if ((typedata[0] == ((0x7fff << 16) | VT_USERDEFINED)) && (typedata[1] == typeinfo_offset)) break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment