From 3a656fde1f3f981d5458422a628079d7ec94f7d3 Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Wed, 9 Sep 2009 20:24:47 +0200 Subject: [PATCH] shell32/tests: Fix a crash on Win9x. --- dlls/shell32/tests/shelllink.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c index a1e1cd4697..ba2bb3324b 100644 --- a/dlls/shell32/tests/shelllink.c +++ b/dlls/shell32/tests/shelllink.c @@ -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); -- 2.32.0.93.g670b81a890