Commit fac494c8 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

server: open_console's from field should be a handle.

parent f386950f
......@@ -210,13 +210,13 @@ BOOL WINAPI Beep( DWORD dwFreq, DWORD dwDur )
*/
HANDLE WINAPI OpenConsoleW(LPCWSTR name, DWORD access, BOOL inherit, DWORD creation)
{
BOOL output;
HANDLE output;
HANDLE ret;
if (strcmpiW(coninW, name) == 0)
output = FALSE;
output = (HANDLE) FALSE;
else if (strcmpiW(conoutW, name) == 0)
output = TRUE;
output = (HANDLE) TRUE;
else
{
SetLastError(ERROR_INVALID_NAME);
......
......@@ -1082,7 +1082,7 @@ struct get_console_renderer_events_reply
struct open_console_request
{
struct request_header __header;
int from;
obj_handle_t from;
unsigned int access;
unsigned int attributes;
......@@ -4382,6 +4382,6 @@ union generic_reply
struct query_symlink_reply query_symlink_reply;
};
#define SERVER_PROTOCOL_VERSION 235
#define SERVER_PROTOCOL_VERSION 236
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
......@@ -274,7 +274,7 @@ int WINECON_GrabChanges(struct inner_data* data)
case CONSOLE_RENDERER_ACTIVE_SB_EVENT:
SERVER_START_REQ( open_console )
{
req->from = (int)data->hConIn;
req->from = data->hConIn;
req->access = GENERIC_READ | GENERIC_WRITE;
req->attributes = 0;
req->share = FILE_SHARE_READ | FILE_SHARE_WRITE;
......
......@@ -1311,26 +1311,23 @@ DECL_HANDLER(open_console)
struct object *obj = NULL;
reply->handle = 0;
switch (req->from)
if (req->from == (obj_handle_t)0)
{
case 0:
if (current->process->console && current->process->console->renderer)
obj = grab_object( (struct object*)current->process->console );
break;
case 1:
}
else if (req->from == (obj_handle_t)1)
{
if (current->process->console && current->process->console->renderer &&
current->process->console->active)
obj = grab_object( (struct object*)current->process->console->active );
break;
default:
if ((obj = get_handle_obj( current->process, (obj_handle_t)req->from,
CONSOLE_READ|CONSOLE_WRITE, &console_input_ops )))
{
struct console_input* console = (struct console_input*)obj;
obj = (console->active) ? grab_object( console->active ) : NULL;
release_object( console );
}
break;
}
else if ((obj = get_handle_obj( current->process, req->from,
CONSOLE_READ|CONSOLE_WRITE, &console_input_ops )))
{
struct console_input *console = (struct console_input *)obj;
obj = (console->active) ? grab_object( console->active ) : NULL;
release_object( console );
}
/* FIXME: req->share is not used (as in screen buffer creation) */
......
......@@ -822,7 +822,7 @@ struct console_renderer_event
/* Open a handle to the process console */
@REQ(open_console)
int from; /* 0 (resp 1) input (resp output) of current process console */
obj_handle_t from; /* 0 (resp 1) input (resp output) of current process console */
/* otherwise console_in handle to get active screen buffer? */
unsigned int access; /* wanted access rights */
unsigned int attributes; /* object attributes */
......
......@@ -1245,7 +1245,7 @@ static void dump_get_console_renderer_events_reply( const struct get_console_ren
static void dump_open_console_request( const struct open_console_request *req )
{
fprintf( stderr, " from=%d,", req->from );
fprintf( stderr, " from=%p,", req->from );
fprintf( stderr, " access=%08x,", req->access );
fprintf( stderr, " attributes=%08x,", req->attributes );
fprintf( stderr, " share=%d", req->share );
......
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