[v2 PATCH] widl: Only generate Proxy Stubs when functions have the call_as attribute

Huw Davies huw at codeweavers.com
Mon Jul 10 06:01:02 CDT 2017


On Mon, Jul 10, 2017 at 10:11:42AM +0000, Alistair Leslie-Hughes wrote:
> Fixes: https://bugs.winehq.org/show_bug.cgi?id=43302
> 
> v2: Merge two matches together.
> 
> Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
> ---
>  include/unknwn.idl  | 10 ++++++++++
>  tools/widl/header.c |  2 +-
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/include/unknwn.idl b/include/unknwn.idl
> index 78a2d9db18..7856a7f504 100644
> --- a/include/unknwn.idl
> +++ b/include/unknwn.idl
> @@ -46,6 +46,16 @@ interface IUnknown
>    ULONG Release();
>  }
>  
> +cpp_quote("HRESULT STDMETHODCALLTYPE IUnknown_QueryInterface_Proxy(IUnknown* This, REFIID riid, void **ppvObject);")
> +cpp_quote("void __RPC_STUB IUnknown_QueryInterface_Stub(IRpcStubBuffer* This, IRpcChannelBuffer* pRpcChannelBuffer,")
> +cpp_quote("     PRPC_MESSAGE pRpcMessage, DWORD* pdwStubPhase);")
> +cpp_quote("ULONG STDMETHODCALLTYPE IUnknown_AddRef_Proxy(IUnknown* This);")
> +cpp_quote("void __RPC_STUB IUnknown_AddRef_Stub(IRpcStubBuffer* This, IRpcChannelBuffer* pRpcChannelBuffer,")
> +cpp_quote("     PRPC_MESSAGE pRpcMessage, DWORD* pdwStubPhase);")
> +cpp_quote("ULONG STDMETHODCALLTYPE IUnknown_Release_Proxy(IUnknown* This);")
> +cpp_quote("void __RPC_STUB IUnknown_Release_Stub(IRpcStubBuffer* This, IRpcChannelBuffer* pRpcChannelBuffer,")
> +cpp_quote("     PRPC_MESSAGE pRpcMessage, DWORD* pdwStubPhase);")
> +
>  cpp_quote("#ifdef SAVE_WIDL_C_INLINE_WRAPPERS")
>  cpp_quote("#define WIDL_C_INLINE_WRAPPERS")
>  cpp_quote("#endif")
> diff --git a/tools/widl/header.c b/tools/widl/header.c
> index 7b971582db..e48b488ae3 100644
> --- a/tools/widl/header.c
> +++ b/tools/widl/header.c
> @@ -1172,7 +1172,7 @@ static void write_method_proto(FILE *header, const type_t *iface)
>    {
>      const var_t *func = stmt->u.var;
>  
> -    if (!is_local(func->attrs)) {
> +    if (is_callas(func->attrs)) {
>        const char *callconv = get_attrp(func->type->attrs, ATTR_CALLCONV);
>        if (!callconv) callconv = "STDMETHODCALLTYPE";
>        /* proxy prototype */

On further testing with midl v7, /Os does emit Proxy/Stub prototypes
for all functions.  Since widl essentially runs in this mode, I'd
prefer to keep this behaviour if possible.

In the bug you mention redefinition errors in qmgrprxy.  How are you
getting these?

Huw.



More information about the wine-devel mailing list