[PATCH] rpcrt4: Fix getting underlying typeinfo of IDispatch.

Zebediah Figura z.figura12 at gmail.com
Mon Jun 15 09:40:49 CDT 2020


On 6/14/20 10:14 PM, Porot Mo wrote:
> From: Porot Mo <porotmjp at gmail.com>
> Subject: [PATCH] rpcrt4: Fix getting underlying typeinfo of IDispatch.
> Message-Id: <CANeTpuED1rz3tizQsZNvffGku-DoH_hKq0gjzbWyfGZpmVzgAg at mail.gmail.com>
> Date: Mon, 15 Jun 2020 11:14:55 +0800
> 
> Signed-off-by: Porot Mo <porotmjp at gmail.com>
> ---

The commit message here could be more specific (in general, "fix X" is 
never a great message).

>  dlls/rpcrt4/ndr_typelib.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> <div dir="ltr">Signed-off-by: Porot Mo <<a href="mailto:porotmjp at gmail.com">porotmjp at gmail.com</a>><br>---<br> dlls/rpcrt4/ndr_typelib.c | 8 +++++++-<br> 1 file changed, 7 insertions(+), 1 deletion(-)<br></div>
> 
> diff --git a/dlls/rpcrt4/ndr_typelib.c b/dlls/rpcrt4/ndr_typelib.c
> index f1f2588..9365e0b 100644
> --- a/dlls/rpcrt4/ndr_typelib.c
> +++ b/dlls/rpcrt4/ndr_typelib.c
> @@ -1229,6 +1229,7 @@ static HRESULT get_iface_info(ITypeInfo *typeinfo, WORD *funcs, WORD *parentfunc
>      HREFTYPE reftype;
>      SYSKIND syskind;
>      HRESULT hr;
> +    WORD typeflags;
>  
>      /* Dual interfaces report their size to be sizeof(IDispatchVtbl) and their
>       * implemented type to be IDispatch. We need to retrieve the underlying
> @@ -1237,10 +1238,15 @@ static HRESULT get_iface_info(ITypeInfo *typeinfo, WORD *funcs, WORD *parentfunc
>      if (FAILED(hr))
>          return hr;
>      typekind = typeattr->typekind;
> +    typeflags = typeattr->wTypeFlags;
>      ITypeInfo_ReleaseTypeAttr(typeinfo, typeattr);
>      if (typekind == TKIND_DISPATCH)
>      {
> -        hr = ITypeInfo_GetRefTypeOfImplType(typeinfo, -1, &reftype);
> +        if (typeflags & TYPEFLAG_FDUAL)
> +            hr = ITypeInfo_GetRefTypeOfImplType(typeinfo, -1, &reftype);
> +        else
> +            hr = ITypeInfo_GetRefTypeOfImplType(typeinfo, 0, &reftype);
> +
>          if (FAILED(hr))
>              return hr;
>  
> 

How are you getting here? I don't think a non-dual dispinterface should 
go through the typelib marshaller in the first place; it should use the 
IDispatch proxy. See e.g. dispatch_typelib_ps_CreateProxy().



More information about the wine-devel mailing list