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
3dadd980
Commit
3dadd980
authored
Nov 05, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Directly allocate the final process parameters structure.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e5354008
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
52 deletions
+21
-52
env.c
dlls/ntdll/env.c
+21
-50
loader.c
dlls/ntdll/loader.c
+0
-1
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+0
-1
No files found.
dlls/ntdll/env.c
View file @
3dadd980
...
...
@@ -1357,19 +1357,31 @@ void init_user_process_params( SIZE_T data_size )
if
(
!
data_size
)
{
if
(
RtlCreateProcessParametersEx
(
&
params
,
&
null_str
,
&
null_str
,
&
empty_str
,
&
null_str
,
NULL
,
&
null_str
,
&
null_str
,
&
null_str
,
&
null_str
,
RTL_USER_PROCESS_PARAMETERS
initial_params
=
{
0
};
WCHAR
*
env
,
curdir_buffer
[
MAX_PATH
];
NtCurrentTeb
()
->
Peb
->
ProcessParameters
=
&
initial_params
;
initial_params
.
Environment
=
build_initial_environment
(
__wine_get_main_environment
()
);
curdir
.
Buffer
=
curdir_buffer
;
curdir
.
MaximumLength
=
sizeof
(
curdir_buffer
);
get_current_directory
(
&
curdir
);
initial_params
.
CurrentDirectory
.
DosPath
=
curdir
;
get_image_path
(
__wine_main_argv
[
0
],
&
initial_params
.
ImagePathName
);
set_library_wargv
(
__wine_main_argv
,
&
initial_params
.
ImagePathName
);
build_command_line
(
__wine_main_wargv
,
&
cmdline
);
LdrGetDllPath
(
initial_params
.
ImagePathName
.
Buffer
,
0
,
&
load_path
,
&
dummy
);
RtlInitUnicodeString
(
&
dllpath
,
load_path
);
env
=
initial_params
.
Environment
;
initial_params
.
Environment
=
NULL
;
/* avoid copying it */
if
(
RtlCreateProcessParametersEx
(
&
params
,
&
initial_params
.
ImagePathName
,
&
dllpath
,
&
curdir
,
&
cmdline
,
NULL
,
&
initial_params
.
ImagePathName
,
NULL
,
NULL
,
NULL
,
PROCESS_PARAMS_FLAG_NORMALIZED
))
return
;
params
->
Environment
=
env
;
NtCurrentTeb
()
->
Peb
->
ProcessParameters
=
params
;
params
->
Environment
=
build_initial_environment
(
__wine_get_main_environment
()
);
get_current_directory
(
&
params
->
CurrentDirectory
.
DosPath
);
get_image_path
(
__wine_main_argv
[
0
],
&
params
->
ImagePathName
);
set_library_wargv
(
__wine_main_argv
,
&
params
->
ImagePathName
);
build_command_line
(
__wine_main_wargv
,
&
params
->
CommandLine
);
LdrGetDllPath
(
params
->
ImagePathName
.
Buffer
,
0
,
&
load_path
,
&
dummy
);
RtlCreateUnicodeString
(
&
params
->
DllPath
,
load_path
);
RtlFreeUnicodeString
(
&
cmdline
);
RtlReleasePath
(
load_path
);
if
(
isatty
(
0
)
||
isatty
(
1
)
||
isatty
(
2
))
...
...
@@ -1455,44 +1467,3 @@ done:
}
set_wow64_environment
(
&
params
->
Environment
);
}
/***********************************************************************
* update_user_process_params
*
* Rebuild the RTL_USER_PROCESS_PARAMETERS structure once we have initialized all the fields.
*/
void
update_user_process_params
(
const
UNICODE_STRING
*
image
)
{
RTL_USER_PROCESS_PARAMETERS
*
params
,
*
cur_params
=
NtCurrentTeb
()
->
Peb
->
ProcessParameters
;
UNICODE_STRING
title
=
cur_params
->
WindowTitle
;
WCHAR
*
env
=
cur_params
->
Environment
;
cur_params
->
Environment
=
NULL
;
/* avoid copying it */
if
(
!
title
.
Buffer
)
title
=
*
image
;
if
(
RtlCreateProcessParametersEx
(
&
params
,
image
,
&
cur_params
->
DllPath
,
NULL
,
&
cur_params
->
CommandLine
,
NULL
,
&
title
,
&
cur_params
->
Desktop
,
&
cur_params
->
ShellInfo
,
&
cur_params
->
RuntimeInfo
,
PROCESS_PARAMS_FLAG_NORMALIZED
))
return
;
params
->
DebugFlags
=
cur_params
->
DebugFlags
;
params
->
ConsoleHandle
=
cur_params
->
ConsoleHandle
;
params
->
ConsoleFlags
=
cur_params
->
ConsoleFlags
;
params
->
hStdInput
=
cur_params
->
hStdInput
;
params
->
hStdOutput
=
cur_params
->
hStdOutput
;
params
->
hStdError
=
cur_params
->
hStdError
;
params
->
dwX
=
cur_params
->
dwX
;
params
->
dwY
=
cur_params
->
dwY
;
params
->
dwXSize
=
cur_params
->
dwXSize
;
params
->
dwYSize
=
cur_params
->
dwYSize
;
params
->
dwXCountChars
=
cur_params
->
dwXCountChars
;
params
->
dwYCountChars
=
cur_params
->
dwYCountChars
;
params
->
dwFillAttribute
=
cur_params
->
dwFillAttribute
;
params
->
dwFlags
=
cur_params
->
dwFlags
;
params
->
wShowWindow
=
cur_params
->
wShowWindow
;
params
->
Environment
=
env
;
RtlFreeHeap
(
GetProcessHeap
(),
0
,
cur_params
);
NtCurrentTeb
()
->
Peb
->
ProcessParameters
=
params
;
}
dlls/ntdll/loader.c
View file @
3dadd980
...
...
@@ -4268,7 +4268,6 @@ void __wine_process_init(void)
}
NtCurrentTeb
()
->
Peb
->
LoaderLock
=
&
loader_section
;
update_user_process_params
(
&
wm
->
ldr
.
FullDllName
);
version_init
(
wm
->
ldr
.
FullDllName
.
Buffer
);
virtual_set_large_address_space
();
...
...
dlls/ntdll/ntdll_misc.h
View file @
3dadd980
...
...
@@ -86,7 +86,6 @@ extern void virtual_init_threading(void) DECLSPEC_HIDDEN;
extern
void
fill_cpu_info
(
void
)
DECLSPEC_HIDDEN
;
extern
void
heap_set_debug_flags
(
HANDLE
handle
)
DECLSPEC_HIDDEN
;
extern
void
init_user_process_params
(
SIZE_T
data_size
)
DECLSPEC_HIDDEN
;
extern
void
update_user_process_params
(
const
UNICODE_STRING
*
image
)
DECLSPEC_HIDDEN
;
/* server support */
extern
timeout_t
server_start_time
DECLSPEC_HIDDEN
;
...
...
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