Rob Shearman : oleaut32: TKIND_COCLASS parameters to Invoke'
d functions should be converted into VT_DISPATCH instead of VT_UNKNOWN.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Mar 8 07:17:12 CST 2007
Module: wine
Branch: master
Commit: 5edc7fd5eff131f42883c616a4df1425b54f1969
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5edc7fd5eff131f42883c616a4df1425b54f1969
Author: Rob Shearman <rob at codeweavers.com>
Date: Thu Mar 8 11:01:44 2007 +0000
oleaut32: TKIND_COCLASS parameters to Invoke'd functions should be converted into VT_DISPATCH instead of VT_UNKNOWN.
Add a test for this.
---
dlls/oleaut32/tests/tmarshal.c | 19 ++++++++++++++++++-
dlls/oleaut32/typelib.c | 2 +-
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/dlls/oleaut32/tests/tmarshal.c b/dlls/oleaut32/tests/tmarshal.c
index 2393a93..22d2245 100644
--- a/dlls/oleaut32/tests/tmarshal.c
+++ b/dlls/oleaut32/tests/tmarshal.c
@@ -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];
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index d75e7bc..50b2928 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -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:
More information about the wine-cvs
mailing list