From f9c9a2bf3d97bfecc1f3ab8edf4ccb3f5e5d3133 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Thu, 13 Jul 2006 13:07:36 +0100 Subject: [PATCH] oleaut32: Convert void return types to the VT_EMPTY variant type in ITypeInfo::Invoke. --- dlls/oleaut32/typelib.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index ccb58293e3d..d539cd6cadc 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -5363,9 +5363,16 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( goto func_fail; /* FIXME: we don't free changed types here */ } - V_VT(&varresult) = 0; - hres = typedescvt_to_variantvt((ITypeInfo *)iface, &func_desc->elemdescFunc.tdesc, &V_VT(&varresult)); - if (FAILED(hres)) goto func_fail; /* FIXME: we don't free changed types here */ + /* VT_VOID is a special case for return types, so it is not + * handled in the general function */ + if (func_desc->elemdescFunc.tdesc.vt == VT_VOID) + V_VT(&varresult) = VT_EMPTY; + else + { + V_VT(&varresult) = 0; + hres = typedescvt_to_variantvt((ITypeInfo *)iface, &func_desc->elemdescFunc.tdesc, &V_VT(&varresult)); + if (FAILED(hres)) goto func_fail; /* FIXME: we don't free changed types here */ + } hres = DispCallFunc(pIUnk, func_desc->oVft, func_desc->callconv, V_VT(&varresult), func_desc->cParams, rgvt,