Commit 3217abd7 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

server: Allow creating unbound console connection objects.

parent 74192f7a
...@@ -1330,8 +1330,11 @@ static struct object *create_console_connection( struct console_input *console ) ...@@ -1330,8 +1330,11 @@ static struct object *create_console_connection( struct console_input *console )
if (!(connection = alloc_object( &console_connection_ops ))) return NULL; if (!(connection = alloc_object( &console_connection_ops ))) return NULL;
current->process->console = (struct console_input *)grab_object( console ); if (console)
console->num_proc++; {
current->process->console = (struct console_input *)grab_object( console );
console->num_proc++;
}
return &connection->obj; return &connection->obj;
} }
...@@ -2305,6 +2308,7 @@ static void console_device_dump( struct object *obj, int verbose ) ...@@ -2305,6 +2308,7 @@ static void console_device_dump( struct object *obj, int verbose )
static struct object *console_device_lookup_name( struct object *obj, struct unicode_str *name, unsigned int attr ) static struct object *console_device_lookup_name( struct object *obj, struct unicode_str *name, unsigned int attr )
{ {
static const WCHAR connectionW[] = {'C','o','n','n','e','c','t','i','o','n'};
static const WCHAR consoleW[] = {'C','o','n','s','o','l','e'}; static const WCHAR consoleW[] = {'C','o','n','s','o','l','e'};
static const WCHAR current_inW[] = {'C','u','r','r','e','n','t','I','n'}; static const WCHAR current_inW[] = {'C','u','r','r','e','n','t','I','n'};
static const WCHAR current_outW[] = {'C','u','r','r','e','n','t','O','u','t'}; static const WCHAR current_outW[] = {'C','u','r','r','e','n','t','O','u','t'};
...@@ -2363,6 +2367,12 @@ static struct object *console_device_lookup_name( struct object *obj, struct uni ...@@ -2363,6 +2367,12 @@ static struct object *console_device_lookup_name( struct object *obj, struct uni
return create_console_server(); return create_console_server();
} }
if (name->len == sizeof(connectionW) && !memcmp( name->str, connectionW, name->len ))
{
name->len = 0;
return create_console_connection( NULL );
}
return NULL; return NULL;
} }
......
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