[PATCH 2/2 resend] oleaut32: Fix rewriting FUNCDESC to FUNC_DISPATCH.

Huw Davies huw at codeweavers.com
Mon Sep 21 05:54:55 CDT 2020


On Fri, Sep 18, 2020 at 09:38:24PM -0500, Kevin Puetz wrote:
> A [retval] parameter overwrites any return type, not just HRESULT.
> But HRESULT is special even without a [retval] to replace it;
> it's translated into pExcepInfo and so the return type becomes void.
> 
> [lcid] parameters are supplied from IDispatch::Invoke's parameters,
> rather than via DISPPARAMS::rgvargs[] and should also be removed
> from the FUNC_DISPATCH translation.
> 
> This rewriting should occur only for functions not originally
> defined as FUNC_DISPACH (e.g. inherited or [dual]).
> A FUNCDESC originally declared as a dispinterface is left as-is,
> and might e.g. return HRESULT.
> 
> When GetFuncDesc removes parameters in this fashion,
> GetNames must also omit their names to match cParams.
> 
> FUNC_DISPATCH from dispinterface should have oVft == 0
> (a dispinterface has no vtbl beyond IDispatch itself)
> 
> Add examples in test_tlb which exercise FUNCDESC rewriting in:
> 1. dispinterface FUNC_DISPATCH declarations
> 2. dual interface
> 3. dispinterface which implements another interface

There are several things changing in this patch, please could you
split them up?  In addition to making the patch easier to review and
easier to fix regressions, splitting the patch will enable more
meaningful commit subject lines to be written.

> -/* ITypeInfo_GetNames
> - *
> - * Retrieves the variable with the specified member ID (or the name of the
> - * property or method and its parameters) that correspond to the specified
> - * function ID.
> - */
> -static HRESULT WINAPI ITypeInfo_fnGetNames( ITypeInfo2 *iface, MEMBERID memid,
> -        BSTR  *rgBstrNames, UINT cMaxNames, UINT  *pcNames)
> +/* internal function to make the inherited interfaces' methods appear
> + * part of the interface, remembering if the top-level was dispinterface */
> +static HRESULT ITypeInfoImpl_GetNames( ITypeInfo *iface,

typeinfo_getnames() might be a better name for this helper,
it's less likely to be confused with ITypeInfo_fnGetNames.

Huw.



More information about the wine-devel mailing list