PATCH: fixed string length determination in typelib.c
Marcus Meissner
marcus at jet.franken.de
Sun Jun 12 07:17:33 CDT 2005
Hi,
ITypeLib::IsName() and FindName() were using SysStringLen() on LPOLESTR.
SysStringLen() only works on BSTRings.
This fixes the initial problem of http://bugs.winehq.org/show_bug.cgi?id=2465
Ciao, Marcus
Changelog:
Corrected string length method in ITypeLib::IsName() and FindName()
for LPOLESTR type.
Index: dlls/oleaut32/typelib.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/typelib.c,v
retrieving revision 1.152
diff -u -r1.152 typelib.c
--- dlls/oleaut32/typelib.c 10 Jun 2005 19:31:45 -0000 1.152
+++ dlls/oleaut32/typelib.c 12 Jun 2005 12:11:20 -0000
@@ -3778,7 +3778,7 @@
TLBFuncDesc *pFInfo;
TLBVarDesc *pVInfo;
int i;
- UINT nNameBufLen = SysStringLen(szNameBuf);
+ UINT nNameBufLen = (lstrlenW(szNameBuf)+1)*sizeof(WCHAR);
TRACE("(%p)->(%s,%08lx,%p)\n", This, debugstr_w(szNameBuf), lHashVal,
pfName);
@@ -3824,16 +3824,16 @@
TLBFuncDesc *pFInfo;
TLBVarDesc *pVInfo;
int i,j = 0;
-
- UINT nNameBufLen = SysStringLen(szNameBuf);
+ UINT nNameBufLen = (lstrlenW(szNameBuf)+1)*sizeof(WCHAR);
for(pTInfo=This->pTypeInfo;pTInfo && j<*pcFound; pTInfo=pTInfo->next){
if(!memcmp(szNameBuf,pTInfo->Name, nNameBufLen)) goto ITypeLib2_fnFindName_exit;
for(pFInfo=pTInfo->funclist;pFInfo;pFInfo=pFInfo->next) {
if(!memcmp(szNameBuf,pFInfo->Name,nNameBufLen)) goto ITypeLib2_fnFindName_exit;
- for(i=0;i<pFInfo->funcdesc.cParams;i++)
+ for(i=0;i<pFInfo->funcdesc.cParams;i++) {
if(!memcmp(szNameBuf,pFInfo->pParamDesc[i].Name,nNameBufLen))
goto ITypeLib2_fnFindName_exit;
+ }
}
for(pVInfo=pTInfo->varlist;pVInfo;pVInfo=pVInfo->next)
if(!memcmp(szNameBuf,pVInfo->Name, nNameBufLen)) goto ITypeLib2_fnFindName_exit;
More information about the wine-patches
mailing list