widl: Allow adding the same custdata GUID multiple times in a typelib.
e.g. using the same kind of custdata in multiple interfaces Signed-off-by: Kevin Puetz <PuetzKevinA@JohnDeere.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
02b6df007a
commit
997439967f
|
@ -1263,18 +1263,25 @@ static void write_default_value(msft_typelib_t *typelib, type_t *type, expr_t *e
|
||||||
static HRESULT set_custdata(msft_typelib_t *typelib, REFGUID guid,
|
static HRESULT set_custdata(msft_typelib_t *typelib, REFGUID guid,
|
||||||
int vt, const void *value, int *offset)
|
int vt, const void *value, int *offset)
|
||||||
{
|
{
|
||||||
MSFT_GuidEntry guidentry;
|
|
||||||
int guidoffset;
|
int guidoffset;
|
||||||
int custoffset;
|
int custoffset;
|
||||||
int *custdata;
|
int *custdata;
|
||||||
int data_out;
|
int data_out;
|
||||||
|
int hash_key;
|
||||||
|
|
||||||
|
hash_key = ctl2_hash_guid(guid);
|
||||||
|
guidoffset = ctl2_find_guid(typelib, hash_key, guid);
|
||||||
|
if(guidoffset == -1) {
|
||||||
|
/* add GUID that was not already present */
|
||||||
|
MSFT_GuidEntry guidentry;
|
||||||
guidentry.guid = *guid;
|
guidentry.guid = *guid;
|
||||||
|
|
||||||
guidentry.hreftype = -1;
|
guidentry.hreftype = -1;
|
||||||
guidentry.next_hash = -1;
|
guidentry.next_hash = -1;
|
||||||
|
|
||||||
guidoffset = ctl2_alloc_guid(typelib, &guidentry);
|
guidoffset = ctl2_alloc_guid(typelib, &guidentry);
|
||||||
|
}
|
||||||
|
|
||||||
if(vt == VT_BSTR)
|
if(vt == VT_BSTR)
|
||||||
/* TODO midl appears to share a single reference if the same string is used as custdata in multiple places */
|
/* TODO midl appears to share a single reference if the same string is used as custdata in multiple places */
|
||||||
write_string_value(typelib, &data_out, value);
|
write_string_value(typelib, &data_out, value);
|
||||||
|
|
Loading…
Reference in New Issue