From 9c738061e0a0cb029a420a6f105699e27b2a6d69 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Wed, 31 May 2006 12:20:39 +0100 Subject: [PATCH] oleaut32: Make sure to read the memid and the name offset from the correct offsets, after the function data, so add cFuncs to the offsets in MSFT_DoVars. Resolve referenced types for variables. Fixes initialisation of the dbgrid32 OCX. --- dlls/oleaut32/typelib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 25a5354b902..ce4f02f9f02 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -1899,7 +1899,7 @@ static void MSFT_DoVars(TLBContext *pcx, ITypeInfoImpl *pTI, int cFuncs, *pptvd=TLB_Alloc(sizeof(TLBVarDesc)); /* name, eventually add to a hash table */ MSFT_ReadLEDWords(&nameoffset, sizeof(INT), pcx, - offset + infolen + (cFuncs + cVars + i + 1) * sizeof(INT)); + offset + infolen + (2*cFuncs + cVars + i + 1) * sizeof(INT)); (*pptvd)->Name=MSFT_ReadName(pcx, nameoffset); /* read the variable information record */ MSFT_ReadLEDWords(&reclength, sizeof(INT), pcx, recoffset); @@ -1915,7 +1915,7 @@ static void MSFT_DoVars(TLBContext *pcx, ITypeInfoImpl *pTI, int cFuncs, (*pptvd)->HelpStringContext=pVarRec->HelpStringContext; /* fill the VarDesc Structure */ MSFT_ReadLEDWords(&(*pptvd)->vardesc.memid, sizeof(INT), pcx, - offset + infolen + ( i + 1) * sizeof(INT)); + offset + infolen + (cFuncs + i + 1) * sizeof(INT)); (*pptvd)->vardesc.varkind = pVarRec->VarKind; (*pptvd)->vardesc.wVarFlags = pVarRec->Flags; MSFT_GetTdesc(pcx, pVarRec->DataType, @@ -1927,6 +1927,7 @@ static void MSFT_DoVars(TLBContext *pcx, ITypeInfoImpl *pTI, int cFuncs, pVarRec->OffsValue, pcx); } else (*pptvd)->vardesc.u.oInst=pVarRec->OffsValue; + MSFT_ResolveReferencedTypes(pcx, pTI, &(*pptvd)->vardesc.elemdescVar.tdesc); pptvd=&((*pptvd)->next); recoffset += reclength; }