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
5dc91e6c
Commit
5dc91e6c
authored
Dec 15, 2004
by
Rein Klazes
Committed by
Alexandre Julliard
Dec 15, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A starting process must obey the STARTF_USESTDHANDLES flag and use the
standard io handles from the StartupInfo structure, even if it is starting a new console.
parent
da10a46c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
console.c
dlls/kernel/console.c
+9
-2
process.c
server/process.c
+3
-8
No files found.
dlls/kernel/console.c
View file @
5dc91e6c
...
...
@@ -1142,6 +1142,7 @@ BOOL WINAPI AllocConsole(void)
if
(
!
start_console_renderer
(
&
siConsole
))
goto
the_end
;
if
(
!
(
siCurrent
.
dwFlags
&
STARTF_USESTDHANDLES
)
)
{
/* all std I/O handles are inheritable by default */
sa
.
nLength
=
sizeof
(
sa
);
sa
.
lpSecurityDescriptor
=
NULL
;
...
...
@@ -1155,9 +1156,15 @@ BOOL WINAPI AllocConsole(void)
0
,
&
sa
,
OPEN_EXISTING
,
0
,
0
);
if
(
handle_out
==
INVALID_HANDLE_VALUE
)
goto
the_end
;
if
(
!
DuplicateHandle
(
GetCurrentProcess
(),
handle_out
,
GetCurrentProcess
(),
&
handle_err
,
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
))
if
(
!
DuplicateHandle
(
GetCurrentProcess
(),
handle_out
,
GetCurrentProcess
()
,
&
handle_err
,
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
))
goto
the_end
;
}
else
{
/* STARTF_USESTDHANDLES flag: use handles from StartupInfo */
handle_in
=
siCurrent
.
hStdInput
;
handle_out
=
siCurrent
.
hStdOutput
;
handle_err
=
siCurrent
.
hStdError
;
}
/* NT resets the STD_*_HANDLEs on console alloc */
SetStdHandle
(
STD_INPUT_HANDLE
,
handle_in
);
...
...
server/process.c
View file @
5dc91e6c
...
...
@@ -207,12 +207,9 @@ static void set_process_startup_state( struct process *process, enum startup_sta
static
int
set_process_console
(
struct
process
*
process
,
struct
thread
*
parent_thread
,
struct
startup_info
*
info
,
struct
init_process_reply
*
reply
)
{
if
(
process
->
create_flags
&
CREATE_NEW_CONSOLE
)
if
(
info
)
{
/* let the process init do the allocation */
return
1
;
}
else
if
(
info
&&
!
(
process
->
create_flags
&
DETACHED_PROCESS
))
if
(
!
(
process
->
create_flags
&
(
DETACHED_PROCESS
|
CREATE_NEW_CONSOLE
)))
{
/* FIXME: some better error checking should be done...
* like if hConOut and hConIn are console handles, then they should be on the same
...
...
@@ -220,9 +217,7 @@ static int set_process_console( struct process *process, struct thread *parent_t
*/
inherit_console
(
parent_thread
,
process
,
info
->
inherit_all
?
info
->
hstdin
:
0
);
}
if
(
info
)
{
if
(
!
info
->
inherit_all
)
if
(
!
info
->
inherit_all
&&
!
(
process
->
create_flags
&
CREATE_NEW_CONSOLE
))
{
reply
->
hstdin
=
duplicate_handle
(
parent_thread
->
process
,
info
->
hstdin
,
process
,
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
);
...
...
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