[PATCH 10/11] shell32: _SHCreateSymbolicLinks() remove obsolete IDS Resource String Directory matching

Rob Walker bob.mt.wya at gmail.com
Mon Jul 16 17:47:04 CDT 2018


With the change to the newer User Profile directory names, the code to match agains the
legacy directory targets, of the form '$HOME/My XXX', can be removed. The newer Windows
USERPROFILE directory names now mirror standard XDG directory names.

Signed-off-by: Rob Walker <bob.mt.wya at gmail.com>
---
 dlls/shell32/shellpath.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c
index 5bf027f6f2..6c6d879cb6 100644
--- a/dlls/shell32/shellpath.c
+++ b/dlls/shell32/shellpath.c
@@ -4397,14 +4397,12 @@ static inline BOOL _SHAppendToUnixPath(char *szBasePath, LPCWSTR pwszSubPath) {
  *     (in the current Wineprefix).
  *  2) Create a symbolic link from the '%USERPROFILE%\\XXX' User Profile directory
  *     to:
- *      Resource ID 'XXX'     - if '$HOME/XXX'    exists then target this.
  *      XDG_XXX_DIR           - if '$XDG_XXX_DIR' exists then target this.
  *      MacOS 'XXX' directory - if '$HOME/XXX'    exists then target this.
  *
  */
 static void _SHCreateSymbolicLinks(void)
 {
-    UINT ids_dirs[] = { IDS_PERSONAL, IDS_MYMUSIC, IDS_MYPICTURES, IDS_MYVIDEOS, IDS_DESKTOPDIRECTORY };
     const WCHAR* ws_osx_dirs[] = { DocumentsW, MusicW, PicturesW, MoviesW, DesktopW };
     int csidl_dirs[] = { CSIDL_PERSONAL, CSIDL_MYMUSIC, CSIDL_MYPICTURES, CSIDL_MYVIDEO, CSIDL_DESKTOPDIRECTORY };
     static const char * const xdg_dirnames[] = { "DOCUMENTS", "MUSIC", "PICTURES", "VIDEOS", "DESKTOP" };
@@ -4436,16 +4434,8 @@ static void _SHCreateSymbolicLinks(void)
         if (!prefix_profile_dir)  continue;
 
         target_ok = FALSE;
-        /* Try to target a pre-existing '$HOME/My XXX' folder. */
-        strcpy(home_target_dir, env_homedir);
-        if ((ids_dirs[i] != IDS_DESKTOPDIRECTORY) &&
-            _SHAppendToUnixPath(home_target_dir, MAKEINTRESOURCEW(ids_dirs[i])) &&
-            !stat(home_target_dir, &stat_folder) && S_ISDIR(stat_folder.st_mode))
-        {
-            target_ok = TRUE;
-        }
         /* Try to target the XDG_XXX_DIR folder. */
-        else if (xdg_dirs && xdg_dirs[i])
+        if (xdg_dirs && xdg_dirs[i])
         {
             strcpy(home_target_dir, xdg_dirs[i]);
             target_ok = TRUE;
-- 
2.18.0




More information about the wine-devel mailing list