Commit 3b2db03d authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

oleaut32: Use single local variable to access missing args array in Invoke().

parent 5b04eacf
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment