From c0f05edf66a6c3db4bb37f570f93e1434d14c606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Mon, 28 Jul 2014 02:00:50 +0200 Subject: [PATCH] Update patch to create additional profile directories. --- README.md | 3 +- patches/Makefile | 7 +- ...rofile-directories-available-in-Vist.patch | 185 ++++++++++++++++++ ...32-create-AppData-LocalLow-directory.patch | 56 ------ patches/shell32-Register_Folders/definition | 7 +- 5 files changed, 195 insertions(+), 63 deletions(-) create mode 100644 patches/shell32-Register_Folders/0001-shell32-Create-profile-directories-available-in-Vist.patch delete mode 100644 patches/shell32-Register_Folders/0001-shell32-create-AppData-LocalLow-directory.patch diff --git a/README.md b/README.md index dbceff65..cfeedd39 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,8 @@ Wine-compholio contains fixes for the following Wine bugs: * Add implementation of WTSEnumerateProcessesW ([Wine Bug #29903](http://bugs.winehq.org/show_bug.cgi?id=29903 "Some Microsoft debuggers fail to enumerate processes due to wtsapi32.WTSEnumerateProcessesW() being a stub (Microsoft Visual Studio 2005, DbgCLR from .NET 2.0 SDK)")) * Allow special characters in pipe names. ([Wine Bug #28995](http://bugs.winehq.org/show_bug.cgi?id=28995 "Unable to use named pipes with \">\" character in the name")) * Chromium unit test fails in DecryptMessage ([Wine Bug #20748](http://bugs.winehq.org/show_bug.cgi?id=20748 "chromium's net_unittests!SSLClientSocketTest.Read_Interrupted fails.")) -* Create AppData\LocalLow in user profile directory ([Wine Bug #22896](http://bugs.winehq.org/show_bug.cgi?id=22896 "Multiple applications and games need support for shell32 FOLDERID_LocalAppDataLow (.NET based Unity Engine games, Java JRE 6 in Vista mode)")) +* Create AppData\LocalLow directory inside the profile directory ([Wine Bug #22896](http://bugs.winehq.org/show_bug.cgi?id=22896 "Multiple applications and games need support for shell32 FOLDERID_LocalAppDataLow (.NET based Unity Engine games, Java JRE 6 in Vista mode)")) +* Create Saved Games directory inside the profile directory ([Wine Bug #28312](http://bugs.winehq.org/show_bug.cgi?id=28312 "Assassin's Creed Brotherhood v1.03 needs \"Saved Games\" folder")) * Fix for ConnectNamedPort return value in overlapped mode ([Wine Bug #16550](http://bugs.winehq.org/show_bug.cgi?id=16550 "ConnectNamedPort should never return OK in overlapped mode (affects chromium ui_tests.exe)")) * Fix race conditions and deadlocks in strmbase/quartz ([Wine Bug #31566](http://bugs.winehq.org/show_bug.cgi?id=31566 "Fallout 3: regression causes block at critical section when radio is enabled")) * GetSecurityInfo returns NULL DACL for process object ([Wine Bug #15980](http://bugs.winehq.org/show_bug.cgi?id=15980 "Rhapsody 2 crashes on startup (GetSecurityInfo returns NULL DACL for process object)")) diff --git a/patches/Makefile b/patches/Makefile index 8978fd52..c3b186f0 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -503,20 +503,21 @@ shell32-Default_Folder_ACLs.ok: # Patchset shell32-Register_Folders # | # | Included patches: -# | * Create AppData\LocalLow in user profile directory. [by Michael Müller] +# | * Create additional profile directories available in vista and above. [rev 2, by Michael Müller] # | # | This patchset fixes the following Wine bugs: # | * [#22896] Multiple applications and games need support for shell32 FOLDERID_LocalAppDataLow (.NET based Unity Engine # | games, Java JRE 6 in Vista mode) +# | * [#28312] Assassin's Creed Brotherhood v1.03 needs "Saved Games" folder # | # | Modified files: # | * dlls/shell32/shellpath.c, include/shlobj.h # | .INTERMEDIATE: shell32-Register_Folders.ok shell32-Register_Folders.ok: - $(PATCH) < shell32-Register_Folders/0001-shell32-create-AppData-LocalLow-directory.patch + $(PATCH) < shell32-Register_Folders/0001-shell32-Create-profile-directories-available-in-Vist.patch @( \ - echo '+ { "shell32-Register_Folders", "Michael Müller", "Create AppData\\\\LocalLow in user profile directory." },'; \ + echo '+ { "shell32-Register_Folders", "Michael Müller", "Create additional profile directories available in vista and above. [rev 2]" },'; \ ) > shell32-Register_Folders.ok # Patchset shell32-SHCreateSessionKey diff --git a/patches/shell32-Register_Folders/0001-shell32-Create-profile-directories-available-in-Vist.patch b/patches/shell32-Register_Folders/0001-shell32-Create-profile-directories-available-in-Vist.patch new file mode 100644 index 00000000..f5d7205c --- /dev/null +++ b/patches/shell32-Register_Folders/0001-shell32-Create-profile-directories-available-in-Vist.patch @@ -0,0 +1,185 @@ +From 92dc11a14302d63443d61d5d2a2e0c1da130aa3f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Mon, 28 Jul 2014 01:21:04 +0200 +Subject: shell32: Create profile directories available in Vista and above. + +--- + dlls/shell32/shellpath.c | 58 ++++++++++++++++++++++++++++++++-------------- + include/shlobj.h | 9 +++++++ + 2 files changed, 50 insertions(+), 17 deletions(-) + +diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c +index 158b1d1..e7548d1 100644 +--- a/dlls/shell32/shellpath.c ++++ b/dlls/shell32/shellpath.c +@@ -1280,10 +1280,10 @@ static const CSIDL_DATA CSIDL_Data[] = + NULL, + NULL + }, +- { /* 0x43 */ ++ { /* 0x43 - CSIDL_WINE_CONTACTS */ + &FOLDERID_Contacts, + CSIDL_Type_User, +- ContactsW, ++ NULL, + ContactsW + }, + { /* 0x44 */ +@@ -1304,7 +1304,7 @@ static const CSIDL_DATA CSIDL_Data[] = + NULL, + NULL + }, +- { /* 0x47 */ ++ { /* 0x47 - CSIDL_WINE_DOWNLOADS */ + &FOLDERID_Downloads, + CSIDL_Type_User, + NULL, +@@ -1340,13 +1340,13 @@ static const CSIDL_DATA CSIDL_Data[] = + NULL, + NULL + }, +- { /* 0x4d */ ++ { /* 0x4d - CSIDL_WINE_LINKS */ + &FOLDERID_Links, + CSIDL_Type_User, + NULL, + LinksW + }, +- { /* 0x4e */ ++ { /* 0x4e - CSIDL_WINE_APPDATA_LOCALLOW */ + &FOLDERID_LocalAppDataLow, + CSIDL_Type_User, + NULL, +@@ -1466,13 +1466,13 @@ static const CSIDL_DATA CSIDL_Data[] = + NULL, + Videos_Sample_VideosW + }, +- { /* 0x62 */ ++ { /* 0x62 - CSIDL_WINE_SAVED_GAMES */ + &FOLDERID_SavedGames, + CSIDL_Type_User, + NULL, + Saved_GamesW + }, +- { /* 0x63 */ ++ { /* 0x63 - CSIDL_WINE_SEARCHES */ + &FOLDERID_SavedSearches, + CSIDL_Type_User, + NULL, +@@ -1855,6 +1855,8 @@ static LPWSTR _GetUserSidStringFromToken(HANDLE Token) + static HRESULT _SHGetUserProfilePath(HANDLE hToken, DWORD dwFlags, BYTE folder, + LPWSTR pszPath) + { ++ const WCHAR *szValueName; ++ WCHAR buffer[40]; + HRESULT hr; + + TRACE("%p,0x%08x,0x%02x,%p\n", hToken, dwFlags, folder, pszPath); +@@ -1897,11 +1899,18 @@ static HRESULT _SHGetUserProfilePath(HANDLE hToken, DWORD dwFlags, BYTE folder, + goto error; + } + } +- hr = _SHGetUserShellFolderPath(hRootKey, userPrefix, +- CSIDL_Data[folder].szValueName, pszPath); ++ ++ /* For CSIDL_Type_User we also use the GUID if no szValueName is provided */ ++ szValueName = CSIDL_Data[folder].szValueName; ++ if (!szValueName) ++ { ++ StringFromGUID2( CSIDL_Data[folder].id, buffer, 39 ); ++ szValueName = &buffer[0]; ++ } ++ ++ hr = _SHGetUserShellFolderPath(hRootKey, userPrefix, szValueName, pszPath); + if (FAILED(hr) && hRootKey != HKEY_LOCAL_MACHINE) +- hr = _SHGetUserShellFolderPath(HKEY_LOCAL_MACHINE, NULL, +- CSIDL_Data[folder].szValueName, pszPath); ++ hr = _SHGetUserShellFolderPath(HKEY_LOCAL_MACHINE, NULL, szValueName, pszPath); + if (FAILED(hr)) + hr = _SHGetDefaultValue(folder, pszPath); + if (userPrefix != NULL && userPrefix != DefaultW) +@@ -2361,6 +2370,8 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, + LPCWSTR szUserShellFolderPath, LPCWSTR szShellFolderPath, const UINT folders[], + UINT foldersLen) + { ++ const WCHAR *szValueName; ++ WCHAR buffer[40]; + UINT i; + WCHAR path[MAX_PATH]; + HRESULT hr = S_OK; +@@ -2383,7 +2394,16 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, + for (i = 0; SUCCEEDED(hr) && i < foldersLen; i++) + { + dwPathLen = MAX_PATH * sizeof(WCHAR); +- if (RegQueryValueExW(hUserKey, CSIDL_Data[folders[i]].szValueName, NULL, ++ ++ /* For CSIDL_Type_User we also use the GUID if no szValueName is provided */ ++ szValueName = CSIDL_Data[folders[i]].szValueName; ++ if (!szValueName && CSIDL_Data[folders[i]].type == CSIDL_Type_User) ++ { ++ StringFromGUID2( CSIDL_Data[folders[i]].id, buffer, 39 ); ++ szValueName = &buffer[0]; ++ } ++ ++ if (RegQueryValueExW(hUserKey, szValueName, NULL, + &dwType, (LPBYTE)path, &dwPathLen) || (dwType != REG_SZ && + dwType != REG_EXPAND_SZ)) + { +@@ -2407,8 +2427,7 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, + hr = E_FAIL; + if (*path) + { +- ret = RegSetValueExW(hUserKey, +- CSIDL_Data[folders[i]].szValueName, 0, REG_EXPAND_SZ, ++ ret = RegSetValueExW(hUserKey, szValueName, 0, REG_EXPAND_SZ, + (LPBYTE)path, (strlenW(path) + 1) * sizeof(WCHAR)); + if (ret) + hr = HRESULT_FROM_WIN32(ret); +@@ -2416,8 +2435,7 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, + { + hr = SHGetFolderPathW(NULL, folders[i] | CSIDL_FLAG_CREATE, + hToken, SHGFP_TYPE_DEFAULT, path); +- ret = RegSetValueExW(hKey, +- CSIDL_Data[folders[i]].szValueName, 0, REG_SZ, ++ ret = RegSetValueExW(hKey, szValueName, 0, REG_SZ, + (LPBYTE)path, (strlenW(path) + 1) * sizeof(WCHAR)); + if (ret) + hr = HRESULT_FROM_WIN32(ret); +@@ -2457,7 +2475,13 @@ static HRESULT _SHRegisterUserShellFolders(BOOL bDefault) + CSIDL_HISTORY, + CSIDL_MYPICTURES, + CSIDL_FONTS, +- CSIDL_ADMINTOOLS ++ CSIDL_ADMINTOOLS, ++ CSIDL_WINE_CONTACTS, ++ CSIDL_WINE_DOWNLOADS, ++ CSIDL_WINE_LINKS, ++ CSIDL_WINE_APPDATA_LOCALLOW, ++ CSIDL_WINE_SAVED_GAMES, ++ CSIDL_WINE_SEARCHES + }; + WCHAR userShellFolderPath[MAX_PATH], shellFolderPath[MAX_PATH]; + LPCWSTR pUserShellFolderPath, pShellFolderPath; +diff --git a/include/shlobj.h b/include/shlobj.h +index 9025a73..dcea14e 100644 +--- a/include/shlobj.h ++++ b/include/shlobj.h +@@ -1529,6 +1529,15 @@ HRESULT WINAPI SHGetFolderPathW(HWND hwnd, int nFolder, HANDLE hToken, DWORD dwF + #define CSIDL_CDBURN_AREA 0x003b + #define CSIDL_COMPUTERSNEARME 0x003d + #define CSIDL_PROFILES 0x003e ++ ++/* Wine internal CSIDLs */ ++#define CSIDL_WINE_CONTACTS 0x0043 ++#define CSIDL_WINE_DOWNLOADS 0x0047 ++#define CSIDL_WINE_LINKS 0x004d ++#define CSIDL_WINE_APPDATA_LOCALLOW 0x004e ++#define CSIDL_WINE_SAVED_GAMES 0x0062 ++#define CSIDL_WINE_SEARCHES 0x0063 ++ + #define CSIDL_FOLDER_MASK 0x00ff + #define CSIDL_FLAG_PER_USER_INIT 0x0800 + #define CSIDL_FLAG_NO_ALIAS 0x1000 +-- +1.7.9.5 + diff --git a/patches/shell32-Register_Folders/0001-shell32-create-AppData-LocalLow-directory.patch b/patches/shell32-Register_Folders/0001-shell32-create-AppData-LocalLow-directory.patch deleted file mode 100644 index 78124daa..00000000 --- a/patches/shell32-Register_Folders/0001-shell32-create-AppData-LocalLow-directory.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 093b6e556c965b00693148f49ff0b35063cd1d01 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sun, 27 Jul 2014 02:53:11 +0200 -Subject: shell32: create AppData\LocalLow directory - ---- - dlls/shell32/shellpath.c | 6 ++++-- - include/shlobj.h | 1 + - 2 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c -index 78487e2..30db774 100644 ---- a/dlls/shell32/shellpath.c -+++ b/dlls/shell32/shellpath.c -@@ -772,6 +772,7 @@ static const WCHAR szCurrentVersion[] = {'S','o','f','t','w','a','r','e','\\','M - static const WCHAR Administrative_ToolsW[] = {'A','d','m','i','n','i','s','t','r','a','t','i','v','e',' ','T','o','o','l','s','\0'}; - static const WCHAR AppDataW[] = {'A','p','p','D','a','t','a','\0'}; - static const WCHAR AppData_LocalLowW[] = {'A','p','p','D','a','t','a','\\','L','o','c','a','l','L','o','w','\0'}; -+static const WCHAR AppData_LocalLow_FOLDERIDW[] = {'{','A','5','2','0','A','1','A','4','-','1','7','8','0','-','4','F','F','6','-','B','D','1','8','-','1','6','7','3','4','C','5','A','F','1','6','}','\0'}; - static const WCHAR Application_DataW[] = {'A','p','p','l','i','c','a','t','i','o','n',' ','D','a','t','a','\0'}; - static const WCHAR CacheW[] = {'C','a','c','h','e','\0'}; - static const WCHAR CD_BurningW[] = {'C','D',' ','B','u','r','n','i','n','g','\0'}; -@@ -1349,7 +1350,7 @@ static const CSIDL_DATA CSIDL_Data[] = - { /* 0x4e */ - &FOLDERID_LocalAppDataLow, - CSIDL_Type_User, -- NULL, -+ AppData_LocalLow_FOLDERIDW, - AppData_LocalLowW - }, - { /* 0x4f */ -@@ -2542,7 +2543,8 @@ static HRESULT _SHRegisterUserShellFolders(BOOL bDefault) - CSIDL_HISTORY, - CSIDL_MYPICTURES, - CSIDL_FONTS, -- CSIDL_ADMINTOOLS -+ CSIDL_ADMINTOOLS, -+ CSIDL_WINE_APPDATA_LOCALLOW - }; - WCHAR userShellFolderPath[MAX_PATH], shellFolderPath[MAX_PATH]; - LPCWSTR pUserShellFolderPath, pShellFolderPath; -diff --git a/include/shlobj.h b/include/shlobj.h -index 9025a73..1189ae2 100644 ---- a/include/shlobj.h -+++ b/include/shlobj.h -@@ -1529,6 +1529,7 @@ HRESULT WINAPI SHGetFolderPathW(HWND hwnd, int nFolder, HANDLE hToken, DWORD dwF - #define CSIDL_CDBURN_AREA 0x003b - #define CSIDL_COMPUTERSNEARME 0x003d - #define CSIDL_PROFILES 0x003e -+#define CSIDL_WINE_APPDATA_LOCALLOW 0x004e - #define CSIDL_FOLDER_MASK 0x00ff - #define CSIDL_FLAG_PER_USER_INIT 0x0800 - #define CSIDL_FLAG_NO_ALIAS 0x1000 --- -1.8.3.2 - diff --git a/patches/shell32-Register_Folders/definition b/patches/shell32-Register_Folders/definition index 7a77d777..fa397296 100644 --- a/patches/shell32-Register_Folders/definition +++ b/patches/shell32-Register_Folders/definition @@ -1,4 +1,5 @@ Author: Michael Müller -Subject: Create AppData\LocalLow in user profile directory. -Revision: 1 -Fixes: [22896] Create AppData\LocalLow in user profile directory +Subject: Create additional profile directories available in vista and above. +Revision: 2 +Fixes: [22896] Create AppData\LocalLow directory inside the profile directory +Fixes: [28312] Create Saved Games directory inside the profile directory