Module: wine Branch: master Commit: 94f4b49d78f8b17bfd95826c653b7513dc1522b9 URL: https://source.winehq.org/git/wine.git/?a=commit;h=94f4b49d78f8b17bfd95826c6...
Author: Zebediah Figura z.figura12@gmail.com Date: Wed Nov 14 08:48:01 2018 -0600
oleaut32: Handle coclasses in ITypeInfo_Invoke().
Based on a patch by Sebastian Lackner.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39799 Signed-off-by: Zebediah Figura z.figura12@gmail.com Signed-off-by: Huw Davies huw@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/oleaut32/tests/tmarshal.c | 2 +- dlls/oleaut32/typelib.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/dlls/oleaut32/tests/tmarshal.c b/dlls/oleaut32/tests/tmarshal.c index 4049d19..e1564d5 100644 --- a/dlls/oleaut32/tests/tmarshal.c +++ b/dlls/oleaut32/tests/tmarshal.c @@ -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); diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 6474b51..f32bed3 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -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;