DispGetIDsOfNames: return DISPID_UNKNOWN
Walt Ogburn
reuben at ugcs.caltech.edu
Tue Sep 13 21:58:27 CDT 2005
Sorry! Forgot the patch again!
---------- Forwarded message ----------
Date: Tue, 13 Sep 2005 19:56:23 -0700 (PDT)
From: Walt Ogburn <reuben at ugcs.caltech.edu>
To: wine-patches at winehq.org
Subject: DispGetIDsOfNames: return DISPID_UNKNOWN
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.168
diff -u -p -r1.168 typelib.c
--- dlls/oleaut32/typelib.c 9 Sep 2005 10:19:45 -0000 1.168
+++ dlls/oleaut32/typelib.c 14 Sep 2005 01:26:03 -0000
@@ -4404,6 +4404,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);
@@ -4417,19 +4418,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 */
@@ -4444,6 +4451,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