Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Mayr
wine
Commits
4073805a
Commit
4073805a
authored
16 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
kernel32: If necessary reload the environment after wineboot has run.
parent
2f0b1112
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/kernel32/process.c
+34
-42
34 additions, 42 deletions
dlls/kernel32/process.c
with
34 additions
and
42 deletions
dlls/kernel32/process.c
+
34
−
42
View file @
4073805a
...
...
@@ -372,7 +372,7 @@ static void set_registry_variables( HANDLE hkey, ULONG type )
* %SystemRoot% which are predefined. But Wine defines these in the
* registry, so we need two passes.
*/
static
void
set_registry_environment
(
void
)
static
BOOL
set_registry_environment
(
void
)
{
static
const
WCHAR
env_keyW
[]
=
{
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
...
...
@@ -385,6 +385,7 @@ static void set_registry_environment(void)
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nameW
;
HANDLE
hkey
;
BOOL
ret
=
FALSE
;
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
...
...
@@ -400,10 +401,11 @@ static void set_registry_environment(void)
set_registry_variables
(
hkey
,
REG_SZ
);
set_registry_variables
(
hkey
,
REG_EXPAND_SZ
);
NtClose
(
hkey
);
ret
=
TRUE
;
}
/* then the ones for the current user */
if
(
RtlOpenCurrentUser
(
KEY_ALL_ACCESS
,
&
attr
.
RootDirectory
)
!=
STATUS_SUCCESS
)
return
;
if
(
RtlOpenCurrentUser
(
KEY_ALL_ACCESS
,
&
attr
.
RootDirectory
)
!=
STATUS_SUCCESS
)
return
ret
;
RtlInitUnicodeString
(
&
nameW
,
envW
);
if
(
NtOpenKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
)
==
STATUS_SUCCESS
)
{
...
...
@@ -412,6 +414,7 @@ static void set_registry_environment(void)
NtClose
(
hkey
);
}
NtClose
(
attr
.
RootDirectory
);
return
ret
;
}
/***********************************************************************
...
...
@@ -730,45 +733,6 @@ static void init_windows_dirs(void)
}
/***********************************************************************
* process_init
*
* Main process initialisation code
*/
static
BOOL
process_init
(
void
)
{
static
const
WCHAR
kernel32W
[]
=
{
'k'
,
'e'
,
'r'
,
'n'
,
'e'
,
'l'
,
'3'
,
'2'
,
0
};
PEB
*
peb
=
NtCurrentTeb
()
->
Peb
;
RTL_USER_PROCESS_PARAMETERS
*
params
=
peb
->
ProcessParameters
;
PTHREAD_Init
();
setbuf
(
stdout
,
NULL
);
setbuf
(
stderr
,
NULL
);
kernel32_handle
=
GetModuleHandleW
(
kernel32W
);
LOCALE_Init
();
if
(
!
params
->
Environment
)
{
/* Copy the parent environment */
if
(
!
build_initial_environment
(
__wine_main_environ
))
return
FALSE
;
/* convert old configuration to new format */
convert_old_config
();
set_registry_environment
();
set_additional_environment
();
}
init_windows_dirs
();
init_current_directory
(
&
params
->
CurrentDirectory
);
return
TRUE
;
}
/***********************************************************************
* start_wineboot
*
...
...
@@ -893,15 +857,41 @@ static void set_process_name( int argc, char *argv[] )
*/
void
__wine_kernel_init
(
void
)
{
static
const
WCHAR
kernel32W
[]
=
{
'k'
,
'e'
,
'r'
,
'n'
,
'e'
,
'l'
,
'3'
,
'2'
,
0
};
static
const
WCHAR
dotW
[]
=
{
'.'
,
0
};
static
const
WCHAR
exeW
[]
=
{
'.'
,
'e'
,
'x'
,
'e'
,
0
};
WCHAR
*
p
,
main_exe_name
[
MAX_PATH
+
1
];
PEB
*
peb
=
NtCurrentTeb
()
->
Peb
;
RTL_USER_PROCESS_PARAMETERS
*
params
=
peb
->
ProcessParameters
;
HANDLE
boot_event
=
0
;
BOOL
got_environment
=
TRUE
;
/* Initialize everything */
if
(
!
process_init
())
exit
(
1
);
PTHREAD_Init
();
setbuf
(
stdout
,
NULL
);
setbuf
(
stderr
,
NULL
);
kernel32_handle
=
GetModuleHandleW
(
kernel32W
);
LOCALE_Init
();
if
(
!
params
->
Environment
)
{
/* Copy the parent environment */
if
(
!
build_initial_environment
(
__wine_main_environ
))
exit
(
1
);
/* convert old configuration to new format */
convert_old_config
();
got_environment
=
set_registry_environment
();
set_additional_environment
();
}
init_windows_dirs
();
init_current_directory
(
&
params
->
CurrentDirectory
);
set_process_name
(
__wine_main_argc
,
__wine_main_argv
);
set_library_wargv
(
__wine_main_argv
);
...
...
@@ -954,6 +944,8 @@ void __wine_kernel_init(void)
{
if
(
WaitForSingleObject
(
boot_event
,
30000
))
WARN
(
"boot event wait timed out
\n
"
);
CloseHandle
(
boot_event
);
/* if we didn't find environment section, try again now that wineboot has run */
if
(
!
got_environment
)
set_registry_environment
();
}
LdrInitializeThunk
(
0
,
0
,
0
,
0
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment