shell32/tests: Prevent crash on W2K and below.

This commit is contained in:
Paul Vriens 2010-03-04 08:49:34 +01:00 committed by Alexandre Julliard
parent 6dfe16fc48
commit f370ab7e9b
1 changed files with 16 additions and 10 deletions

View File

@ -104,17 +104,23 @@ static void test_ParseDisplayName(void)
hr = SHGetDesktopFolder(&IDesktopFolder); hr = SHGetDesktopFolder(&IDesktopFolder);
if(hr != S_OK) return; if(hr != S_OK) return;
/* null name and pidl */ /* Tests crash on W2K and below (SHCreateShellItem available as of XP) */
hr = IShellFolder_ParseDisplayName(IDesktopFolder, if (pSHCreateShellItem)
NULL, NULL, NULL, NULL, NULL, 0); {
ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr); /* 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 */ /* null name */
newPIDL = (ITEMIDLIST*)0xdeadbeef; newPIDL = (ITEMIDLIST*)0xdeadbeef;
hr = IShellFolder_ParseDisplayName(IDesktopFolder, hr = IShellFolder_ParseDisplayName(IDesktopFolder,
NULL, NULL, NULL, NULL, &newPIDL, 0); NULL, NULL, NULL, NULL, &newPIDL, 0);
ok(newPIDL == 0, "expected null, got %p\n", newPIDL); ok(newPIDL == 0, "expected null, got %p\n", newPIDL);
ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr); 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); MultiByteToWideChar(CP_ACP, 0, cInetTestA, -1, cTestDirW, MAX_PATH);
hr = IShellFolder_ParseDisplayName(IDesktopFolder, hr = IShellFolder_ParseDisplayName(IDesktopFolder,