Shell directory fixes

Richard Cohen richard at daijobu.co.uk
Mon Oct 10 03:11:32 CDT 2005


If "My Documents" points to $HOME, then so should "My Music", "My 
Pictures", "My Video"

Richard.


Changelog:
Don't hardcode "windows" directory,
Make "My Pictures" etc. point to $HOME
-------------- next part --------------
Index: dlls/shell32/shellpath.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shellpath.c,v
retrieving revision 1.105
diff -u -p -r1.105 shellpath.c
--- dlls/shell32/shellpath.c	7 Oct 2005 15:01:32 -0000	1.105
+++ dlls/shell32/shellpath.c	10 Oct 2005 08:04:40 -0000
@@ -805,7 +805,7 @@ static const WCHAR szSHUserFolders[] = {
 /* This defaults to L"Documents and Settings" on Windows 2000/XP, but we're
  * acting more Windows 9x-like for now.
  */
-static const WCHAR szDefaultProfileDirW[] = {'w','i','n','d','o','w','s','\\','p','r','o','f','i','l','e','s','\0'};
+static const WCHAR szDefaultProfileDirW[] = {'p','r','o','f','i','l','e','s','\0'};
 static const WCHAR AllUsersW[] = {'A','l','l',' ','U','s','e','r','s','\0'};
 
 typedef enum _CSIDL_Type {
@@ -1259,6 +1259,9 @@ static HRESULT _SHGetDefaultValue(BYTE f
     switch (folder)
     {
         case CSIDL_PERSONAL:
+        case CSIDL_MYMUSIC:
+        case CSIDL_MYPICTURES:
+        case CSIDL_MYVIDEO:
         {
             const char *home = getenv("HOME");
 
@@ -1597,7 +1600,8 @@ static HRESULT _SHExpandEnvironmentStrin
     {
         WCHAR szDefaultProfilesPrefix[MAX_PATH];
 
-        strcpyW(szDefaultProfilesPrefix, SystemDriveW);
+        GetWindowsDirectoryW(szDefaultProfilesPrefix, MAX_PATH);
+        PathAddBackslashW(szDefaultProfilesPrefix);
         PathAppendW(szDefaultProfilesPrefix, szDefaultProfileDirW);
         hr = _SHGetProfilesValue(key, ProfilesDirectoryW, szProfilesPrefix,
          szDefaultProfilesPrefix);


More information about the wine-patches mailing list