widl: Support async interfaces proxy.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Jacek Caban 2018-11-07 16:14:56 +01:00 committed by Alexandre Julliard
parent 3a8dbbb634
commit 89a1dade80
2 changed files with 19 additions and 3 deletions

View File

@ -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;
}
}
}
}

View File

@ -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);
}
}