Module: wine Branch: master Commit: 09dd285d8c6458643a5eb6eb5dfa999368a46c74 URL: http://source.winehq.org/git/wine.git/?a=commit;h=09dd285d8c6458643a5eb6eb5d...
Author: Huw Davies huw@codeweavers.com Date: Wed Mar 2 11:14:36 2011 +0000
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 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 5702cbc..2d2bd75 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)) {