Commit b39a8d9e authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

server: Enhanced the console input object so that it doesn't require a wineconsole to be running.

parent 258dba1a
......@@ -1426,6 +1426,8 @@ struct alloc_console_request
unsigned int access;
unsigned int attributes;
process_id_t pid;
int input_fd;
char __pad_28[4];
};
struct alloc_console_reply
{
......@@ -5504,6 +5506,6 @@ union generic_reply
struct set_cursor_reply set_cursor_reply;
};
#define SERVER_PROTOCOL_VERSION 404
#define SERVER_PROTOCOL_VERSION 405
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
......@@ -596,6 +596,7 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna
req->access = GENERIC_READ | GENERIC_WRITE;
req->attributes = 0;
req->pid = pid;
req->input_fd = -1;
ret = !wine_server_call_err( req );
data->hConIn = wine_server_ptr_handle( reply->handle_in );
......
......@@ -426,8 +426,12 @@ static int debugger_attach( struct process *process, struct thread *debugger )
if (list_empty( &process->thread_list )) goto error; /* no thread running in the process */
/* don't let a debugger debug its console... won't work */
if (debugger->process->console && console_get_renderer(debugger->process->console)->process == process)
if (debugger->process->console)
{
struct thread *renderer = console_get_renderer(debugger->process->console);
if (renderer && renderer->process == process)
goto error;
}
suspend_process( process );
if (!set_process_debugger( process, debugger ))
......
......@@ -1137,6 +1137,7 @@ enum server_fd_type
unsigned int access; /* wanted access rights */
unsigned int attributes; /* object attributes */
process_id_t pid; /* pid of process which shall be attached to the console */
int input_fd; /* if pid=-1 (bare console to current process), fd for input */
@REPLY
obj_handle_t handle_in; /* handle to console input */
obj_handle_t event; /* handle to renderer events change notification */
......
......@@ -954,7 +954,8 @@ C_ASSERT( sizeof(struct set_socket_deferred_request) == 24 );
C_ASSERT( FIELD_OFFSET(struct alloc_console_request, access) == 12 );
C_ASSERT( FIELD_OFFSET(struct alloc_console_request, attributes) == 16 );
C_ASSERT( FIELD_OFFSET(struct alloc_console_request, pid) == 20 );
C_ASSERT( sizeof(struct alloc_console_request) == 24 );
C_ASSERT( FIELD_OFFSET(struct alloc_console_request, input_fd) == 24 );
C_ASSERT( sizeof(struct alloc_console_request) == 32 );
C_ASSERT( FIELD_OFFSET(struct alloc_console_reply, handle_in) == 8 );
C_ASSERT( FIELD_OFFSET(struct alloc_console_reply, event) == 12 );
C_ASSERT( sizeof(struct alloc_console_reply) == 16 );
......
......@@ -1588,6 +1588,7 @@ static void dump_alloc_console_request( const struct alloc_console_request *req
fprintf( stderr, " access=%08x", req->access );
fprintf( stderr, ", attributes=%08x", req->attributes );
fprintf( stderr, ", pid=%04x", req->pid );
fprintf( stderr, ", input_fd=%d", req->input_fd );
}
static void dump_alloc_console_reply( const struct alloc_console_reply *req )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment