From e40de801b5e757f13e5d699fa22368bf1939d444 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 24 Aug 2020 13:21:43 +0200 Subject: [PATCH] conhost: Implement IOCTL_CONDRV_GET_TITLE. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- programs/conhost/conhost.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index 87d3a646d95..7f1978bffb0 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -46,6 +46,8 @@ struct console HANDLE server; /* console server handle */ unsigned int mode; /* input mode */ unsigned int recnum; /* number of input records */ + WCHAR *title; /* console title */ + size_t title_len; /* length of console title */ struct history_line **history; /* lines history */ unsigned int history_size; /* number of entries in history array */ unsigned int history_index; /* number of used entries in history array */ @@ -166,6 +168,18 @@ static NTSTATUS console_input_ioctl( struct console *console, unsigned int code, return STATUS_SUCCESS; } + case IOCTL_CONDRV_GET_TITLE: + { + WCHAR *result; + if (in_size) return STATUS_INVALID_PARAMETER; + TRACE( "returning title %s\n", debugstr_wn(console->title, + console->title_len / sizeof(WCHAR)) ); + if (!(result = alloc_ioctl_buffer( *out_size = min( *out_size, console->title_len )))) + return STATUS_NO_MEMORY; + if (*out_size) memcpy( result, console->title, *out_size ); + return STATUS_SUCCESS; + } + default: FIXME( "unsupported ioctl %x\n", code ); return STATUS_NOT_SUPPORTED;