server: Remove no longer needed hack for inheriting console from stdin.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2020-11-20 15:40:40 +01:00 committed by Alexandre Julliard
parent 8ca9b44fd1
commit c1bfa103a2
3 changed files with 3 additions and 41 deletions

View File

@ -595,36 +595,6 @@ int free_console( struct process *process )
return 1;
}
/* let process inherit the console from parent... this handle two cases :
* 1/ generic console inheritance
* 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, obj_handle_t handle, struct process *process,
obj_handle_t hconin )
{
struct console_input *console = NULL;
if (handle) return duplicate_handle( current->process, handle, process, 0, 0, DUP_HANDLE_SAME_ACCESS );
/* if parent is a renderer, then attach current process to its console
* a bit hacky....
*/
if (hconin && parent_thread)
{
/* FIXME: should we check some access rights ? */
if (!(console = (struct console_input *)get_handle_obj( parent_thread->process, hconin,
0, &console_input_ops )))
clear_error(); /* ignore error */
}
if (!console) return 0;
process->console = console;
console->num_proc++;
return alloc_handle( process, process->console,
SYNCHRONIZE | GENERIC_READ | GENERIC_WRITE, 0 );
}
struct thread *console_get_renderer( struct console_input *console )
{
return console->renderer;

View File

@ -1254,15 +1254,9 @@ DECL_HANDLER(new_process)
connect_process_winstation( process, parent_thread, parent );
/* set the process console */
if (!(req->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
* physical console
*/
info->data->console = inherit_console( parent_thread, info->data->console,
process, req->inherit_all ? info->data->hstdin : 0 );
}
if (info->data->console > 3)
info->data->console = duplicate_handle( parent, info->data->console, process,
0, 0, DUPLICATE_SAME_ACCESS );
if (!req->inherit_all && !(req->create_flags & CREATE_NEW_CONSOLE))
{

View File

@ -132,8 +132,6 @@ 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, 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 );