Hans Leidekker : userenv: Fix setting the ALLUSERSPROFILE environment variable.
Module: wine Branch: master Commit: fd044802b9de14416b4d5fa723d2596d39402c97 URL: https://source.winehq.org/git/wine.git/?a=commit;h=fd044802b9de14416b4d5fa72... Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Sep 5 12:38:50 2018 +0200 userenv: Fix setting the ALLUSERSPROFILE environment variable. Since 27edd4e35c1eb3827dfb20578733242d9ed3d460 ALLUSERSPROFILE is set to C:\\users\\C:\\users\\Public. This is because the expanded registry value of "Public" is appended to "ProfilesDirectory" and "Public" expands to a full path. AllUsersProfile, used before this commit, expanded to just "Public". Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/userenv/userenv_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/userenv/userenv_main.c b/dlls/userenv/userenv_main.c index 06c7653..11a4f75 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[] = {'P','u','b','l','i','c',0}; + static const WCHAR PublicW[] = {'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}; @@ -323,8 +323,7 @@ BOOL WINAPI CreateEnvironmentBlock( LPVOID* lpEnvironment, profiles_dir[len] = '\0'; } - memcpy(buf, profiles_dir, len*sizeof(WCHAR)); - if (get_reg_value(env, hkey, AllUsersProfileW, buf+len, UNICODE_STRING_MAX_CHARS-len)) + if (get_reg_value(env, hkey, PublicW, buf, UNICODE_STRING_MAX_CHARS)) { RtlInitUnicodeString(&us_name, ALLUSERSPROFILEW); RtlInitUnicodeString(&us_val, buf);
participants (1)
-
Alexandre Julliard