From: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com Signed-off-by: Huw Davies huw@codeweavers.com --- tools/widl/write_msft.c | 69 +++++++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 28 deletions(-)
diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c index 4b09317acf..8ce34d9566 100644 --- a/tools/widl/write_msft.c +++ b/tools/widl/write_msft.c @@ -990,40 +990,53 @@ static int encode_type(
case VT_USERDEFINED: { + importinfo_t *importinfo; int typeinfo_offset;
- /* 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); + if ((importinfo = find_importinfo(typelib, type->name))) + { + 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, - type->name, type_get_type(type), type->typelib_idx); + 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);
- if(type->typelib_idx == -1) { - chat("encode_type: trying to ref not added type\n"); - switch (type_get_type(type)) { - case TYPE_STRUCT: - add_structure_typeinfo(typelib, type); - break; - case TYPE_INTERFACE: - add_interface_typeinfo(typelib, type); - break; - case TYPE_ENUM: - add_enum_typeinfo(typelib, type); - break; - case TYPE_UNION: - add_union_typeinfo(typelib, type); - break; - case TYPE_COCLASS: - add_coclass_typeinfo(typelib, type); - break; - default: - error("encode_type: VT_USERDEFINED - unhandled type %d\n", - type_get_type(type)); + if (type->typelib_idx == -1) + { + chat("encode_type: trying to ref not added type\n"); + switch (type_get_type(type)) + { + case TYPE_STRUCT: + add_structure_typeinfo(typelib, type); + break; + case TYPE_INTERFACE: + add_interface_typeinfo(typelib, type); + break; + case TYPE_ENUM: + add_enum_typeinfo(typelib, type); + break; + case TYPE_UNION: + add_union_typeinfo(typelib, type); + break; + case TYPE_COCLASS: + add_coclass_typeinfo(typelib, type); + break; + 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) { typedata = (void *)&typelib->typelib_segment_data[MSFT_SEG_TYPEDESC][typeoffset]; if ((typedata[0] == ((0x7fff << 16) | VT_USERDEFINED)) && (typedata[1] == typeinfo_offset)) break;
Huw Davies huw@codeweavers.com writes:
From: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com Signed-off-by: Huw Davies huw@codeweavers.com
tools/widl/write_msft.c | 69 +++++++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 28 deletions(-)
This is causing new widl warnings. Could you please have a look?
make[1]: Entering directory '/home/julliard/wine/wine/dlls/olepro32' ../../tools/widl/widl -o olepro_t.res -m32 -I. -I../../include -D__WINESRC__ olepro.idl warning: duplicate uuid {66504313-be0f-101a-8bbb-00aa00300cab} warning: duplicate uuid {bef6e002-a874-101a-8bba-00aa00300cab} warning: duplicate uuid {bef6e003-a874-101a-8bba-00aa00300cab} warning: duplicate uuid {66504308-be0f-101a-8bbb-00aa00300cab} warning: duplicate uuid {66504309-be0f-101a-8bbb-00aa00300cab} warning: duplicate uuid {66504306-be0f-101a-8bbb-00aa00300cab} warning: duplicate uuid {66504307-be0f-101a-8bbb-00aa00300cab} warning: duplicate uuid {7bf80981-bf32-101a-8bbb-00aa00300cab}
On 29/05/18 12:10, Alexandre Julliard wrote:
Huw Davies huw@codeweavers.com writes:
From: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com Signed-off-by: Huw Davies huw@codeweavers.com
tools/widl/write_msft.c | 69 +++++++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 28 deletions(-)
This is causing new widl warnings. Could you please have a look?
make[1]: Entering directory '/home/julliard/wine/wine/dlls/olepro32' ../../tools/widl/widl -o olepro_t.res -m32 -I. -I../../include -D__WINESRC__ olepro.idl warning: duplicate uuid {66504313-be0f-101a-8bbb-00aa00300cab} warning: duplicate uuid {bef6e002-a874-101a-8bba-00aa00300cab} warning: duplicate uuid {bef6e003-a874-101a-8bba-00aa00300cab} warning: duplicate uuid {66504308-be0f-101a-8bbb-00aa00300cab} warning: duplicate uuid {66504309-be0f-101a-8bbb-00aa00300cab} warning: duplicate uuid {66504306-be0f-101a-8bbb-00aa00300cab} warning: duplicate uuid {66504307-be0f-101a-8bbb-00aa00300cab} warning: duplicate uuid {7bf80981-bf32-101a-8bbb-00aa00300cab}
Sure, I'll take a look.