Jacek Caban : server: Allow creating unbound console connection objects.
Alexandre Julliard
julliard at winehq.org
Wed Sep 16 15:37:34 CDT 2020
Module: wine
Branch: master
Commit: 3217abd7a57e2b6bc3d7eb6c3de3d570cd5b86f8
URL: https://source.winehq.org/git/wine.git/?a=commit;h=3217abd7a57e2b6bc3d7eb6c3de3d570cd5b86f8
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Sep 16 20:39:10 2020 +0200
server: Allow creating unbound console connection objects.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
server/console.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/server/console.c b/server/console.c
index 50698a727f..95c087ae15 100644
--- a/server/console.c
+++ b/server/console.c
@@ -1330,8 +1330,11 @@ static struct object *create_console_connection( struct console_input *console )
if (!(connection = alloc_object( &console_connection_ops ))) return NULL;
- current->process->console = (struct console_input *)grab_object( console );
- console->num_proc++;
+ if (console)
+ {
+ current->process->console = (struct console_input *)grab_object( console );
+ console->num_proc++;
+ }
return &connection->obj;
}
@@ -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 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 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'};
@@ -2363,6 +2367,12 @@ static struct object *console_device_lookup_name( struct object *obj, struct uni
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;
}
More information about the wine-cvs
mailing list