Commit d8d1693d authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

OLE: fix function name loading

Correctly get the name of the second function of a propget/propput pair in MSFT typelibs when the name offset is set to -1.
parent bd8fefd6
......@@ -1685,6 +1685,7 @@ MSFT_DoFuncs(TLBContext* pcx,
char recbuf[512];
MSFT_FuncRecord * pFuncRec=(MSFT_FuncRecord *) recbuf;
TLBFuncDesc *ptfd_prev = NULL;
TRACE_(typelib)("\n");
......@@ -1698,7 +1699,12 @@ MSFT_DoFuncs(TLBContext* pcx,
MSFT_ReadLEDWords(&nameoffset, sizeof(INT), pcx,
offset + infolen + (cFuncs + cVars + i + 1) * sizeof(INT));
(*pptfd)->Name = MSFT_ReadName(pcx, nameoffset);
/* nameoffset is sometimes -1 on the second half of a propget/propput
* pair of functions */
if ((nameoffset == -1) && (i > 0))
(*pptfd)->Name = SysAllocString(ptfd_prev->Name);
else
(*pptfd)->Name = MSFT_ReadName(pcx, nameoffset);
/* read the function information record */
MSFT_ReadLEDWords(&reclength, sizeof(INT), pcx, recoffset);
......@@ -1844,6 +1850,8 @@ MSFT_DoFuncs(TLBContext* pcx,
MSFT_ReadValue(&(pParamDesc->pparamdescex->varDefaultValue),
pInt[j], pcx);
}
else
elemdesc->u.paramdesc.pparamdescex = NULL;
/* custom info */
if ( nrattributes > 7 + j && pFuncRec->FKCCIC & 0x80 )
{
......@@ -1867,6 +1875,7 @@ MSFT_DoFuncs(TLBContext* pcx,
(*pptfd)->funcdesc.cScodes = 0 ;
(*pptfd)->funcdesc.lprgscode = NULL ;
ptfd_prev = *pptfd;
pptfd = & ((*pptfd)->next);
recoffset += reclength;
}
......
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