From 09dd285d8c6458643a5eb6eb5dfa999368a46c74 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Wed, 2 Mar 2011 11:14:36 +0000 Subject: [PATCH] widl: Initialise [out] only conformant arrays. This isn't strictly what midl does, however VB relies on the array in IEnumVARIANT_Next() being zero initialised. Native uses stubless proxies, where the initialisation is performed in NdrStubCall2(). --- tools/widl/typegen.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 5702cbcf7d2..2d2bd75273b 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -4034,10 +4034,22 @@ void assign_stub_out_args( FILE *file, int indent, const var_t *func, const char if (type_array_has_conformance(var->type)) { unsigned int size; - type_t *type = var->type; + type_t *type; fprintf(file, " = NdrAllocate(&__frame->_StubMsg, "); - for ( ; + for (type = var->type; + is_array(type) && type_array_has_conformance(type); + type = type_array_get_element(type)) + { + write_expr(file, type_array_get_conformance(type), TRUE, + TRUE, NULL, NULL, local_var_prefix); + fprintf(file, " * "); + } + size = type_memsize(type); + fprintf(file, "%u);\n", size); + + print_file(file, indent, "memset(%s%s, 0, ", local_var_prefix, var->name); + for (type = var->type; is_array(type) && type_array_has_conformance(type); type = type_array_get_element(type)) {