Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c29621ff
Commit
c29621ff
authored
Feb 03, 2022
by
Derek Lesho
Committed by
Alexandre Julliard
Feb 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userenv: Set ProgramData in CreateEnvironmentBlock.
Signed-off-by:
Derek Lesho
<
dlesho@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ccf7b445
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
userenv.c
dlls/userenv/tests/userenv.c
+16
-1
userenv_main.c
dlls/userenv/userenv_main.c
+3
-0
No files found.
dlls/userenv/tests/userenv.c
View file @
c29621ff
...
...
@@ -78,7 +78,7 @@ static void test_create_env(void)
BOOL
r
,
is_wow64
=
FALSE
;
HANDLE
htok
;
WCHAR
*
env
[
4
];
char
*
st
,
systemroot
[
100
];
char
*
st
,
systemroot
[
100
]
,
programdata
[
100
]
;
int
i
,
j
;
static
const
struct
profile_item
common_vars
[]
=
{
...
...
@@ -96,6 +96,7 @@ static void test_create_env(void)
};
static
const
struct
profile_item
common_post_nt4_vars
[]
=
{
{
"ALLUSERSPROFILE"
},
{
"ProgramData"
},
{
"TEMP"
},
{
"TMP"
},
{
"CommonProgramFiles"
},
...
...
@@ -119,6 +120,12 @@ static void test_create_env(void)
r
=
SetEnvironmentVariableA
(
"SystemRoot"
,
"overwrite"
);
expect
(
TRUE
,
r
);
r
=
GetEnvironmentVariableA
(
"ProgramData"
,
programdata
,
sizeof
(
programdata
));
ok
(
r
!=
0
,
"GetEnvironmentVariable failed (%d)
\n
"
,
GetLastError
());
r
=
SetEnvironmentVariableA
(
"ProgramData"
,
"overwrite"
);
expect
(
TRUE
,
r
);
if
(
0
)
{
/* Crashes on NT4 */
...
...
@@ -151,12 +158,20 @@ static void test_create_env(void)
r
=
SetEnvironmentVariableA
(
"SystemRoot"
,
systemroot
);
expect
(
TRUE
,
r
);
r
=
SetEnvironmentVariableA
(
"ProgramData"
,
programdata
);
expect
(
TRUE
,
r
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
r
=
get_env
(
env
[
i
],
"SystemRoot"
,
&
st
);
ok
(
!
strcmp
(
st
,
"SystemRoot=overwrite"
),
"%s
\n
"
,
st
);
expect
(
TRUE
,
r
);
HeapFree
(
GetProcessHeap
(),
0
,
st
);
r
=
get_env
(
env
[
i
],
"ProgramData"
,
&
st
);
ok
(
strcmp
(
st
,
"ProgramData=overwrite"
),
"%s
\n
"
,
st
);
expect
(
TRUE
,
r
);
HeapFree
(
GetProcessHeap
(),
0
,
st
);
}
/* Test for common environment variables (NT4 and higher) */
...
...
dlls/userenv/userenv_main.c
View file @
c29621ff
...
...
@@ -243,7 +243,10 @@ BOOL WINAPI CreateEnvironmentBlock( LPVOID* lpEnvironment,
}
if
(
get_reg_value
(
env
,
hkey
,
L"Public"
,
buf
,
UNICODE_STRING_MAX_CHARS
))
{
set_env_var
(
&
env
,
L"ALLUSERSPROFILE"
,
buf
);
set_env_var
(
&
env
,
L"ProgramData"
,
buf
);
}
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment