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( ...@@ -7273,6 +7273,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
VARIANTARG **prgpvarg = INVBUF_GET_ARG_PTR_ARRAY(buffer, func_desc->cParams); VARIANTARG **prgpvarg = INVBUF_GET_ARG_PTR_ARRAY(buffer, func_desc->cParams);
VARIANTARG *rgvarg = INVBUF_GET_ARG_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); 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; UINT cNamedArgs = pDispParams->cNamedArgs;
DISPID *rgdispidNamedArgs = pDispParams->rgdispidNamedArgs; DISPID *rgdispidNamedArgs = pDispParams->rgdispidNamedArgs;
UINT vargs_converted=0; UINT vargs_converted=0;
...@@ -7387,7 +7388,6 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( ...@@ -7387,7 +7388,6 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
V_VARIANTREF(&rgvarg[i]) = V_VARIANTREF(src_arg); V_VARIANTREF(&rgvarg[i]) = V_VARIANTREF(src_arg);
else else
{ {
VARIANTARG *missing_arg = INVBUF_GET_MISSING_ARG_ARRAY(buffer, func_desc->cParams);
if (wParamFlags & PARAMFLAG_FIN) if (wParamFlags & PARAMFLAG_FIN)
hres = VariantCopy(&missing_arg[i], src_arg); hres = VariantCopy(&missing_arg[i], src_arg);
V_VARIANTREF(&rgvarg[i]) = &missing_arg[i]; V_VARIANTREF(&rgvarg[i]) = &missing_arg[i];
...@@ -7430,7 +7430,6 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( ...@@ -7430,7 +7430,6 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
} }
else if ((rgvt[i] & VT_BYREF) && !V_ISBYREF(src_arg)) 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) if (wParamFlags & PARAMFLAG_FIN)
hres = VariantChangeType(&missing_arg[i], src_arg, 0, rgvt[i] & ~VT_BYREF); hres = VariantChangeType(&missing_arg[i], src_arg, 0, rgvt[i] & ~VT_BYREF);
else else
...@@ -7500,20 +7499,22 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( ...@@ -7500,20 +7499,22 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
} }
else else
{ {
VARIANTARG *missing_arg;
/* if the function wants a pointer to a variant then /* if the function wants a pointer to a variant then
* set that up, otherwise just pass the VT_ERROR in * set that up, otherwise just pass the VT_ERROR in
* the argument by value */ * the argument by value */
if (rgvt[i] & VT_BYREF) 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_VT(arg) = VT_VARIANT | VT_BYREF;
V_VARIANTREF(arg) = missing_arg; V_VARIANTREF(arg) = &missing_arg[i];
} }
else else
missing_arg = arg; {
V_VT(missing_arg) = VT_ERROR; V_VT(arg) = VT_ERROR;
V_ERROR(missing_arg) = DISP_E_PARAMNOTFOUND; V_ERROR(arg) = DISP_E_PARAMNOTFOUND;
}
} }
} }
else else
...@@ -7544,7 +7545,6 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( ...@@ -7544,7 +7545,6 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
for (i = 0; i < func_desc->cParams; i++) for (i = 0; i < func_desc->cParams; i++)
{ {
USHORT wParamFlags = func_desc->lprgelemdescParam[i].u.paramdesc.wParamFlags; 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) if (wParamFlags & PARAMFLAG_FLCID)
continue; 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