Commit f16396ce authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

widl: Avoid warnings when being added dispatch guids already present in a typelib.

Silence warnings about adding a duplicate uuid when generating stdole2.tlb. Signed-off-by: 's avatarDmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 736beff9
......@@ -1978,7 +1978,7 @@ static msft_typeinfo_t *create_msft_typeinfo(msft_typelib_t *typelib, enum type_
static void add_dispatch(msft_typelib_t *typelib)
{
int guid_offset, impfile_offset;
int guid_offset, impfile_offset, hash_key;
MSFT_GuidEntry guidentry;
MSFT_ImpInfo impinfo;
GUID stdole = {0x00020430,0x0000,0x0000,{0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}};
......@@ -1989,7 +1989,10 @@ static void add_dispatch(msft_typelib_t *typelib)
guidentry.guid = stdole;
guidentry.hreftype = 2;
guidentry.next_hash = -1;
guid_offset = ctl2_alloc_guid(typelib, &guidentry);
hash_key = ctl2_hash_guid(&guidentry.guid);
guid_offset = ctl2_find_guid(typelib, hash_key, &guidentry.guid);
if (guid_offset == -1)
guid_offset = ctl2_alloc_guid(typelib, &guidentry);
impfile_offset = alloc_importfile(typelib, guid_offset, 2, 0, "stdole2.tlb");
guidentry.guid = iid_idispatch;
......@@ -1997,7 +2000,11 @@ static void add_dispatch(msft_typelib_t *typelib)
guidentry.next_hash = -1;
impinfo.flags = TKIND_INTERFACE << 24 | MSFT_IMPINFO_OFFSET_IS_GUID;
impinfo.oImpFile = impfile_offset;
impinfo.oGuid = ctl2_alloc_guid(typelib, &guidentry);
hash_key = ctl2_hash_guid(&guidentry.guid);
guid_offset = ctl2_find_guid(typelib, hash_key, &guidentry.guid);
if (guid_offset == -1)
guid_offset = ctl2_alloc_guid(typelib, &guidentry);
impinfo.oGuid = guid_offset;
typelib->typelib_header.dispatchpos = alloc_msft_importinfo(typelib, &impinfo) | 0x01;
}
......
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