[PATCH] stop crash under win98

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Wed Jun 18 06:08:43 CDT 2008


---
 dlls/mapi32/tests/prop.c |   40 +++++++++++++++++++++++++++-------------
 1 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/dlls/mapi32/tests/prop.c b/dlls/mapi32/tests/prop.c
index adc1d85..6fb4e63 100644
--- a/dlls/mapi32/tests/prop.c
+++ b/dlls/mapi32/tests/prop.c
@@ -826,11 +826,18 @@ static void test_ScCopyRelocProps(void)
     ok(sc == S_OK, "wrong ret %d\n", sc);
     ok(lpResProp->ulPropTag == pvProp.ulPropTag, "wrong tag %x\n",lpResProp->ulPropTag);
     ok(lpResProp->Value.MVszA.cValues == 1, "wrong cValues %d\n", lpResProp->Value.MVszA.cValues);
-    ok(lpResProp->Value.MVszA.lppszA[0] == buffer + sizeof(SPropValue) + sizeof(char*),
-       "wrong lppszA[0] %p\n",lpResProp->Value.MVszA.lppszA[0]);
+    if(lpResProp->Value.MVszA.lppszA)
+    {
+        ok(lpResProp->Value.MVszA.lppszA[0] == buffer + sizeof(SPropValue) + sizeof(char*),
+           "wrong lppszA[0] %p\n",lpResProp->Value.MVszA.lppszA[0]);
+        ok(!strcmp(lpResProp->Value.MVszA.lppszA[0], szTestA),
+           "wrong string '%s'\n", lpResProp->Value.MVszA.lppszA[0]);
+    }
+    else
+    {
+        skip("lpResProp->Value.MVszA.lppszA is NULL");
+    }
     ok(ulCount == sizeof(SPropValue) + sizeof(char*) + 5, "wrong count %d\n", ulCount);
-    ok(!strcmp(lpResProp->Value.MVszA.lppszA[0], szTestA),
-       "wrong string '%s'\n", lpResProp->Value.MVszA.lppszA[0]);
 
     memcpy(buffer2, buffer, sizeof(buffer));
 
@@ -847,16 +854,23 @@ static void test_ScCopyRelocProps(void)
     ok(sc == S_OK, "wrong ret %d\n", sc);
     ok(lpResProp->ulPropTag == pvProp.ulPropTag, "wrong tag %x\n",lpResProp->ulPropTag);
     ok(lpResProp->Value.MVszA.cValues == 1, "wrong cValues %d\n", lpResProp->Value.MVszA.cValues);
-    ok(lpResProp->Value.MVszA.lppszA[0] == buffer2 + sizeof(SPropValue) + sizeof(char*),
-       "wrong lppszA[0] %p\n",lpResProp->Value.MVszA.lppszA[0]);
-    /* Native has a bug whereby it calculates the size correctly when copying
-     * but when relocating does not (presumably it uses UlPropSize() which
-     * ignores multivalue pointers). Wine returns the correct value.
-     */
+    if(lpResProp->Value.MVszA.lppszA)
+    {
+        ok(lpResProp->Value.MVszA.lppszA[0] == buffer2 + sizeof(SPropValue) + sizeof(char*),
+           "wrong lppszA[0] %p\n",lpResProp->Value.MVszA.lppszA[0]);
+        /* Native has a bug whereby it calculates the size correctly when copying
+         * but when relocating does not (presumably it uses UlPropSize() which
+         * ignores multivalue pointers). Wine returns the correct value.
+         */
+        ok(!strcmp(lpResProp->Value.MVszA.lppszA[0], szTestA),
+           "wrong string '%s'\n", lpResProp->Value.MVszA.lppszA[0]);
+    }
+    else
+    {
+        skip("lpResProp->Value.MVszA.lppszA is NULL");
+    }
     ok(ulCount == sizeof(SPropValue) + sizeof(char*) + 5 || ulCount == sizeof(SPropValue) + 5,
-       "wrong count %d\n", ulCount);
-    ok(!strcmp(lpResProp->Value.MVszA.lppszA[0], szTestA),
-       "wrong string '%s'\n", lpResProp->Value.MVszA.lppszA[0]);
+        "wrong count %d\n", ulCount);
 
     /* Native crashes with lpNew or lpOld set to NULL so skip testing this */
 }
-- 
1.5.4.1


--------------030104030500090506010608--




More information about the wine-patches mailing list