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: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2015-10-31 14:31:32 +08:00 committed by Alexandre Julliard
parent 736beff9c6
commit f16396ceec
1 changed files with 10 additions and 3 deletions

View File

@ -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;
}