From 45989a1ff1268480e9cf4697881a12bd664e15e1 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Mon, 30 Jun 2008 23:04:33 +0100 Subject: [PATCH] oleaut32: Implement the 0x08 flag in SLTG_DoVars. It means that the data is stored directly in pItem->byte_offs instead of the byte offset pointed to by it. --- dlls/oleaut32/typelib.c | 19 +++++++++++++------ dlls/oleaut32/typelib.h | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 43aedc5a056..aa4c178b7e7 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -3099,7 +3099,6 @@ static void SLTG_DoVars(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, unsign SLTG_Variable *pItem; unsigned short i; WORD *pType; - char buf[300]; for(pItem = (SLTG_Variable *)pFirstItem, i = 0; i < cVars; pItem = (SLTG_Variable *)(pBlk + pItem->next), i++) { @@ -3119,6 +3118,7 @@ static void SLTG_DoVars(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, unsign else (*ppVarDesc)->Name = TLB_MultiByteToBSTR(pItem->name + pNameTable); + TRACE_(typelib)("name: %s\n", debugstr_w((*ppVarDesc)->Name)); TRACE_(typelib)("byte_offs = 0x%x\n", pItem->byte_offs); TRACE_(typelib)("memid = 0x%x\n", pItem->memid); @@ -3132,8 +3132,11 @@ static void SLTG_DoVars(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, unsign (*ppVarDesc)->vardesc.u.lpvarValue = HeapAlloc(GetProcessHeap(), 0, sizeof(VARIANT)); V_VT((*ppVarDesc)->vardesc.u.lpvarValue) = VT_INT; - V_UNION((*ppVarDesc)->vardesc.u.lpvarValue, intVal) = - *(INT*)(pBlk + pItem->byte_offs); + if (pItem->flags & 0x08) + V_UNION((*ppVarDesc)->vardesc.u.lpvarValue, intVal) = pItem->byte_offs; + else + V_UNION((*ppVarDesc)->vardesc.u.lpvarValue, intVal) = + *(INT*)(pBlk + pItem->byte_offs); } else { TRACE_(typelib)("VAR_PERINSTANCE\n"); @@ -3152,13 +3155,17 @@ static void SLTG_DoVars(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, unsign else pType = (WORD*)(pBlk + pItem->type); - if (pItem->flags & ~0xd2) - FIXME_(typelib)("unhandled flags = %02x\n", pItem->flags & ~0xd2); + if (pItem->flags & ~0xda) + FIXME_(typelib)("unhandled flags = %02x\n", pItem->flags & ~0xda); SLTG_DoElem(pType, pBlk, &(*ppVarDesc)->vardesc.elemdescVar, ref_lookup); - dump_TypeDesc(&(*ppVarDesc)->vardesc.elemdescVar.tdesc, buf); + if (TRACE_ON(typelib)) { + char buf[300]; + dump_TypeDesc(&(*ppVarDesc)->vardesc.elemdescVar.tdesc, buf); + TRACE_(typelib)("elemdescVar: %s\n", buf); + } bstrPrevName = (*ppVarDesc)->Name; ppVarDesc = &((*ppVarDesc)->next); diff --git a/dlls/oleaut32/typelib.h b/dlls/oleaut32/typelib.h index b25f031d5ef..821981f1cdf 100644 --- a/dlls/oleaut32/typelib.h +++ b/dlls/oleaut32/typelib.h @@ -576,7 +576,7 @@ typedef struct { BYTE flags; WORD next; WORD name; - WORD byte_offs; /* pos in struct, or offset to const type */ + WORD byte_offs; /* pos in struct, or offset to const type or const data (if flags & 0x08) */ WORD type; /* if flags & 0x02 this is the type, else offset to type */ DWORD memid; WORD helpcontext; /* ?? */