server: Report in get_console_mode request whether it's a bare console or not.
diff --git a/server/console.c b/server/console.c
index 905cc50..1fbf736 100644
--- a/server/console.c
+++ b/server/console.c
@@ -188,6 +188,11 @@
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 @@
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 @@
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 @@
/* 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) */