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
0a19a07e
Commit
0a19a07e
authored
May 05, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set additional environment variables at startup from
HKLM\System\CurrentControlSet\Control\Session Manager\Environment.
parent
0040ba95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
process.c
dlls/kernel/process.c
+52
-0
No files found.
dlls/kernel/process.c
View file @
0a19a07e
...
...
@@ -401,6 +401,56 @@ static BOOL build_initial_environment( char **environ )
/***********************************************************************
* set_registry_environment
*
* Set the environment variables specified in the registry.
*/
static
void
set_registry_environment
(
void
)
{
static
const
WCHAR
env_keyW
[]
=
{
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'S'
,
'e'
,
't'
,
'\\'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'\\'
,
'S'
,
'e'
,
's'
,
's'
,
'i'
,
'o'
,
'n'
,
' '
,
'M'
,
'a'
,
'n'
,
'a'
,
'g'
,
'e'
,
'r'
,
'\\'
,
'E'
,
'n'
,
'v'
,
'i'
,
'r'
,
'o'
,
'n'
,
'm'
,
'e'
,
'n'
,
't'
,
0
};
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nameW
,
env_name
,
env_value
;
NTSTATUS
status
;
HKEY
hkey
;
DWORD
size
;
int
index
;
char
buffer
[
1024
+
sizeof
(
KEY_VALUE_FULL_INFORMATION
)];
KEY_VALUE_FULL_INFORMATION
*
info
=
(
KEY_VALUE_FULL_INFORMATION
*
)
buffer
;
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
ObjectName
=
&
nameW
;
attr
.
Attributes
=
0
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
RtlInitUnicodeString
(
&
nameW
,
env_keyW
);
if
(
NtOpenKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
)
!=
STATUS_SUCCESS
)
return
;
for
(
index
=
0
;
;
index
++
)
{
status
=
NtEnumerateValueKey
(
hkey
,
index
,
KeyValueFullInformation
,
buffer
,
sizeof
(
buffer
),
&
size
);
if
(
status
==
STATUS_BUFFER_OVERFLOW
)
continue
;
if
(
status
!=
STATUS_SUCCESS
)
break
;
if
(
info
->
Type
!=
REG_SZ
)
continue
;
/* FIXME: handle REG_EXPAND_SZ */
env_name
.
Buffer
=
info
->
Name
;
env_name
.
Length
=
env_name
.
MaximumLength
=
info
->
NameLength
;
env_value
.
Buffer
=
(
WCHAR
*
)(
buffer
+
info
->
DataOffset
);
env_value
.
Length
=
env_value
.
MaximumLength
=
info
->
DataLength
;
if
(
env_value
.
Length
&&
!
env_value
.
Buffer
[
env_value
.
Length
/
sizeof
(
WCHAR
)
-
1
])
env_value
.
Length
--
;
/* don't count terminating null if any */
RtlSetEnvironmentVariable
(
NULL
,
&
env_name
,
&
env_value
);
}
NtClose
(
hkey
);
}
/***********************************************************************
* set_library_wargv
*
* Set the Wine library Unicode argv global variables.
...
...
@@ -750,6 +800,8 @@ static BOOL process_init( char *argv[], char **environ )
}
SERVER_END_REQ
;
if
(
!
info_size
)
set_registry_environment
();
return
TRUE
;
}
...
...
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