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
4073805a
Commit
4073805a
authored
Apr 24, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: If necessary reload the environment after wineboot has run.
parent
2f0b1112
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
42 deletions
+34
-42
process.c
dlls/kernel32/process.c
+34
-42
No files found.
dlls/kernel32/process.c
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
;
}
/***********************************************************************
...
...
@@ -731,45 +734,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
*
* Start the wineboot process if necessary. Return the event to wait on.
...
...
@@ -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
);
...
...
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