Sven Baars : shell32: Don' t return a path from SHGetKnownFolderPath when it can not be created.
Alexandre Julliard
julliard at winehq.org
Wed Feb 6 15:32:28 CST 2019
Module: wine
Branch: master
Commit: 48e6f8f99dfb11d0f0a15f55665afd8a38fd156d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=48e6f8f99dfb11d0f0a15f55665afd8a38fd156d
Author: Sven Baars <sven.wine at gmail.com>
Date: Wed Feb 6 11:48:17 2019 +0100
shell32: Don't return a path from SHGetKnownFolderPath when it can not be created.
Signed-off-by: Sven Baars <sven.wine at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/shell32/shellpath.c | 2 +-
dlls/shell32/tests/shellpath.c | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c
index f08474b..8c6e8a8 100644
--- a/dlls/shell32/shellpath.c
+++ b/dlls/shell32/shellpath.c
@@ -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 */
diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c
index 38b56f0..f768f44 100644
--- a/dlls/shell32/tests/shellpath.c
+++ b/dlls/shell32/tests/shellpath.c
@@ -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");
More information about the wine-cvs
mailing list