shell32: Ignore KF_FLAG_NOT_PARENT_RELATIVE in SHGetKnownFolderPath().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2022-01-26 18:44:30 +03:00 committed by Alexandre Julliard
parent 2e88169d7b
commit 1f5b3b9e84
2 changed files with 27 additions and 1 deletions

View File

@ -3529,11 +3529,24 @@ HRESULT WINAPI SHGetKnownFolderPath(REFKNOWNFOLDERID rfid, DWORD flags, HANDLE t
return HRESULT_FROM_WIN32( ERROR_FILE_NOT_FOUND );
if (flags & ~(KF_FLAG_CREATE|KF_FLAG_SIMPLE_IDLIST|KF_FLAG_DONT_UNEXPAND|
KF_FLAG_DONT_VERIFY|KF_FLAG_NO_ALIAS|KF_FLAG_INIT|KF_FLAG_DEFAULT_PATH))
KF_FLAG_DONT_VERIFY|KF_FLAG_NO_ALIAS|KF_FLAG_INIT|KF_FLAG_DEFAULT_PATH|KF_FLAG_NOT_PARENT_RELATIVE))
{
FIXME("flags 0x%08x not supported\n", flags);
return E_INVALIDARG;
}
if ((flags & (KF_FLAG_DEFAULT_PATH | KF_FLAG_NOT_PARENT_RELATIVE)) == KF_FLAG_NOT_PARENT_RELATIVE)
{
WARN("Invalid flags mask %#x.\n", flags);
return E_INVALIDARG;
}
if (flags & KF_FLAG_NOT_PARENT_RELATIVE)
{
FIXME("Ignoring KF_FLAG_NOT_PARENT_RELATIVE.\n");
flags &= ~KF_FLAG_NOT_PARENT_RELATIVE;
}
folder |= flags & CSIDL_FLAG_MASK;
shgfp_flags = flags & KF_FLAG_DEFAULT_PATH ? SHGFP_TYPE_DEFAULT : SHGFP_TYPE_CURRENT;

View File

@ -1910,6 +1910,19 @@ if (0) { /* crashes */
ok(!lstrcmpiW(path, path2), "expected equal paths: %s, %s\n", wine_dbgstr_w(path), wine_dbgstr_w(path2));
CoTaskMemFree(path2);
hr = pSHGetKnownFolderPath(folder_id, KF_FLAG_DEFAULT_PATH, NULL, &path2);
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ok(path2 != NULL, "expected path != NULL\n");
CoTaskMemFree(path2);
hr = pSHGetKnownFolderPath(folder_id, KF_FLAG_NOT_PARENT_RELATIVE, NULL, &path2);
ok(hr == E_INVALIDARG, "expected S_OK, got 0x%08x\n", hr);
hr = pSHGetKnownFolderPath(folder_id, KF_FLAG_DEFAULT_PATH | KF_FLAG_NOT_PARENT_RELATIVE, NULL, &path2);
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ok(path2 != NULL, "expected path != NULL\n");
CoTaskMemFree(path2);
CoTaskMemFree(path);
}