Jacek Caban : widl: Support async interfaces proxy.
Alexandre Julliard
julliard at winehq.org
Wed Nov 7 14:47:32 CST 2018
Module: wine
Branch: master
Commit: 89a1dade805debfe558b5a0366cde9c75612d2a8
URL: https://source.winehq.org/git/wine.git/?a=commit;h=89a1dade805debfe558b5a0366cde9c75612d2a8
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Nov 7 16:14:56 2018 +0100
widl: Support async interfaces proxy.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 12424d9..a6c3c32 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 10e6eba..8b23c63 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);
}
}
More information about the wine-cvs
mailing list