DispGetIDsOfNames: return DISPID_UNKNOWN
Walt Ogburn
reuben at ugcs.caltech.edu
Sat Oct 8 13:00:16 CDT 2005
Changelog:
When DispGetIDsOfNames can't match anything to a given
name, fill it with DISPID_UNKNOWN.
Test is in next patch.
-------------- next part --------------
Index: dlls/oleaut32/typelib.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/typelib.c,v
retrieving revision 1.170
diff -u -p -r1.170 typelib.c
--- dlls/oleaut32/typelib.c 21 Sep 2005 09:46:28 -0000 1.170
+++ dlls/oleaut32/typelib.c 8 Oct 2005 17:39:25 -0000
@@ -4416,6 +4416,7 @@ static HRESULT WINAPI ITypeInfo_fnGetIDs
TLBFuncDesc * pFDesc;
TLBVarDesc * pVDesc;
HRESULT ret=S_OK;
+ int k;
TRACE("(%p) Name %s cNames %d\n", This, debugstr_w(*rgszNames),
cNames);
@@ -4429,19 +4430,25 @@ static HRESULT WINAPI ITypeInfo_fnGetIDs
break;
if( j<pFDesc->funcdesc.cParams)
pMemId[i]=j;
- else
- ret=DISP_E_UNKNOWNNAME;
+ else {
+ pMemId[i]=DISPID_UNKNOWN;
+ ret=DISP_E_UNKNOWNNAME;
+ }
};
+ FIXME("Got first name, returning 0x%08lx.\n", ret);
return ret;
}
}
for(pVDesc=This->varlist; pVDesc; pVDesc=pVDesc->next) {
if(!lstrcmpiW(*rgszNames, pVDesc->Name)) {
if(cNames) *pMemId=pVDesc->vardesc.memid;
+ /* Extra names get DISPID_UNKNOWN, but don't affect return val. */
+ for (k=1; k < cNames; k++)
+ pMemId[k]=DISPID_UNKNOWN;
return ret;
}
}
- /* not found, see if this is and interface with an inheritance */
+ /* not found, see if this is an interface with an inheritance */
if(This->TypeAttr.cImplTypes &&
(This->TypeAttr.typekind==TKIND_INTERFACE || This->TypeAttr.typekind==TKIND_DISPATCH)) {
/* recursive search */
@@ -4456,6 +4463,10 @@ static HRESULT WINAPI ITypeInfo_fnGetIDs
WARN("Could not search inherited interface!\n");
} else
WARN("no names found\n");
+
+ /* No names found, set all to DISPID_UNKNOWN. */
+ for (k=0; k < cNames; k++)
+ pMemId[k]=DISPID_UNKNOWN;
return DISP_E_UNKNOWNNAME;
}
More information about the wine-patches
mailing list