Commit 17fca45d authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

oleaut32: Interfaces that derive from IDispatch should be marshaled as VT_DISPATCH.

parent 102a0a3b
......@@ -515,6 +515,15 @@ HRESULT WINAPI Widget_Error(
return E_NOTIMPL;
}
HRESULT WINAPI Widget_CloneInterface(
IWidget __RPC_FAR * iface,
ISomethingFromDispatch **ppVal)
{
trace("CloneInterface()\n");
*ppVal = 0;
return S_OK;
}
static const struct IWidgetVtbl Widget_VTable =
{
Widget_QueryInterface,
......@@ -540,7 +549,8 @@ static const struct IWidgetVtbl Widget_VTable =
Widget_VariantArrayPtr,
Widget_Variant,
Widget_VarArg,
Widget_Error
Widget_Error,
Widget_CloneInterface
};
......@@ -914,6 +924,18 @@ static void test_typelibmarshal(void)
VariantInit(&varresult);
hr = IDispatch_Invoke(pDispatch, DISPID_TM_CLONE, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYGET, &dispparams, &varresult, &excepinfo, NULL);
ok_ole_success(hr, IDispatch_Invoke);
ok(V_VT(&varresult) == VT_DISPATCH, "vt %x\n", V_VT(&varresult));
VariantClear(&varresult);
/* call CloneInterface */
dispparams.cNamedArgs = 0;
dispparams.cArgs = 0;
dispparams.rgdispidNamedArgs = NULL;
dispparams.rgvarg = NULL;
VariantInit(&varresult);
hr = IDispatch_Invoke(pDispatch, DISPID_TM_CLONEINTERFACE, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYGET, &dispparams, &varresult, &excepinfo, NULL);
ok_ole_success(hr, IDispatch_Invoke);
ok(V_VT(&varresult) == VT_DISPATCH, "vt %x\n", V_VT(&varresult));
VariantClear(&varresult);
/* call CloneDispatch with automatic value getting */
......
......@@ -39,6 +39,15 @@ library TestTypelib
[
odl,
uuid(12345678-1234-4321-1234-121212121212)
]
interface ISomethingFromDispatch : IDispatch
{
HRESULT anotherfn(void);
}
[
odl,
uuid(a1f8cae3-c947-4c5f-b57d-c87b9b5f3586),
oleautomation,
dual
......@@ -93,6 +102,10 @@ library TestTypelib
[id(DISPID_TM_ERROR)]
HRESULT Error();
[propget, id(DISPID_TM_CLONEINTERFACE)]
HRESULT CloneInterface([out, retval] ISomethingFromDispatch **ppVal);
}
[
......
......@@ -31,5 +31,6 @@
#define DISPID_TM_VARIANT 12
#define DISPID_TM_VARARG 13
#define DISPID_TM_ERROR 14
#define DISPID_TM_CLONEINTERFACE 15
#define DISPID_NOA_BSTRRET 1
......@@ -5307,7 +5307,7 @@ static HRESULT userdefined_to_variantvt(ITypeInfo *tinfo, const TYPEDESC *tdesc,
break;
case TKIND_INTERFACE:
if (IsEqualIID(&IID_IDispatch, &tattr->guid))
if (tattr->wTypeFlags & TYPEFLAG_FDISPATCHABLE)
*vt |= VT_DISPATCH;
else
*vt |= VT_UNKNOWN;
......
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