Commit 56995dd3 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

widl: Output a registry script for all interfaces written into the typelib.

parent 82044449
......@@ -1792,6 +1792,7 @@ static type_t *make_safearray(type_t *type)
static typelib_t *make_library(const char *name, const attr_list_t *attrs)
{
typelib_t *typelib = xmalloc(sizeof(*typelib));
memset(typelib, 0, sizeof(*typelib));
typelib->name = xstrdup(name);
typelib->attrs = attrs;
list_init( &typelib->importlibs );
......
......@@ -119,8 +119,6 @@ static void write_typelib_interface( const type_t *iface, const typelib_t *typel
if (!uuid) return;
if (!is_object( iface )) return;
if (!is_attr( iface->attrs, ATTR_OLEAUTOMATION ) && !is_attr( iface->attrs, ATTR_DISPINTERFACE ))
return;
put_str( indent, "'%s' = s '%s'\n", format_uuid( uuid ), iface->name );
put_str( indent, "{\n" );
indent++;
......@@ -137,13 +135,10 @@ static void write_typelib_interface( const type_t *iface, const typelib_t *typel
static void write_typelib_interfaces( const typelib_t *typelib )
{
const statement_t *stmt;
unsigned int i;
if (typelib->stmts) LIST_FOR_EACH_ENTRY( stmt, typelib->stmts, const statement_t, entry )
{
if (stmt->type == STMT_TYPE && type_get_type( stmt->u.type ) == TYPE_INTERFACE)
write_typelib_interface( stmt->u.type, typelib );
}
for (i = 0; i < typelib->reg_iface_count; ++i)
write_typelib_interface( typelib->reg_ifaces[i], typelib );
}
static int write_coclass( const type_t *class, const typelib_t *typelib )
......
......@@ -538,6 +538,9 @@ struct _typelib_t {
const attr_list_t *attrs;
struct list importlibs;
statement_list_t *stmts;
type_t **reg_ifaces;
unsigned int reg_iface_count;
};
struct _user_type_t {
......
......@@ -2068,6 +2068,10 @@ static void add_dispinterface_typeinfo(msft_typelib_t *typelib, type_t *dispinte
if(add_func_desc(msft_typeinfo, func, idx) == S_OK)
idx++;
}
typelib->typelib->reg_ifaces = xrealloc(typelib->typelib->reg_ifaces,
(typelib->typelib->reg_iface_count + 1) * sizeof(dispinterface));
typelib->typelib->reg_ifaces[typelib->typelib->reg_iface_count++] = dispinterface;
}
static void add_interface_typeinfo(msft_typelib_t *typelib, type_t *interface)
......@@ -2142,6 +2146,13 @@ static void add_interface_typeinfo(msft_typelib_t *typelib, type_t *interface)
if(add_func_desc(msft_typeinfo, func, idx) == S_OK)
idx++;
}
if (is_attr(interface->attrs, ATTR_OLEAUTOMATION) || is_attr(interface->attrs, ATTR_DUAL))
{
typelib->typelib->reg_ifaces = xrealloc(typelib->typelib->reg_ifaces,
(typelib->typelib->reg_iface_count + 1) * sizeof(interface));
typelib->typelib->reg_ifaces[typelib->typelib->reg_iface_count++] = interface;
}
}
static void add_structure_typeinfo(msft_typelib_t *typelib, type_t *structure)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment