Commit fe311461 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

Cope with the index in a import table entry being a typeinfo index

rather than a guid offset.
parent ff25db08
......@@ -1997,8 +1997,11 @@ static void MSFT_DoRefType(TLBContext *pcx, ITypeInfoImpl *pTI,
if(pImpLib){
(*ppRefType)->reference=offset;
(*ppRefType)->pImpTLInfo = pImpLib;
MSFT_ReadGuid(&(*ppRefType)->guid, impinfo.oGuid, pcx);
(*ppRefType)->index = TLB_REF_USE_GUID;
if(impinfo.flags & MSFT_IMPINFO_OFFSET_IS_GUID) {
MSFT_ReadGuid(&(*ppRefType)->guid, impinfo.oGuid, pcx);
(*ppRefType)->index = TLB_REF_USE_GUID;
} else
(*ppRefType)->index = impinfo.oGuid;
}else{
ERR("Cannot find a reference\n");
(*ppRefType)->reference=-1;
......
......@@ -157,17 +157,19 @@ typedef struct tagMSFT_TypeInfoBase {
/* else it is zero? */
INT res18; /* always? 0 */
/*060*/ INT res19; /* always? -1 */
} MSFT_TypeInfoBase;
} MSFT_TypeInfoBase;
/* layout of an entry with information on imported types */
typedef struct tagMSFT_ImpInfo {
INT res0; /* bits 0 - 15: count */
INT flags; /* bits 0 - 15: count */
/* bit 16: if set oGuid is an offset to Guid */
/* if clear oGuid is a typeinfo index in the specified typelib */
/* bits 24 - 31: TKIND of reference */
INT oImpFile; /* offset in the Import File table */
INT oGuid; /* offset in Guid table or typeinfo index (see bit 16 of res0) */
} MSFT_ImpInfo;
} MSFT_ImpInfo;
#define MSFT_IMPINFO_OFFSET_IS_GUID 0x00010000
/* function description data */
typedef struct {
......
......@@ -1242,7 +1242,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeFlags(ICreateTypeInfo2 *iface, U
guidoffset = ctl2_alloc_guid(This->typelib, &foo);
if (guidoffset == -1) return E_OUTOFMEMORY;
impinfo.res0 = 0x03010000;
impinfo.flags = TKIND_INTERFACE << 24 | MSFT_IMPINFO_OFFSET_IS_GUID;
impinfo.oImpFile = fileoffset;
impinfo.oGuid = guidoffset;
ctl2_alloc_importinfo(This->typelib, &impinfo);
......
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