Commit 5edc7fd5 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

oleaut32: TKIND_COCLASS parameters to Invoke'd functions should be converted…

oleaut32: TKIND_COCLASS parameters to Invoke'd functions should be converted into VT_DISPATCH instead of VT_UNKNOWN. Add a test for this.
parent 3d6070ae
......@@ -433,7 +433,7 @@ HRESULT WINAPI Widget_CloneCoclass(
IWidget *iface,
ApplicationObject2 **ppVal)
{
trace("CloneDispatch()\n");
trace("CloneCoclass()\n");
return S_OK;
}
......@@ -902,6 +902,23 @@ static void test_typelibmarshal(void)
ok(V_I2(&varresult) == 1234, "V_I2(&varresult) was %d instead of 1234\n", V_I2(&varresult));
VariantClear(&varresult);
/* call CloneCoclass */
dispparams.cNamedArgs = 0;
dispparams.cArgs = 0;
dispparams.rgdispidNamedArgs = NULL;
dispparams.rgvarg = NULL;
VariantInit(&varresult);
hr = IDispatch_Invoke(pDispatch, DISPID_TM_CLONECOCLASS, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYGET, &dispparams, &varresult, &excepinfo, NULL);
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);
ok(V_VT(&varresult) == VT_DISPATCH, "V_VT(&varresult) was %d instead of VT_DISPATCH\n", V_VT(&varresult));
ok(!V_DISPATCH(&varresult), "V_DISPATCH(&varresult) should be NULL instead of %p\n", V_DISPATCH(&varresult));
VariantClear(&varresult);
/* call Value with a VT_VARIANT|VT_BYREF type */
V_VT(&vararg[0]) = VT_VARIANT|VT_BYREF;
V_VARIANTREF(&vararg[0]) = &vararg[1];
......
......@@ -5213,7 +5213,7 @@ static HRESULT userdefined_to_variantvt(ITypeInfo *tinfo, const TYPEDESC *tdesc,
break;
case TKIND_COCLASS:
*vt |= VT_UNKNOWN;
*vt |= VT_DISPATCH;
break;
case TKIND_RECORD:
......
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