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,6 +104,9 @@ static void test_ParseDisplayName(void)
hr = SHGetDesktopFolder(&IDesktopFolder); hr = SHGetDesktopFolder(&IDesktopFolder);
if(hr != S_OK) return; if(hr != S_OK) return;
/* Tests crash on W2K and below (SHCreateShellItem available as of XP) */
if (pSHCreateShellItem)
{
/* null name and pidl */ /* null name and pidl */
hr = IShellFolder_ParseDisplayName(IDesktopFolder, hr = IShellFolder_ParseDisplayName(IDesktopFolder,
NULL, NULL, NULL, NULL, NULL, 0); NULL, NULL, NULL, NULL, NULL, 0);
@ -115,6 +118,9 @@ static void test_ParseDisplayName(void)
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,