Paul Vriens : shell32/tests: Prevent crash on W2K and below.

Alexandre Julliard julliard at winehq.org
Thu Mar 4 11:21:41 CST 2010


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

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Thu Mar  4 08:49:34 2010 +0100

shell32/tests: Prevent crash on W2K and below.

---

 dlls/shell32/tests/shlfolder.c |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c
index 9b19471..85f04a9 100644
--- a/dlls/shell32/tests/shlfolder.c
+++ b/dlls/shell32/tests/shlfolder.c
@@ -104,17 +104,23 @@ static void test_ParseDisplayName(void)
     hr = SHGetDesktopFolder(&IDesktopFolder);
     if(hr != S_OK) return;
 
-    /* null name and pidl */
-    hr = IShellFolder_ParseDisplayName(IDesktopFolder,
-        NULL, NULL, NULL, NULL, NULL, 0);
-    ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr);
-
-    /* null name */
-    newPIDL = (ITEMIDLIST*)0xdeadbeef;
-    hr = IShellFolder_ParseDisplayName(IDesktopFolder,
-        NULL, NULL, NULL, NULL, &newPIDL, 0);
-    ok(newPIDL == 0, "expected null, got %p\n", newPIDL);
-    ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr);
+    /* Tests crash on W2K and below (SHCreateShellItem available as of XP) */
+    if (pSHCreateShellItem)
+    {
+        /* null name and pidl */
+        hr = IShellFolder_ParseDisplayName(IDesktopFolder,
+            NULL, NULL, NULL, NULL, NULL, 0);
+        ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr);
+
+        /* null name */
+        newPIDL = (ITEMIDLIST*)0xdeadbeef;
+        hr = IShellFolder_ParseDisplayName(IDesktopFolder,
+            NULL, NULL, NULL, NULL, &newPIDL, 0);
+        ok(newPIDL == 0, "expected null, got %p\n", newPIDL);
+        ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr);
+    }
+    else
+        win_skip("Tests would crash on W2K and below\n");
 
     MultiByteToWideChar(CP_ACP, 0, cInetTestA, -1, cTestDirW, MAX_PATH);
     hr = IShellFolder_ParseDisplayName(IDesktopFolder,




More information about the wine-cvs mailing list