From 970ae8d0ba1b5488a361480bf3c19aaae0338ae2 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Mon, 13 Jun 2005 09:59:55 +0000 Subject: [PATCH] Corrected string length method in ITypeLib::IsName() and FindName() for LPOLESTR type. --- dlls/oleaut32/typelib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 7a872f611f0..fca8ae19269 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -3778,7 +3778,7 @@ static HRESULT WINAPI ITypeLib2_fnIsName( 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 @@ static HRESULT WINAPI ITypeLib2_fnFindName( 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;ifuncdesc.cParams;i++) + for(i=0;ifuncdesc.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;