shell32/tests: Fix a crash on Win9x.
authorPaul Vriens <Paul.Vriens.Wine@gmail.com>
Wed, 9 Sep 2009 18:24:47 +0000 (20:24 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 10 Sep 2009 08:50:35 +0000 (10:50 +0200)
dlls/shell32/tests/shelllink.c

index a1e1cd46974b1052524bcc06463119f61c6b6e47..ba2bb3324bb994a6b671e67ff85461aceed97d71 100644 (file)
@@ -107,6 +107,7 @@ static void test_get_set(void)
 {
     HRESULT r;
     IShellLinkA *sl;
+    IShellLinkW *slW = NULL;
     char mypath[MAX_PATH];
     char buffer[INFOTIPSIZE];
     LPITEMIDLIST pidl, tmp_pidl;
@@ -156,8 +157,16 @@ static void test_get_set(void)
     ok(SUCCEEDED(r), "GetPath failed (0x%08x)\n", r);
     ok(*buffer=='\0', "GetPath returned '%s'\n", buffer);
 
-    r = IShellLinkA_SetPath(sl, NULL);
-    ok(r==E_INVALIDARG, "SetPath failed (0x%08x)\n", r);
+    CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
+                     &IID_IShellLinkW, (LPVOID*)&slW);
+    if (!slW)
+        skip("SetPath with NULL parameter crashes on Win9x\n");
+    else
+    {
+        IShellLinkW_Release(slW);
+        r = IShellLinkA_SetPath(sl, NULL);
+        ok(r==E_INVALIDARG, "SetPath failed (0x%08x)\n", r);
+    }
 
     r = IShellLinkA_SetPath(sl, "");
     ok(r==S_OK, "SetPath failed (0x%08x)\n", r);