Reece Dunn : oleaut32: Fix the SafeArrayGetVartype tests on Vista and use that behaviour.

Alexandre Julliard julliard at winehq.org
Fri Jul 25 08:11:32 CDT 2008


Module: wine
Branch: master
Commit: e22e480f1626824227813c58b33293781cf04dcf
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e22e480f1626824227813c58b33293781cf04dcf

Author: Reece Dunn <msclrhd at googlemail.com>
Date:   Thu Jul 24 23:32:35 2008 +0100

oleaut32: Fix the SafeArrayGetVartype tests on Vista and use that behaviour.

---

 dlls/oleaut32/safearray.c       |    2 ++
 dlls/oleaut32/tests/safearray.c |   16 ++++------------
 2 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/dlls/oleaut32/safearray.c b/dlls/oleaut32/safearray.c
index 34cfd91..a19d599 100644
--- a/dlls/oleaut32/safearray.c
+++ b/dlls/oleaut32/safearray.c
@@ -1500,6 +1500,8 @@ HRESULT WINAPI SafeArrayGetVartype(SAFEARRAY* psa, VARTYPE* pvt)
 
   if (psa->fFeatures & FADF_RECORD)
     *pvt = VT_RECORD;
+  else if ((psa->fFeatures & (FADF_HAVEIID|FADF_DISPATCH)) == (FADF_HAVEIID|FADF_DISPATCH))
+    *pvt = VT_DISPATCH;
   else if (psa->fFeatures & FADF_HAVEIID)
     *pvt = VT_UNKNOWN;
   else if (psa->fFeatures & FADF_HAVEVARTYPE)
diff --git a/dlls/oleaut32/tests/safearray.c b/dlls/oleaut32/tests/safearray.c
index 53896ef..969d696 100644
--- a/dlls/oleaut32/tests/safearray.c
+++ b/dlls/oleaut32/tests/safearray.c
@@ -490,12 +490,8 @@ static void test_safearray(void)
         {
             hres = pSafeArrayGetVartype(a, &vt);
             ok(hres == S_OK, "SAGVT of arra y with vt %d failed with %x\n", vttypes[i].vt, hres);
-            if (vttypes[i].vt == VT_DISPATCH) {
-        		/* Special case. Checked against Windows. */
-		        ok(vt == VT_UNKNOWN, "SAGVT of array with VT_DISPATCH returned not VT_UNKNOWN, but %d\n", vt);
-            } else {
-		        ok(vt == vttypes[i].vt, "SAGVT of array with vt %d returned %d\n", vttypes[i].vt, vt);
-            }
+            /* Windows prior to Vista returns VT_UNKNOWN instead of VT_DISPATCH */
+            ok(broken(vt == VT_UNKNOWN) || vt == vttypes[i].vt, "SAGVT of array with vt %d returned %d\n", vttypes[i].vt, vt);
         }
 
 		hres = SafeArrayCopy(a, &c);
@@ -509,12 +505,8 @@ static void test_safearray(void)
         if (pSafeArrayGetVartype) {
             hres = pSafeArrayGetVartype(c, &vt);
             ok(hres == S_OK, "SAGVT of array with vt %d failed with %x\n", vttypes[i].vt, hres);
-            if (vttypes[i].vt == VT_DISPATCH) {
-                /* Special case. Checked against Windows. */
-                ok(vt == VT_UNKNOWN, "SAGVT of array with VT_DISPATCH returned not VT_UNKNOWN, but %d\n", vt);
-            } else {
-                ok(vt == vttypes[i].vt, "SAGVT of array with vt %d returned %d\n", vttypes[i].vt, vt);
-            }
+            /* Windows prior to Vista returns VT_UNKNOWN instead of VT_DISPATCH */
+            ok(broken(vt == VT_UNKNOWN) || vt == vttypes[i].vt, "SAGVT of array with vt %d returned %d\n", vttypes[i].vt, vt);
         }
 
         if (pSafeArrayCopyData) {




More information about the wine-cvs mailing list