Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d5400af7
Commit
d5400af7
authored
Jul 04, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Set environment variables for the various Wine paths.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
201d13a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
2 deletions
+38
-2
process.c
dlls/kernel32/process.c
+38
-2
No files found.
dlls/kernel32/process.c
View file @
d5400af7
...
...
@@ -676,6 +676,23 @@ static WCHAR *get_reg_value( HKEY hkey, const WCHAR *name )
return
ret
;
}
/* set an environment variable for one of the wine path variables */
static
void
set_wine_path_variable
(
const
WCHAR
*
name
,
const
char
*
unix_path
)
{
UNICODE_STRING
nt_name
,
var_name
;
ANSI_STRING
unix_name
;
RtlInitUnicodeString
(
&
var_name
,
name
);
if
(
unix_path
)
{
RtlInitAnsiString
(
&
unix_name
,
unix_path
);
if
(
wine_unix_to_nt_file_name
(
&
unix_name
,
&
nt_name
))
return
;
RtlSetEnvironmentVariable
(
NULL
,
&
var_name
,
&
nt_name
);
RtlFreeUnicodeString
(
&
nt_name
);
}
else
RtlSetEnvironmentVariable
(
NULL
,
&
var_name
,
NULL
);
}
/***********************************************************************
* set_additional_environment
...
...
@@ -697,12 +714,31 @@ static void set_additional_environment(void)
static
const
WCHAR
allusersW
[]
=
{
'A'
,
'L'
,
'L'
,
'U'
,
'S'
,
'E'
,
'R'
,
'S'
,
'P'
,
'R'
,
'O'
,
'F'
,
'I'
,
'L'
,
'E'
,
0
};
static
const
WCHAR
programdataW
[]
=
{
'P'
,
'r'
,
'o'
,
'g'
,
'r'
,
'a'
,
'm'
,
'D'
,
'a'
,
't'
,
'a'
,
0
};
static
const
WCHAR
publicW
[]
=
{
'P'
,
'U'
,
'B'
,
'L'
,
'I'
,
'C'
,
0
};
static
const
WCHAR
winedlldirW
[]
=
{
'W'
,
'I'
,
'N'
,
'E'
,
'D'
,
'L'
,
'L'
,
'D'
,
'I'
,
'R'
,
'%'
,
'u'
,
0
};
static
const
WCHAR
winehomedirW
[]
=
{
'W'
,
'I'
,
'N'
,
'E'
,
'H'
,
'O'
,
'M'
,
'E'
,
'D'
,
'I'
,
'R'
,
0
};
static
const
WCHAR
winedatadirW
[]
=
{
'W'
,
'I'
,
'N'
,
'E'
,
'D'
,
'A'
,
'T'
,
'A'
,
'D'
,
'I'
,
'R'
,
0
};
static
const
WCHAR
winebuilddirW
[]
=
{
'W'
,
'I'
,
'N'
,
'E'
,
'B'
,
'U'
,
'I'
,
'L'
,
'D'
,
'D'
,
'I'
,
'R'
,
0
};
static
const
WCHAR
wineconfigdirW
[]
=
{
'W'
,
'I'
,
'N'
,
'E'
,
'C'
,
'O'
,
'N'
,
'F'
,
'I'
,
'G'
,
'D'
,
'I'
,
'R'
,
0
};
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nameW
;
const
char
*
path
;
WCHAR
*
profile_dir
=
NULL
,
*
program_data_dir
=
NULL
,
*
public_dir
=
NULL
;
WCHAR
buf
[
MAX_COMPUTERNAME_LENGTH
+
1
];
WCHAR
buf
[
32
];
HANDLE
hkey
;
DWORD
len
;
DWORD
len
,
i
;
/* wine paths */
set_wine_path_variable
(
winedatadirW
,
wine_get_data_dir
()
);
set_wine_path_variable
(
winehomedirW
,
getenv
(
"HOME"
)
);
set_wine_path_variable
(
winebuilddirW
,
wine_get_build_dir
()
);
set_wine_path_variable
(
wineconfigdirW
,
wine_get_config_dir
()
);
for
(
i
=
0
;
(
path
=
wine_dll_enum_load_path
(
i
));
i
++
)
{
sprintfW
(
buf
,
winedlldirW
,
i
);
set_wine_path_variable
(
buf
,
path
);
}
sprintfW
(
buf
,
winedlldirW
,
i
);
set_wine_path_variable
(
buf
,
NULL
);
/* ComputerName */
len
=
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