shell32: Don't return a path from SHGetKnownFolderPath when it can not be created.

Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sven Baars 2019-02-06 11:48:17 +01:00 committed by Alexandre Julliard
parent 23f97773ee
commit 48e6f8f99d
2 changed files with 4 additions and 1 deletions

View File

@ -4970,7 +4970,7 @@ HRESULT WINAPI SHGetKnownFolderPath(REFKNOWNFOLDERID rfid, DWORD flags, HANDLE t
if (!(flags & KF_FLAG_CREATE))
{
hr = HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND);
goto done;
goto failed;
}
/* create directory/directories */

View File

@ -1875,7 +1875,10 @@ if (0) { /* crashes */
path = NULL;
hr = pSHGetKnownFolderPath(folder_id, KF_FLAG_DEFAULT, NULL, &path);
if (FAILED(hr))
{
ok(path == NULL, "expected path == NULL\n");
continue;
}
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ok(path != NULL, "expected path != NULL\n");