Commit 94f4b49d authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

oleaut32: Handle coclasses in ITypeInfo_Invoke().

Based on a patch by Sebastian Lackner. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39799Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent ab6d4a9d
......@@ -2591,7 +2591,7 @@ static void test_typelibmarshal(void)
dispparams.rgvarg = vararg;
VariantInit(&varresult);
hr = IDispatch_Invoke(pDispatch, DISPID_TM_COCLASS, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
todo_wine ok_ole_success(hr, IDispatch_Invoke);
ok_ole_success(hr, IDispatch_Invoke);
ok(excepinfo.wCode == 0x0 && excepinfo.scode == S_OK,
"EXCEPINFO differs from expected: wCode = 0x%x, scode = 0x%08x\n",
excepinfo.wCode, excepinfo.scode);
......
......@@ -6572,6 +6572,7 @@ static HRESULT get_iface_guid(ITypeInfo *tinfo, HREFTYPE href, GUID *guid)
ITypeInfo *tinfo2;
TYPEATTR *tattr;
HRESULT hres;
int flags, i;
hres = ITypeInfo_GetRefTypeInfo(tinfo, href, &tinfo2);
if(FAILED(hres))
......@@ -6593,6 +6594,22 @@ static HRESULT get_iface_guid(ITypeInfo *tinfo, HREFTYPE href, GUID *guid)
*guid = tattr->guid;
break;
case TKIND_COCLASS:
for (i = 0; i < tattr->cImplTypes; i++)
{
ITypeInfo_GetImplTypeFlags(tinfo2, i, &flags);
if (flags & IMPLTYPEFLAG_FDEFAULT)
break;
}
if (i == tattr->cImplTypes)
i = 0;
hres = ITypeInfo_GetRefTypeOfImplType(tinfo2, i, &href);
if (SUCCEEDED(hres))
hres = get_iface_guid(tinfo2, href, guid);
break;
default:
ERR("Unexpected typekind %d\n", tattr->typekind);
hres = E_UNEXPECTED;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment