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
15c3eaaf
Commit
15c3eaaf
authored
Jun 29, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move retrieving the startup info to the Unix library.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f1ff598e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
44 additions
and
22 deletions
+44
-22
env.c
dlls/ntdll/env.c
+5
-15
loader.c
dlls/ntdll/loader.c
+2
-2
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+1
-1
env.c
dlls/ntdll/unix/env.c
+27
-0
loader.c
dlls/ntdll/unix/loader.c
+1
-0
process.c
dlls/ntdll/unix/process.c
+2
-0
thread.c
dlls/ntdll/unix/thread.c
+2
-3
unix_private.h
dlls/ntdll/unix/unix_private.h
+2
-0
unixlib.h
dlls/ntdll/unixlib.h
+2
-1
No files found.
dlls/ntdll/env.c
View file @
15c3eaaf
...
...
@@ -1247,16 +1247,16 @@ wait:
*
* Fill the initial RTL_USER_PROCESS_PARAMETERS structure from the server.
*/
void
init_user_process_params
(
SIZE_T
data_size
)
void
init_user_process_params
(
void
)
{
WCHAR
*
src
,
*
load_path
,
*
dummy
;
SIZE_T
info_size
,
env_size
;
NTSTATUS
status
;
SIZE_T
info_size
,
env_size
,
data_size
=
0
;
startup_info_t
*
info
=
NULL
;
RTL_USER_PROCESS_PARAMETERS
*
params
=
NULL
;
UNICODE_STRING
curdir
,
dllpath
,
imagepath
,
cmdline
,
title
,
desktop
,
shellinfo
,
runtime
;
WCHAR
**
wargv
;
unix_funcs
->
get_startup_info
(
NULL
,
&
data_size
,
&
info_size
);
if
(
!
data_size
)
{
RTL_USER_PROCESS_PARAMETERS
initial_params
=
{
0
};
...
...
@@ -1296,18 +1296,7 @@ void init_user_process_params( SIZE_T data_size )
if
(
!
(
info
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
data_size
)))
return
;
SERVER_START_REQ
(
get_startup_info
)
{
wine_server_set_reply
(
req
,
info
,
data_size
);
if
(
!
(
status
=
wine_server_call
(
req
)))
{
data_size
=
wine_server_reply_size
(
reply
);
info_size
=
reply
->
info_size
;
env_size
=
data_size
-
info_size
;
}
}
SERVER_END_REQ
;
if
(
status
)
goto
done
;
if
(
unix_funcs
->
get_startup_info
(
info
,
&
data_size
,
&
info_size
))
goto
done
;
src
=
(
WCHAR
*
)(
info
+
1
);
get_unicode_string
(
&
curdir
,
&
src
,
info
->
curdir_len
);
...
...
@@ -1344,6 +1333,7 @@ void init_user_process_params( SIZE_T data_size )
params
->
wShowWindow
=
info
->
show
;
/* environment needs to be a separate memory block */
env_size
=
data_size
-
info_size
;
if
((
params
->
Environment
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
max
(
env_size
,
sizeof
(
WCHAR
)
))))
{
if
(
env_size
)
memcpy
(
params
->
Environment
,
(
char
*
)
info
+
info_size
,
env_size
);
...
...
dlls/ntdll/loader.c
View file @
15c3eaaf
...
...
@@ -3960,7 +3960,7 @@ void __wine_process_init(void)
init_unix_codepage
();
init_directories
();
init_user_process_params
(
info_size
);
init_user_process_params
();
params
=
peb
->
ProcessParameters
;
load_global_options
();
...
...
@@ -4000,7 +4000,7 @@ void __wine_process_init(void)
}
else
{
if
(
!
info_size
)
status
=
restart_process
(
params
,
status
);
status
=
restart_process
(
params
,
status
);
switch
(
status
)
{
case
STATUS_INVALID_IMAGE_WIN_64
:
...
...
dlls/ntdll/ntdll_misc.h
View file @
15c3eaaf
...
...
@@ -69,7 +69,7 @@ extern void actctx_init(void) DECLSPEC_HIDDEN;
extern
void
heap_set_debug_flags
(
HANDLE
handle
)
DECLSPEC_HIDDEN
;
extern
void
init_unix_codepage
(
void
)
DECLSPEC_HIDDEN
;
extern
void
init_locale
(
HMODULE
module
)
DECLSPEC_HIDDEN
;
extern
void
init_user_process_params
(
SIZE_T
data_size
)
DECLSPEC_HIDDEN
;
extern
void
init_user_process_params
(
void
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
restart_process
(
RTL_USER_PROCESS_PARAMETERS
*
params
,
NTSTATUS
status
)
DECLSPEC_HIDDEN
;
/* server support */
...
...
dlls/ntdll/unix/env.c
View file @
15c3eaaf
...
...
@@ -66,6 +66,7 @@ extern char **__wine_main_environ;
extern
WCHAR
**
__wine_main_wargv
;
USHORT
*
uctable
=
NULL
,
*
lctable
=
NULL
;
SIZE_T
startup_info_size
=
0
;
int
main_argc
=
0
;
char
**
main_argv
=
NULL
;
...
...
@@ -904,6 +905,32 @@ static void add_path_var( WCHAR *env, SIZE_T *pos, const char *name, const char
/*************************************************************************
* get_startup_info
*
* Get the startup information from the server.
*/
NTSTATUS
CDECL
get_startup_info
(
startup_info_t
*
info
,
SIZE_T
*
total_size
,
SIZE_T
*
info_size
)
{
NTSTATUS
status
;
if
(
*
total_size
<
startup_info_size
)
{
*
total_size
=
startup_info_size
;
return
STATUS_BUFFER_TOO_SMALL
;
}
SERVER_START_REQ
(
get_startup_info
)
{
wine_server_set_reply
(
req
,
info
,
*
total_size
);
status
=
wine_server_call
(
req
);
*
total_size
=
wine_server_reply_size
(
reply
);
*
info_size
=
reply
->
info_size
;
}
SERVER_END_REQ
;
return
status
;
}
/*************************************************************************
* get_dynamic_environment
*
* Get the environment variables that can differ between processes.
...
...
dlls/ntdll/unix/loader.c
View file @
15c3eaaf
...
...
@@ -1497,6 +1497,7 @@ static struct unix_funcs unix_funcs =
ntdll_sqrt
,
ntdll_tan
,
get_initial_environment
,
get_startup_info
,
get_dynamic_environment
,
get_initial_console
,
get_initial_directory
,
...
...
dlls/ntdll/unix/process.c
View file @
15c3eaaf
...
...
@@ -591,6 +591,8 @@ NTSTATUS CDECL exec_process( UNICODE_STRING *path, UNICODE_STRING *cmdline, NTST
char
**
argv
;
HANDLE
handle
;
if
(
startup_info_size
)
return
status
;
/* started from another Win32 process */
switch
(
status
)
{
case
STATUS_CONFLICTING_ADDRESSES
:
...
...
dlls/ntdll/unix/thread.c
View file @
15c3eaaf
...
...
@@ -90,7 +90,6 @@ TEB * CDECL init_threading( SIZE_T *size )
{
TEB
*
teb
;
BOOL
suspend
;
SIZE_T
info_size
;
teb
=
virtual_alloc_first_teb
();
...
...
@@ -99,14 +98,14 @@ TEB * CDECL init_threading( SIZE_T *size )
signal_init_thread
(
teb
);
dbg_init
();
server_init_process
();
info_size
=
server_init_thread
(
teb
->
Peb
,
&
suspend
);
startup_
info_size
=
server_init_thread
(
teb
->
Peb
,
&
suspend
);
virtual_map_user_shared_data
();
virtual_create_builtin_view
(
ntdll_module
);
init_cpu_info
();
init_files
();
NtCreateKeyedEvent
(
&
keyed_event
,
GENERIC_READ
|
GENERIC_WRITE
,
NULL
,
0
);
if
(
size
)
*
size
=
info_size
;
if
(
size
)
*
size
=
startup_
info_size
;
return
teb
;
}
...
...
dlls/ntdll/unix/unix_private.h
View file @
15c3eaaf
...
...
@@ -96,6 +96,7 @@ int CDECL mmap_is_in_reserved_area( void *addr, SIZE_T size ) DECLSPEC_HIDDEN;
int
CDECL
mmap_enum_reserved_areas
(
int
(
CDECL
*
enum_func
)(
void
*
base
,
SIZE_T
size
,
void
*
arg
),
void
*
arg
,
int
top_down
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
CDECL
get_initial_environment
(
WCHAR
**
wargv
[],
WCHAR
*
env
,
SIZE_T
*
size
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
CDECL
get_startup_info
(
startup_info_t
*
info
,
SIZE_T
*
total_size
,
SIZE_T
*
info_size
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
CDECL
get_dynamic_environment
(
WCHAR
*
env
,
SIZE_T
*
size
)
DECLSPEC_HIDDEN
;
extern
void
CDECL
get_initial_directory
(
UNICODE_STRING
*
dir
)
DECLSPEC_HIDDEN
;
extern
void
CDECL
get_initial_console
(
HANDLE
*
handle
,
HANDLE
*
std_in
,
HANDLE
*
std_out
,
HANDLE
*
std_err
)
DECLSPEC_HIDDEN
;
...
...
@@ -137,6 +138,7 @@ extern const char **dll_paths DECLSPEC_HIDDEN;
extern
HMODULE
ntdll_module
DECLSPEC_HIDDEN
;
extern
USHORT
*
uctable
DECLSPEC_HIDDEN
;
extern
USHORT
*
lctable
DECLSPEC_HIDDEN
;
extern
SIZE_T
startup_info_size
DECLSPEC_HIDDEN
;
extern
int
main_argc
DECLSPEC_HIDDEN
;
extern
char
**
main_argv
DECLSPEC_HIDDEN
;
extern
char
**
main_envp
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/unixlib.h
View file @
15c3eaaf
...
...
@@ -28,7 +28,7 @@ struct msghdr;
struct
_DISPATCHER_CONTEXT
;
/* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 6
7
#define NTDLL_UNIXLIB_VERSION 6
8
struct
unix_funcs
{
...
...
@@ -298,6 +298,7 @@ struct unix_funcs
/* environment functions */
NTSTATUS
(
CDECL
*
get_initial_environment
)(
WCHAR
**
wargv
[],
WCHAR
*
env
,
SIZE_T
*
size
);
NTSTATUS
(
CDECL
*
get_startup_info
)(
startup_info_t
*
info
,
SIZE_T
*
total_size
,
SIZE_T
*
info_size
);
NTSTATUS
(
CDECL
*
get_dynamic_environment
)(
WCHAR
*
env
,
SIZE_T
*
size
);
void
(
CDECL
*
get_initial_console
)(
HANDLE
*
handle
,
HANDLE
*
std_in
,
HANDLE
*
std_out
,
HANDLE
*
std_err
);
...
...
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