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
9122bc10
Commit
9122bc10
authored
Apr 27, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Avoid using wine_get_user_name() from libwine.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
73211637
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
env.c
dlls/ntdll/env.c
+18
-3
No files found.
dlls/ntdll/env.c
View file @
9122bc10
...
...
@@ -27,6 +27,9 @@
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_PWD_H
# include <pwd.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
...
...
@@ -386,15 +389,27 @@ static void set_wow64_environment( WCHAR **env )
UNICODE_STRING
valW
=
{
0
,
sizeof
(
buf
),
buf
};
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nameW
;
const
char
*
p
,
*
name
;
const
char
*
p
;
const
char
*
home
=
getenv
(
"HOME"
);
const
char
*
name
=
getenv
(
"USER"
);
WCHAR
*
val
;
HANDLE
hkey
;
DWORD
i
;
if
(
!
home
||
!
name
)
{
struct
passwd
*
pwd
=
getpwuid
(
getuid
()
);
if
(
pwd
)
{
if
(
!
home
)
home
=
pwd
->
pw_dir
;
if
(
!
name
)
name
=
pwd
->
pw_name
;
}
}
/* set the Wine paths */
set_wine_path_variable
(
env
,
winedatadirW
,
wine_get_data_dir
()
);
set_wine_path_variable
(
env
,
winehomedirW
,
getenv
(
"HOME"
)
);
set_wine_path_variable
(
env
,
winehomedirW
,
home
);
set_wine_path_variable
(
env
,
winebuilddirW
,
wine_get_build_dir
()
);
set_wine_path_variable
(
env
,
wineconfigdirW
,
config_dir
);
for
(
i
=
0
;
(
p
=
wine_dll_enum_load_path
(
i
));
i
++
)
...
...
@@ -407,7 +422,7 @@ static void set_wow64_environment( WCHAR **env )
/* set user name */
name
=
wine_get_user_name
()
;
if
(
!
name
)
name
=
"wine"
;
if
((
p
=
strrchr
(
name
,
'/'
)))
name
=
p
+
1
;
if
((
p
=
strrchr
(
name
,
'\\'
)))
name
=
p
+
1
;
ntdll_umbstowcs
(
name
,
strlen
(
name
)
+
1
,
buf
,
ARRAY_SIZE
(
buf
)
);
...
...
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