Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/oleaut32/typelib.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index ac326afe1a1..fb49cd303fe 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -7273,6 +7273,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( VARIANTARG **prgpvarg = INVBUF_GET_ARG_PTR_ARRAY(buffer, func_desc->cParams); VARIANTARG *rgvarg = INVBUF_GET_ARG_ARRAY(buffer, func_desc->cParams); VARTYPE *rgvt = INVBUF_GET_ARG_TYPE_ARRAY(buffer, func_desc->cParams); + VARIANTARG *missing_arg = INVBUF_GET_MISSING_ARG_ARRAY(buffer, func_desc->cParams); UINT cNamedArgs = pDispParams->cNamedArgs; DISPID *rgdispidNamedArgs = pDispParams->rgdispidNamedArgs; UINT vargs_converted=0; @@ -7387,7 +7388,6 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( V_VARIANTREF(&rgvarg[i]) = V_VARIANTREF(src_arg); else { - VARIANTARG *missing_arg = INVBUF_GET_MISSING_ARG_ARRAY(buffer, func_desc->cParams); if (wParamFlags & PARAMFLAG_FIN) hres = VariantCopy(&missing_arg[i], src_arg); V_VARIANTREF(&rgvarg[i]) = &missing_arg[i]; @@ -7430,7 +7430,6 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( } else if ((rgvt[i] & VT_BYREF) && !V_ISBYREF(src_arg)) { - VARIANTARG *missing_arg = INVBUF_GET_MISSING_ARG_ARRAY(buffer, func_desc->cParams); if (wParamFlags & PARAMFLAG_FIN) hres = VariantChangeType(&missing_arg[i], src_arg, 0, rgvt[i] & ~VT_BYREF); else @@ -7500,20 +7499,22 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( } else { - VARIANTARG *missing_arg; /* if the function wants a pointer to a variant then * set that up, otherwise just pass the VT_ERROR in * the argument by value */ if (rgvt[i] & VT_BYREF) { - missing_arg = INVBUF_GET_MISSING_ARG_ARRAY(buffer, func_desc->cParams) + i; + V_VT(&missing_arg[i]) = VT_ERROR; + V_ERROR(&missing_arg[i]) = DISP_E_PARAMNOTFOUND; + V_VT(arg) = VT_VARIANT | VT_BYREF; - V_VARIANTREF(arg) = missing_arg; + V_VARIANTREF(arg) = &missing_arg[i]; } else - missing_arg = arg; - V_VT(missing_arg) = VT_ERROR; - V_ERROR(missing_arg) = DISP_E_PARAMNOTFOUND; + { + V_VT(arg) = VT_ERROR; + V_ERROR(arg) = DISP_E_PARAMNOTFOUND; + } } } else @@ -7544,7 +7545,6 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( for (i = 0; i < func_desc->cParams; i++) { USHORT wParamFlags = func_desc->lprgelemdescParam[i].u.paramdesc.wParamFlags; - VARIANTARG *missing_arg = INVBUF_GET_MISSING_ARG_ARRAY(buffer, func_desc->cParams);
if (wParamFlags & PARAMFLAG_FLCID) continue;