server: Report in get_console_mode request whether it's a bare console or not.

This commit is contained in:
Eric Pouech 2010-08-30 22:19:00 +02:00 committed by Alexandre Julliard
parent 6f32644aa0
commit 4fdcdefccf
5 changed files with 18 additions and 4 deletions

View file

@ -1548,7 +1548,7 @@ struct get_console_mode_reply
{
struct reply_header __header;
int mode;
char __pad_12[4];
int is_bare;
};
@ -5506,6 +5506,6 @@ union generic_reply
struct set_cursor_reply set_cursor_reply;
};
#define SERVER_PROTOCOL_VERSION 406
#define SERVER_PROTOCOL_VERSION 407
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */

View file

@ -188,6 +188,11 @@ static struct list screen_buffer_list = LIST_INIT(screen_buffer_list);
static const char_info_t empty_char_info = { ' ', 0x000f }; /* white on black space */
static int console_input_is_bare( struct console_input* cin )
{
return cin->evt == NULL;
}
static struct fd *console_input_get_fd( struct object* obj )
{
struct console_input *console_input = (struct console_input*)obj;
@ -582,7 +587,7 @@ static void propagate_console_signal( struct console_input *console,
enum_processes(propagate_console_signal_cb, &csi);
}
static int get_console_mode( obj_handle_t handle )
static int get_console_mode( obj_handle_t handle, int *bare )
{
struct object *obj;
int ret = 0;
@ -590,9 +595,15 @@ static int get_console_mode( obj_handle_t handle )
if ((obj = get_handle_obj( current->process, handle, FILE_READ_PROPERTIES, NULL )))
{
if (obj->ops == &console_input_ops)
{
ret = ((struct console_input *)obj)->mode;
*bare = console_input_is_bare((struct console_input *)obj);
}
else if (obj->ops == &screen_buffer_ops)
{
ret = ((struct screen_buffer *)obj)->mode;
*bare = console_input_is_bare(((struct screen_buffer *)obj)->input);
}
else
set_error( STATUS_OBJECT_TYPE_MISMATCH );
release_object( obj );
@ -1542,7 +1553,7 @@ DECL_HANDLER(get_console_input_info)
/* get a console mode (input or output) */
DECL_HANDLER(get_console_mode)
{
reply->mode = get_console_mode( req->handle );
reply->mode = get_console_mode( req->handle, &reply->is_bare );
}
/* set a console mode (input or output) */

View file

@ -1224,6 +1224,7 @@ struct console_renderer_event
obj_handle_t handle; /* handle to the console */
@REPLY
int mode; /* console mode */
int is_bare; /* whether the console has an evt_queue */
@END

View file

@ -976,6 +976,7 @@ C_ASSERT( sizeof(struct get_console_wait_event_reply) == 16 );
C_ASSERT( FIELD_OFFSET(struct get_console_mode_request, handle) == 12 );
C_ASSERT( sizeof(struct get_console_mode_request) == 16 );
C_ASSERT( FIELD_OFFSET(struct get_console_mode_reply, mode) == 8 );
C_ASSERT( FIELD_OFFSET(struct get_console_mode_reply, is_bare) == 12 );
C_ASSERT( sizeof(struct get_console_mode_reply) == 16 );
C_ASSERT( FIELD_OFFSET(struct set_console_mode_request, handle) == 12 );
C_ASSERT( FIELD_OFFSET(struct set_console_mode_request, mode) == 16 );

View file

@ -1641,6 +1641,7 @@ static void dump_get_console_mode_request( const struct get_console_mode_request
static void dump_get_console_mode_reply( const struct get_console_mode_reply *req )
{
fprintf( stderr, " mode=%d", req->mode );
fprintf( stderr, ", is_bare=%d", req->is_bare );
}
static void dump_set_console_mode_request( const struct set_console_mode_request *req )