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

Alexandre Julliard julliard at winehq.org
Wed Oct 10 15:41:01 CDT 2018


Module: wine
Branch: master
Commit: 65610a4c943ede72f8a2a746e5e66109fcb7ca74
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=65610a4c943ede72f8a2a746e5e66109fcb7ca74

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Tue Oct  9 18:06:40 2018 -0500

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 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/widl/typelib.c    | 4 ++--
 tools/widl/write_msft.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/widl/typelib.c b/tools/widl/typelib.c
index e8dfcb1..2ebb50e 100644
--- a/tools/widl/typelib.c
+++ b/tools/widl/typelib.c
@@ -200,10 +200,10 @@ unsigned short get_type_vt(type_t *t)
     {
       if (match(type_array_get_element(t)->name, "SAFEARRAY"))
         return VT_SAFEARRAY;
+      return VT_PTR;
     }
     else
-      error("get_type_vt: array types not supported\n");
-    return VT_PTR;
+      return VT_CARRAY;
 
   case TYPE_INTERFACE:
     if(match(t->name, "IUnknown"))
diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c
index 913e1a6..9357fd8 100644
--- a/tools/widl/write_msft.c
+++ b/tools/widl/write_msft.c
@@ -1113,7 +1113,7 @@ static int encode_var(
 
 	    if (target_type & 0x80000000) {
 		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));
 		mix_field = get_type_vt(element_type) | VT_ARRAY | VT_BYREF;
 	    } else {




More information about the wine-cvs mailing list