Robert Shearman : OLE: fix function name loading
Alexandre Julliard
julliard at wine.codeweavers.com
Sat Dec 3 12:31:17 CST 2005
Module: wine
Branch: refs/heads/master
Commit: d8d1693def4dea73b60d9ce0786bf938a0a6f7cc
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=d8d1693def4dea73b60d9ce0786bf938a0a6f7cc
Author: Robert Shearman <rob at codeweavers.com>
Date: Sat Dec 3 18:20:03 2005 +0100
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.
---
dlls/oleaut32/typelib.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 07fa031..3e4b83b 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -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;
}
More information about the wine-cvs
mailing list