Commit a850cafe authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

shell32: Stop crash when an error occurs.

parent e53e82bf
...@@ -450,21 +450,25 @@ static void test_GetDisplayName(void) ...@@ -450,21 +450,25 @@ static void test_GetDisplayName(void)
/* The pidl returned through the last parameter of SetNameOf is a simple one. */ /* The pidl returned through the last parameter of SetNameOf is a simple one. */
hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlLast, wszDirName, SHGDN_NORMAL, &pidlNew); hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlLast, wszDirName, SHGDN_NORMAL, &pidlNew);
ok (SUCCEEDED(hr), "SetNameOf failed! hr = %08x\n", hr); ok (SUCCEEDED(hr), "SetNameOf failed! hr = %08x\n", hr);
ok (((LPITEMIDLIST)((LPBYTE)pidlNew+pidlNew->mkid.cb))->mkid.cb == 0, if(hr == S_OK)
"pidl returned from SetNameOf should be simple!\n"); {
ok (((LPITEMIDLIST)((LPBYTE)pidlNew+pidlNew->mkid.cb))->mkid.cb == 0,
/* Passing an absolute path to SetNameOf fails. The HRESULT code indicates that SetNameOf "pidl returned from SetNameOf should be simple!\n");
* is implemented on top of SHFileOperation in WinXP. */
hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszAbsoluteFilename, /* Passing an absolute path to SetNameOf fails. The HRESULT code indicates that SetNameOf
SHGDN_FORPARSING, NULL); * is implemented on top of SHFileOperation in WinXP. */
ok (hr == HRESULT_FROM_WIN32(ERROR_CANCELLED), "SetNameOf succeeded! hr = %08x\n", hr); hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszAbsoluteFilename,
SHGDN_FORPARSING, NULL);
/* Rename the file back to its original name. SetNameOf ignores the fact, that the ok (hr == HRESULT_FROM_WIN32(ERROR_CANCELLED), "SetNameOf succeeded! hr = %08x\n", hr);
* SHGDN flags specify an absolute path. */
hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszFileName, SHGDN_FORPARSING, NULL); /* Rename the file back to its original name. SetNameOf ignores the fact, that the
ok (SUCCEEDED(hr), "SetNameOf failed! hr = %08x\n", hr); * SHGDN flags specify an absolute path. */
hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszFileName, SHGDN_FORPARSING, NULL);
ok (SUCCEEDED(hr), "SetNameOf failed! hr = %08x\n", hr);
pILFree(pidlNew);
}
pILFree(pidlNew);
IShellFolder_Release(psfPersonal); IShellFolder_Release(psfPersonal);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment