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
30596feb
Commit
30596feb
authored
Aug 17, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Use passed console handle to inherit console for created process.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ca30fa5c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
26 deletions
+16
-26
process.c
dlls/kernelbase/process.c
+1
-0
console.c
server/console.c
+13
-24
process.c
server/process.c
+1
-1
process.h
server/process.h
+1
-1
No files found.
dlls/kernelbase/process.c
View file @
30596feb
...
...
@@ -193,6 +193,7 @@ static RTL_USER_PROCESS_PARAMETERS *create_process_params( const WCHAR *filename
if
(
flags
&
CREATE_NEW_PROCESS_GROUP
)
params
->
ConsoleFlags
=
1
;
if
(
flags
&
CREATE_NEW_CONSOLE
)
params
->
ConsoleHandle
=
(
HANDLE
)
1
;
/* KERNEL32_CONSOLE_ALLOC */
else
if
(
!
(
flags
&
DETACHED_PROCESS
))
params
->
ConsoleHandle
=
NtCurrentTeb
()
->
Peb
->
ProcessParameters
->
ConsoleHandle
;
if
(
startup
->
dwFlags
&
STARTF_USESTDHANDLES
)
{
...
...
server/console.c
View file @
30596feb
...
...
@@ -620,40 +620,29 @@ int free_console( struct process *process )
* 2/ parent is a renderer which launches process, and process should attach to the console
* rendered by parent
*/
obj_handle_t
inherit_console
(
struct
thread
*
parent_thread
,
struct
process
*
parent
,
struct
process
*
process
,
obj_handle_t
inherit_console
(
struct
thread
*
parent_thread
,
obj_handle_t
handle
,
struct
process
*
process
,
obj_handle_t
hconin
)
{
int
done
=
0
;
struct
console_input
*
console
=
NULL
;
if
(
handle
&&
!
(
console
=
(
struct
console_input
*
)
get_handle_obj
(
current
->
process
,
handle
,
0
,
&
console_input_ops
)))
return
0
;
/* if parent is a renderer, then attach current process to its console
* a bit hacky....
*/
if
(
hconin
&&
parent_thread
)
if
(
!
console
&&
hconin
&&
parent_thread
)
{
struct
console_input
*
console
;
/* FIXME: should we check some access rights ? */
if
((
console
=
(
struct
console_input
*
)
get_handle_obj
(
parent
,
hconin
,
0
,
&
console_input_ops
)))
{
if
(
console
->
renderer
==
parent_thread
)
{
process
->
console
=
(
struct
console_input
*
)
grab_object
(
console
);
process
->
console
->
num_proc
++
;
done
=
1
;
}
release_object
(
console
);
}
else
clear_error
();
/* ignore error */
}
/* otherwise, if parent has a console, attach child to this console */
if
(
!
done
&&
parent
->
console
)
{
process
->
console
=
(
struct
console_input
*
)
grab_object
(
parent
->
console
);
process
->
console
->
num_proc
++
;
if
(
!
(
console
=
(
struct
console_input
*
)
get_handle_obj
(
parent_thread
->
process
,
hconin
,
0
,
&
console_input_ops
)))
clear_error
();
/* ignore error */
}
if
(
!
console
)
return
0
;
if
(
!
process
->
console
)
return
0
;
process
->
console
=
console
;
console
->
num_proc
++
;
return
alloc_handle
(
process
,
process
->
console
,
SYNCHRONIZE
|
FILE_READ_ATTRIBUTES
|
FILE_WRITE_ATTRIBUTES
,
0
);
}
...
...
server/process.c
View file @
30596feb
...
...
@@ -1224,7 +1224,7 @@ DECL_HANDLER(new_process)
* like if hConOut and hConIn are console handles, then they should be on the same
* physical console
*/
info
->
data
->
console
=
inherit_console
(
parent_thread
,
parent
,
info
->
data
->
console
=
inherit_console
(
parent_thread
,
info
->
data
->
console
,
process
,
req
->
inherit_all
?
info
->
data
->
hstdin
:
0
);
}
...
...
server/process.h
View file @
30596feb
...
...
@@ -131,7 +131,7 @@ extern void detach_debugged_processes( struct thread *debugger );
extern
void
enum_processes
(
int
(
*
cb
)(
struct
process
*
,
void
*
),
void
*
user
);
/* console functions */
extern
obj_handle_t
inherit_console
(
struct
thread
*
parent_thread
,
struct
process
*
parent
,
extern
obj_handle_t
inherit_console
(
struct
thread
*
parent_thread
,
obj_handle_t
handle
,
struct
process
*
process
,
obj_handle_t
hconin
);
extern
int
free_console
(
struct
process
*
process
);
extern
struct
thread
*
console_get_renderer
(
struct
console_input
*
console
);
...
...
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