From 585763ffa91ba10291e2a2eff27b7dd8fd623611 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Mon, 5 Jun 2006 17:48:15 -0500 Subject: [PATCH] oleaut32: Only BYREF DispCallFunc args whose input args are not BYREF should be changed. --- dlls/oleaut32/typelib.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index c4b2f5688b..21c69a9abb 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -5360,9 +5360,11 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( { if (wParamFlags & PARAMFLAG_FOUT) { - hres = VariantChangeType(&pDispParams->rgvarg[pDispParams->cArgs - 1 - i], - &rgvarg[i], 0, - V_VT(&pDispParams->rgvarg[pDispParams->cArgs - 1 - i])); + VARIANTARG *arg = &pDispParams->rgvarg[pDispParams->cArgs - 1 - i]; + + if ((rgvt[i] == VT_BYREF) && (V_VT(arg) != VT_BYREF)) + hres = VariantChangeType(arg, &rgvarg[i], 0, V_VT(arg)); + if (FAILED(hres)) { ERR("failed to convert param %d to vt %d\n", i,