widl: Fix detection of SAFEARRAY pointers when writing array pointers.

This code was introduced in 7d1e3691, but that commit did not account for
pointers to normal C arrays.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2018-10-09 18:06:40 -05:00 committed by Alexandre Julliard
parent 23c0047c81
commit 65610a4c94
2 changed files with 3 additions and 3 deletions

View File

@ -200,10 +200,10 @@ unsigned short get_type_vt(type_t *t)
{ {
if (match(type_array_get_element(t)->name, "SAFEARRAY")) if (match(type_array_get_element(t)->name, "SAFEARRAY"))
return VT_SAFEARRAY; return VT_SAFEARRAY;
return VT_PTR;
} }
else else
error("get_type_vt: array types not supported\n"); return VT_CARRAY;
return VT_PTR;
case TYPE_INTERFACE: case TYPE_INTERFACE:
if(match(t->name, "IUnknown")) if(match(t->name, "IUnknown"))

View File

@ -1113,7 +1113,7 @@ static int encode_var(
if (target_type & 0x80000000) { if (target_type & 0x80000000) {
mix_field = ((target_type >> 16) & 0x3fff) | VT_BYREF; mix_field = ((target_type >> 16) & 0x3fff) | VT_BYREF;
} else if (is_array(ref)) { } else if (get_type_vt(ref) == VT_SAFEARRAY) {
type_t *element_type = type_alias_get_aliasee(type_array_get_element(ref)); type_t *element_type = type_alias_get_aliasee(type_array_get_element(ref));
mix_field = get_type_vt(element_type) | VT_ARRAY | VT_BYREF; mix_field = get_type_vt(element_type) | VT_ARRAY | VT_BYREF;
} else { } else {