mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 08:50:49 +00:00
userenv: Fix setting ALLUSERSPROFILE and ProgramData in CreateEnvironmentBlock.
This syncs the code with dlls/ntdll/unix/env.c add_registry_environment. It fixes ALLUSERSPROFILE and ProgramData environment variables value in services.
This commit is contained in:
parent
9b400f3f3e
commit
94812b1265
|
@ -78,7 +78,7 @@ static void test_create_env(void)
|
|||
BOOL r, is_wow64 = FALSE;
|
||||
HANDLE htok;
|
||||
WCHAR * env[4];
|
||||
char * st, systemroot[100], programdata[100];
|
||||
char * st, systemroot[100], programdata[100], allusersprofile[100];
|
||||
int i, j;
|
||||
|
||||
static const struct profile_item common_vars[] = {
|
||||
|
@ -186,7 +186,7 @@ static void test_create_env(void)
|
|||
}
|
||||
|
||||
/* Test for common environment variables (post NT4) */
|
||||
if (!GetEnvironmentVariableA("ALLUSERSPROFILE", NULL, 0))
|
||||
if (!GetEnvironmentVariableA("ALLUSERSPROFILE", allusersprofile, sizeof(allusersprofile)))
|
||||
{
|
||||
win_skip("Some environment variables are not present on NT4\n");
|
||||
}
|
||||
|
@ -198,6 +198,9 @@ static void test_create_env(void)
|
|||
{
|
||||
r = get_env(env[j], common_post_nt4_vars[i].name, &st);
|
||||
expect_env(TRUE, r, common_post_nt4_vars[i].name);
|
||||
if (!strcmp(common_post_nt4_vars[i].name, "ALLUSERSPROFILE") ||
|
||||
!strcmp(common_post_nt4_vars[i].name, "ProgramData"))
|
||||
ok(!strcmp(st + strlen(common_post_nt4_vars[i].name) + 1, allusersprofile), "%s\n", st);
|
||||
if (r) HeapFree(GetProcessHeap(), 0, st);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -242,7 +242,7 @@ BOOL WINAPI CreateEnvironmentBlock( LPVOID* lpEnvironment,
|
|||
profiles_dir[len] = '\0';
|
||||
}
|
||||
|
||||
if (get_reg_value(env, hkey, L"Public", buf, UNICODE_STRING_MAX_CHARS))
|
||||
if (get_reg_value(env, hkey, L"ProgramData", buf, UNICODE_STRING_MAX_CHARS))
|
||||
{
|
||||
set_env_var(&env, L"ALLUSERSPROFILE", buf);
|
||||
set_env_var(&env, L"ProgramData", buf);
|
||||
|
|
Loading…
Reference in a new issue