From: Kevin Puetz Subject: [PATCH v2 4/6] oleaut32: omit [lcid] parameter when rewriting FUNCDESC to FUNC_DISPATCH. Message-Id: <20200921141722.2300-4-PuetzKevinA@JohnDeere.com> Date: Mon, 21 Sep 2020 09:17:20 -0500 In-Reply-To: <20200921141722.2300-1-PuetzKevinA@JohnDeere.com> References: <20200921141722.2300-1-PuetzKevinA@JohnDeere.com> [lcid] parameters are supplied from IDispatch::Invoke's parameters, rather than via DISPPARAMS::rgvargs[] and should also be removed from the FUNC_DISPATCH translation. Signed-off-by: Kevin Puetz --- dlls/oleaut32/typelib.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 2c9b4ac5eb..13ccb6041a 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -5890,6 +5890,14 @@ static HRESULT TLB_AllocAndInitFuncDesc( const FUNCDESC *src, FUNCDESC **dest_pt * So the function signature should show no return value. */ dest->elemdescFunc.tdesc.vt = VT_VOID; + /* The now-last (except [retval], removed above) parameter might be labeled [lcid]. + * If so it will be supplied from Invoke(lcid), so also not via DISPPARAMS::rgvarg */ + if (dest->cParams && + (dest->lprgelemdescParam[dest->cParams - 1].u.paramdesc.wParamFlags & PARAMFLAG_FLCID)) + { + /* remove the last parameter */ + dest->cParams--; + } } *dest_ptr = dest;