From 89a1dade805debfe558b5a0366cde9c75612d2a8 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 7 Nov 2018 16:14:56 +0100 Subject: [PATCH] widl: Support async interfaces proxy. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- tools/widl/proxy.c | 19 ++++++++++++++++--- tools/widl/typegen.c | 3 +++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c index 12424d9eab4..a6c3c32268e 100644 --- a/tools/widl/proxy.c +++ b/tools/widl/proxy.c @@ -736,7 +736,9 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset) print_proxy( "},\n"); print_proxy( "{\n"); indent++; - print_proxy( "CStdStubBuffer_%s\n", need_delegation_indirect(iface) ? "DELEGATING_METHODS" : "METHODS"); + print_proxy( "%s_%s\n", + iface->details.iface->async_iface == iface ? "CStdAsyncStubBuffer" : "CStdStubBuffer", + need_delegation_indirect(iface) ? "DELEGATING_METHODS" : "METHODS"); indent--; print_proxy( "}\n"); indent--; @@ -832,8 +834,13 @@ static void write_proxy_stmts(const statement_list_t *stmts, unsigned int *proc_ { if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE) { - if (need_proxy(stmt->u.type)) - write_proxy(stmt->u.type, proc_offset); + type_t *iface = stmt->u.type; + if (need_proxy(iface)) + { + write_proxy(iface, proc_offset); + if (iface->details.iface->async_iface) + write_proxy(iface->details.iface->async_iface, proc_offset); + } } } } @@ -861,6 +868,12 @@ static void build_iface_list( const statement_list_t *stmts, type_t **ifaces[], { *ifaces = xrealloc( *ifaces, (*count + 1) * sizeof(**ifaces) ); (*ifaces)[(*count)++] = iface; + if (iface->details.iface->async_iface) + { + iface = iface->details.iface->async_iface; + *ifaces = xrealloc( *ifaces, (*count + 1) * sizeof(**ifaces) ); + (*ifaces)[(*count)++] = iface; + } } } } diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 10e6ebab244..8b23c631840 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -1381,6 +1381,7 @@ static void write_proc_func_header( FILE *file, int indent, const type_t *iface, if (is_attr( func->attrs, ATTR_NOTIFY )) ext_flags |= 0x08; /* HasNotify */ if (is_attr( func->attrs, ATTR_NOTIFYFLAG )) ext_flags |= 0x10; /* HasNotify2 */ + if (iface == iface->details.iface->async_iface) oi2_flags |= 0x20; size = get_function_buffer_size( func, PASS_IN ); print_file( file, indent, "NdrFcShort(0x%x),\t/* client buffer = %u */\n", size, size ); @@ -1479,6 +1480,8 @@ static void for_each_iface(const statement_list_t *stmts, iface = stmt->u.type; if (!pred(iface)) continue; proc(iface, file, indent, offset); + if (iface->details.iface->async_iface) + proc(iface->details.iface->async_iface, file, indent, offset); } }