Don't hardcode "windows" directory.

Make "My Pictures" etc. point to $HOME.
This commit is contained in:
Richard Cohen 2005-10-10 10:29:53 +00:00 committed by Alexandre Julliard
parent b70a5f2954
commit e1f752f704
1 changed files with 6 additions and 2 deletions

View File

@ -805,7 +805,7 @@ static const WCHAR szSHUserFolders[] = {'S','o','f','t','w','a','r','e','\\','M'
/* 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 folder, LPWSTR pszPath)
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 _SHExpandEnvironmentStrings(LPCWSTR szSrc, LPWSTR szDest)
{
WCHAR szDefaultProfilesPrefix[MAX_PATH];
strcpyW(szDefaultProfilesPrefix, SystemDriveW);
GetWindowsDirectoryW(szDefaultProfilesPrefix, MAX_PATH);
PathAddBackslashW(szDefaultProfilesPrefix);
PathAppendW(szDefaultProfilesPrefix, szDefaultProfileDirW);
hr = _SHGetProfilesValue(key, ProfilesDirectoryW, szProfilesPrefix,
szDefaultProfilesPrefix);