Robert Shearman : oleaut32: Initialize member IDs to MEMBERID_NIL
inITypeInfo::GetIDsOfNames.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Dec 26 11:46:22 CST 2005
Module: wine
Branch: refs/heads/master
Commit: fa49c971f1f705d3faa91ee23ce5101b319acc1d
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=fa49c971f1f705d3faa91ee23ce5101b319acc1d
Author: Robert Shearman <rob at codeweavers.com>
Date: Mon Dec 26 13:03:27 2005 +0100
oleaut32: Initialize member IDs to MEMBERID_NIL inITypeInfo::GetIDsOfNames.
Better tracing.
---
dlls/oleaut32/typelib.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 965342c..0e40e2b 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -3614,7 +3614,11 @@ static HRESULT WINAPI ITypeLib2_fnGetTyp
TRACE("(%p)\n\tguid:\t%s)\n",This,debugstr_guid(guid));
- if (!pTypeInfo) return TYPE_E_ELEMENTNOTFOUND;
+ if (!pTypeInfo)
+ {
+ WARN("-- element not found\n");
+ return TYPE_E_ELEMENTNOTFOUND;
+ }
/* search linked list for guid */
while( !IsEqualIID(guid,&pTypeInfo->TypeAttr.guid) )
@@ -3624,7 +3628,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTyp
if (!pTypeInfo)
{
/* end of list reached */
- TRACE("-- element not found\n");
+ WARN("-- element not found\n");
return TYPE_E_ELEMENTNOTFOUND;
}
}
@@ -4771,11 +4775,17 @@ static HRESULT WINAPI ITypeInfo_fnGetIDs
TLBFuncDesc * pFDesc;
TLBVarDesc * pVDesc;
HRESULT ret=S_OK;
+ int i;
TRACE("(%p) Name %s cNames %d\n", This, debugstr_w(*rgszNames),
cNames);
+
+ /* init out parameters in case of failure */
+ for (i = 0; i < cNames; i++)
+ pMemId[i] = MEMBERID_NIL;
+
for(pFDesc=This->funclist; pFDesc; pFDesc=pFDesc->next) {
- int i, j;
+ int j;
if(!lstrcmpiW(*rgszNames, pFDesc->Name)) {
if(cNames) *pMemId=pFDesc->funcdesc.memid;
for(i=1; i < cNames; i++){
@@ -4787,6 +4797,7 @@ static HRESULT WINAPI ITypeInfo_fnGetIDs
else
ret=DISP_E_UNKNOWNNAME;
};
+ TRACE("-- 0x%08lx\n", ret);
return ret;
}
}
More information about the wine-cvs
mailing list