From 702e2c6dc2cb597c2d5263eec3ac021029d27074 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Tue, 6 Feb 2007 19:24:51 +0000 Subject: [PATCH] oleaut32: Copy the value directly returned from the called function if it is not an HRESULT value, instead of getting it from a [retval] attribute. --- dlls/oleaut32/tests/tmarshal.c | 5 +---- dlls/oleaut32/typelib.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dlls/oleaut32/tests/tmarshal.c b/dlls/oleaut32/tests/tmarshal.c index 933dd6bd9a5..833c9dddd5a 100644 --- a/dlls/oleaut32/tests/tmarshal.c +++ b/dlls/oleaut32/tests/tmarshal.c @@ -998,10 +998,7 @@ static void test_typelibmarshal(void) VariantInit(&varresult); hr = ITypeInfo_Invoke(pTypeInfo, &NonOleAutomation, DISPID_NOA_BSTRRET, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL); ok_ole_success(hr, ITypeInfo_Invoke); - todo_wine - { - ok(V_VT(&varresult) == VT_BSTR, "V_VT(&varresult) should be VT_BSTR instead of %d\n", V_VT(&varresult)); - } + ok(V_VT(&varresult) == VT_BSTR, "V_VT(&varresult) should be VT_BSTR instead of %d\n", V_VT(&varresult)); ok(V_BSTR(&varresult) != NULL, "V_BSTR(&varresult) should not be NULL\n"); VariantClear(&varresult); diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 8cd4a7964de..f61f4601a74 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -5689,6 +5689,19 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( } } } + if (V_VT(&varresult) != VT_ERROR) + { + TRACE("varresult value: "); + dump_Variant(&varresult); + + if (pVarResult) + { + VariantClear(pVarResult); + *pVarResult = varresult; + } + else + VariantClear(&varresult); + } func_fail: HeapFree(GetProcessHeap(), 0, buffer);