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
b9f531a0
Commit
b9f531a0
authored
Jun 29, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move the console handle initialization to the Unix library.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ed566a87
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
9 deletions
+22
-9
env.c
dlls/ntdll/env.c
+2
-8
env.c
dlls/ntdll/unix/env.c
+15
-0
loader.c
dlls/ntdll/unix/loader.c
+1
-0
unix_private.h
dlls/ntdll/unix/unix_private.h
+1
-0
unixlib.h
dlls/ntdll/unixlib.h
+3
-1
No files found.
dlls/ntdll/env.c
View file @
b9f531a0
...
...
@@ -1286,14 +1286,8 @@ void init_user_process_params( SIZE_T data_size )
RtlFreeUnicodeString
(
&
cmdline
);
RtlReleasePath
(
load_path
);
if
(
isatty
(
0
)
||
isatty
(
1
)
||
isatty
(
2
))
params
->
ConsoleHandle
=
(
HANDLE
)
2
;
/* see kernel32/kernel_private.h */
if
(
!
isatty
(
0
))
wine_server_fd_to_handle
(
0
,
GENERIC_READ
|
SYNCHRONIZE
,
OBJ_INHERIT
,
&
params
->
hStdInput
);
if
(
!
isatty
(
1
))
wine_server_fd_to_handle
(
1
,
GENERIC_WRITE
|
SYNCHRONIZE
,
OBJ_INHERIT
,
&
params
->
hStdOutput
);
if
(
!
isatty
(
2
))
wine_server_fd_to_handle
(
2
,
GENERIC_WRITE
|
SYNCHRONIZE
,
OBJ_INHERIT
,
&
params
->
hStdError
);
unix_funcs
->
get_initial_console
(
&
params
->
ConsoleHandle
,
&
params
->
hStdInput
,
&
params
->
hStdOutput
,
&
params
->
hStdError
);
params
->
wShowWindow
=
1
;
/* SW_SHOWNORMAL */
run_wineboot
(
&
params
->
Environment
);
...
...
dlls/ntdll/unix/env.c
View file @
b9f531a0
...
...
@@ -955,6 +955,21 @@ NTSTATUS CDECL get_dynamic_environment( WCHAR *env, SIZE_T *size )
/*************************************************************************
* get_initial_console
*
* Return the initial console handles.
*/
void
CDECL
get_initial_console
(
HANDLE
*
handle
,
HANDLE
*
std_in
,
HANDLE
*
std_out
,
HANDLE
*
std_err
)
{
*
handle
=
*
std_in
=
*
std_out
=
*
std_err
=
0
;
if
(
isatty
(
0
)
||
isatty
(
1
)
||
isatty
(
2
))
*
handle
=
(
HANDLE
)
2
;
/* see kernel32/kernel_private.h */
if
(
!
isatty
(
0
))
server_fd_to_handle
(
0
,
GENERIC_READ
|
SYNCHRONIZE
,
OBJ_INHERIT
,
std_in
);
if
(
!
isatty
(
1
))
server_fd_to_handle
(
1
,
GENERIC_WRITE
|
SYNCHRONIZE
,
OBJ_INHERIT
,
std_out
);
if
(
!
isatty
(
2
))
server_fd_to_handle
(
2
,
GENERIC_WRITE
|
SYNCHRONIZE
,
OBJ_INHERIT
,
std_err
);
}
/*************************************************************************
* get_initial_directory
*
* Get the current directory at startup.
...
...
dlls/ntdll/unix/loader.c
View file @
b9f531a0
...
...
@@ -1491,6 +1491,7 @@ static struct unix_funcs unix_funcs =
ntdll_tan
,
get_initial_environment
,
get_dynamic_environment
,
get_initial_console
,
get_initial_directory
,
get_unix_codepage
,
get_locales
,
...
...
dlls/ntdll/unix/unix_private.h
View file @
b9f531a0
...
...
@@ -99,6 +99,7 @@ int CDECL mmap_enum_reserved_areas( int (CDECL *enum_func)(void *base, SIZE_T s
extern
NTSTATUS
CDECL
get_initial_environment
(
WCHAR
**
wargv
[],
WCHAR
*
env
,
SIZE_T
*
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
;
extern
void
CDECL
get_unix_codepage
(
CPTABLEINFO
*
table
)
DECLSPEC_HIDDEN
;
extern
void
CDECL
get_locales
(
WCHAR
*
sys
,
WCHAR
*
user
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
CDECL
virtual_map_section
(
HANDLE
handle
,
PVOID
*
addr_ptr
,
unsigned
short
zero_bits_64
,
SIZE_T
commit_size
,
...
...
dlls/ntdll/unixlib.h
View file @
b9f531a0
...
...
@@ -29,7 +29,7 @@ struct msghdr;
struct
_DISPATCHER_CONTEXT
;
/* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 6
4
#define NTDLL_UNIXLIB_VERSION 6
5
struct
unix_funcs
{
...
...
@@ -300,6 +300,8 @@ struct unix_funcs
/* environment functions */
NTSTATUS
(
CDECL
*
get_initial_environment
)(
WCHAR
**
wargv
[],
WCHAR
*
env
,
SIZE_T
*
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
);
void
(
CDECL
*
get_initial_directory
)(
UNICODE_STRING
*
dir
);
void
(
CDECL
*
get_unix_codepage
)(
CPTABLEINFO
*
table
);
void
(
CDECL
*
get_locales
)(
WCHAR
*
sys
,
WCHAR
*
user
);
...
...
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