Add patch to implement KF_FLAG_DEFAULT_PATH for SHGetKnownFolderPath.

This commit is contained in:
Sebastian Lackner 2014-08-23 01:40:17 +02:00
parent e2f3ff5808
commit 0f9f7dc428
4 changed files with 77 additions and 1 deletions

View File

@ -13,7 +13,7 @@ which are not present in regular wine, and always report such issues to us
Included bugfixes and improvements
----------------------------------
**Bugfixes and features included in the next upcoming release [11]:**
**Bugfixes and features included in the next upcoming release [12]:**
* Adobe Reader requires NtProtectVirtualMemory and NtCreateSection to be on separate pages ([Wine Bug #33162](http://bugs.winehq.org/show_bug.cgi?id=33162 "Acrobat Reader 11 crashes on start (native API application virtualization, NtProtectVirtualMemory removes execute page protection on its own code)"))
* Fix ITERATE_MoveFiles when no source- and destname is specified ([Wine Bug #10085](http://bugs.winehq.org/show_bug.cgi?id=10085 "Adobe Bridge CS2 complains that it can't start due to licensing restrictions (affects photoshop)"))
@ -25,6 +25,7 @@ Included bugfixes and improvements
* Prevent window managers from grouping all wine programs together ([Wine Bug #32699](http://bugs.winehq.org/show_bug.cgi?id=32699 "Add StartupWMClass to .desktop files."))
* Support for Dynamic DST (daylight saving time) information in registry
* Support for GetFinalPathNameByHandle ([Wine Bug #36073](http://bugs.winehq.org/show_bug.cgi?id=36073 "OneDrive crashes on unimplemented function KERNEL32.dll.GetFinalPathNameByHandleW"))
* Support for KF_FLAG_DEFAULT_PATH in SHGetKnownFolderPath ([Wine Bug #30385](http://bugs.winehq.org/show_bug.cgi?id=30385 "Windows Live Essentials 2011 web installer fails to download packages in background (shell32.SHGetKnownFolderPath missing support for KF_FLAG_DEFAULT_PATH)"))
* nVidia driver for high-end laptop cards does not list all supported resolutions

View File

@ -42,6 +42,7 @@ PATCHLIST := \
server-Process.ok \
server-Stored_ACLs.ok \
shell32-Default_Folder_ACLs.ok \
shell32-Default_Path.ok \
shell32-Icons.ok \
shell32-RunDLL_CallEntry16.ok \
shell32-SHCreateSessionKey.ok \
@ -739,6 +740,24 @@ shell32-Default_Folder_ACLs.ok:
echo '+ { "shell32-Default_Folder_ACLs", "Erich E. Hoover", "Generate default ACLs for user shell folders. [rev 6]" },'; \
) > shell32-Default_Folder_ACLs.ok
# Patchset shell32-Default_Path
# |
# | Included patches:
# | * Implement KF_FLAG_DEFAULT_PATH flag for SHGetKnownFolderPath. [by Sebastian Lackner]
# |
# | This patchset fixes the following Wine bugs:
# | * [#30385] Support for KF_FLAG_DEFAULT_PATH in SHGetKnownFolderPath
# |
# | Modified files:
# | * dlls/shell32/shellpath.c, dlls/shell32/tests/shellpath.c
# |
.INTERMEDIATE: shell32-Default_Path.ok
shell32-Default_Path.ok:
$(call APPLY_FILE,shell32-Default_Path/0001-shell32-Implement-KF_FLAG_DEFAULT_PATH-flag-for-SHGe.patch)
@( \
echo '+ { "shell32-Default_Path", "Sebastian Lackner", "Implement KF_FLAG_DEFAULT_PATH flag for SHGetKnownFolderPath." },'; \
) > shell32-Default_Path.ok
# Patchset shell32-Icons
# |
# | Included patches:

View File

@ -0,0 +1,52 @@
From 12199f1bcc3fabab52034df4362a5b3c4e93337d Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 23 Aug 2014 01:34:38 +0200
Subject: shell32: Implement KF_FLAG_DEFAULT_PATH flag for
SHGetKnownFolderPath.
---
dlls/shell32/shellpath.c | 6 ++++--
dlls/shell32/tests/shellpath.c | 5 +++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c
index e361483..600e002 100644
--- a/dlls/shell32/shellpath.c
+++ b/dlls/shell32/shellpath.c
@@ -3104,13 +3104,15 @@ HRESULT WINAPI SHGetKnownFolderPath(REFKNOWNFOLDERID rfid, DWORD flags, HANDLE t
if (flags & KF_FLAG_INIT)
index |= CSIDL_FLAG_PER_USER_INIT;
- if (flags & ~(KF_FLAG_CREATE|KF_FLAG_DONT_VERIFY|KF_FLAG_NO_ALIAS|KF_FLAG_INIT))
+ if (flags & ~(KF_FLAG_CREATE|KF_FLAG_DONT_VERIFY|KF_FLAG_NO_ALIAS|
+ KF_FLAG_INIT|KF_FLAG_DEFAULT_PATH))
{
FIXME("flags 0x%08x not supported\n", flags);
return E_INVALIDARG;
}
- hr = SHGetFolderPathW( NULL, index, token, 0, folder );
+ hr = SHGetFolderPathW( NULL, index, token, (flags & KF_FLAG_DEFAULT_PATH) ?
+ SHGFP_TYPE_DEFAULT : SHGFP_TYPE_CURRENT, folder );
if (SUCCEEDED(hr))
{
*path = CoTaskMemAlloc( (strlenW( folder ) + 1) * sizeof(WCHAR) );
diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c
index efdfbbd..f518a7a 100644
--- a/dlls/shell32/tests/shellpath.c
+++ b/dlls/shell32/tests/shellpath.c
@@ -861,6 +861,11 @@ if (0) { /* crashes */
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ok(path != NULL, "expected path != NULL\n");
+ path = NULL;
+ hr = pSHGetKnownFolderPath(&FOLDERID_Desktop, KF_FLAG_DEFAULT_PATH, NULL, &path);
+ ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
+ ok(path != NULL, "expected path != NULL\n");
+
hr = pSHGetFolderPathEx(&FOLDERID_Desktop, 0, NULL, buffer, MAX_PATH);
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
ok(!lstrcmpiW(path, buffer), "expected equal paths\n");
--
1.7.9.5

View File

@ -0,0 +1,4 @@
Author: Sebastian Lackner
Subject: Implement KF_FLAG_DEFAULT_PATH flag for SHGetKnownFolderPath.
Revision: 1
Fixes: [30385] Support for KF_FLAG_DEFAULT_PATH in SHGetKnownFolderPath