This matches what recent Windows versions set in the process environment.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/shell32/shellpath.c | 13 +++++++------ dlls/userenv/userenv_main.c | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index de4bf7d566..4b92e82065 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -951,13 +951,12 @@ static const WCHAR Videos_Sample_VideosW[] = {'V','i','d','e','o','s','\','S',' static const WCHAR WindowsW[] = {'W','i','n','d','o','w','s',0}; static const WCHAR Windows_Sidebar_GadgetsW[] = {'W','i','n','d','o','w','s',' ','S','i','d','e','b','a','r','\','G','a','d','g','e','t','s',0}; static const WCHAR DefaultW[] = {'.','D','e','f','a','u','l','t','\0'}; -static const WCHAR AllUsersProfileW[] = {'%','A','L','L','U','S','E','R','S','P','R','O','F','I','L','E','%','\0'}; +static const WCHAR AllUsersProfileW[] = {'%','P','U','B','L','I','C','%',0}; static const WCHAR UserProfileW[] = {'%','U','S','E','R','P','R','O','F','I','L','E','%','\0'}; static const WCHAR ProgramDataVarW[] = {'%','P','r','o','g','r','a','m','D','a','t','a','%','\0'}; static const WCHAR SystemDriveW[] = {'%','S','y','s','t','e','m','D','r','i','v','e','%','\0'}; static const WCHAR ProfileListW[] = {'S','o','f','t','w','a','r','e','\','M','i','c','r','o','s','o','f','t','\','W','i','n','d','o','w','s',' ','N','T','\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\','P','r','o','f','i','l','e','L','i','s','t',0}; static const WCHAR ProfilesDirectoryW[] = {'P','r','o','f','i','l','e','s','D','i','r','e','c','t','o','r','y',0}; -static const WCHAR AllUsersProfileValueW[] = {'A','l','l','U','s','e','r','s','P','r','o','f','i','l','e','\0'}; static const WCHAR szSHFolders[] = {'S','o','f','t','w','a','r','e','\','M','i','c','r','o','s','o','f','t','\','W','i','n','d','o','w','s','\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\','E','x','p','l','o','r','e','r','\','S','h','e','l','l',' ','F','o','l','d','e','r','s','\0'}; static const WCHAR szSHUserFolders[] = {'S','o','f','t','w','a','r','e','\','M','i','c','r','o','s','o','f','t','\','W','i','n','d','o','w','s','\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\','E','x','p','l','o','r','e','r','\','U','s','e','r',' ','S','h','e','l','l',' ','F','o','l','d','e','r','s','\0'}; static const WCHAR szDefaultProfileDirW[] = {'u','s','e','r','s',0}; @@ -3806,11 +3805,13 @@ static HRESULT _SHExpandEnvironmentStrings(LPCWSTR szSrc, LPWSTR szDest) { if (!strncmpiW(szTemp, AllUsersProfileW, strlenW(AllUsersProfileW))) { - WCHAR szAllUsers[MAX_PATH]; + WCHAR szAllUsers[MAX_PATH], def_val[MAX_PATH];
- strcpyW(szDest, szProfilesPrefix); - hr = _SHGetProfilesValue(key, AllUsersProfileValueW, - szAllUsers, AllUsersW); + GetSystemDirectoryW(def_val, MAX_PATH); + if (def_val[1] == ':') strcpyW( def_val + 3, UsersPublicW ); + else FIXME("non-drive system paths unsupported\n"); + + hr = _SHGetProfilesValue(key, PublicW, szAllUsers, def_val); PathAppendW(szDest, szAllUsers); PathAppendW(szDest, szTemp + strlenW(AllUsersProfileW)); } diff --git a/dlls/userenv/userenv_main.c b/dlls/userenv/userenv_main.c index 538b912b20..06c7653836 100644 --- a/dlls/userenv/userenv_main.c +++ b/dlls/userenv/userenv_main.c @@ -244,7 +244,7 @@ BOOL WINAPI CreateEnvironmentBlock( LPVOID* lpEnvironment,
static const WCHAR SystemRootW[] = {'S','y','s','t','e','m','R','o','o','t',0}; static const WCHAR SystemDriveW[] = {'S','y','s','t','e','m','D','r','i','v','e',0}; - static const WCHAR AllUsersProfileW[] = {'A','l','l','U','s','e','r','s','P','r','o','f','i','l','e',0}; + static const WCHAR AllUsersProfileW[] = {'P','u','b','l','i','c',0}; static const WCHAR ALLUSERSPROFILEW[] = {'A','L','L','U','S','E','R','S','P','R','O','F','I','L','E',0}; static const WCHAR USERNAMEW[] = {'U','S','E','R','N','A','M','E',0}; static const WCHAR USERPROFILEW[] = {'U','S','E','R','P','R','O','F','I','L','E',0};