Module: wine Branch: master Commit: d2496e2d5c5ea4bde34659ba88cea52e8c27facb URL: https://source.winehq.org/git/wine.git/?a=commit;h=d2496e2d5c5ea4bde34659ba8...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Aug 24 13:21:56 2020 +0200
conhost: Implement IOCTL_CONDRV_SET_TITLE.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/kernel32/tests/console.c | 2 ++ programs/conhost/conhost.c | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+)
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 922a250993..afc91ecfce 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -3966,6 +3966,8 @@ static void test_pseudo_console_child(HANDLE input)
ret = SetConsoleMode(input, mode | ENABLE_AUTO_POSITION); ok(ret, "SetConsoleMode failed: %u\n", GetLastError()); + + test_console_title(); }
static DWORD WINAPI read_pipe_proc( void *handle ) diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index 7f1978bffb..c658deb1cf 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -73,6 +73,23 @@ static void *alloc_ioctl_buffer( size_t size ) return ioctl_buffer; }
+static NTSTATUS set_console_title( struct console *console, const WCHAR *in_title, size_t size ) +{ + WCHAR *title = NULL; + + TRACE( "%s\n", debugstr_wn(in_title, size) ); + + if (size) + { + if (!(title = malloc( size ))) return STATUS_NO_MEMORY; + memcpy( title, in_title, size ); + } + free( console->title ); + console->title = title; + console->title_len = size; + return STATUS_SUCCESS; +} + static NTSTATUS console_input_ioctl( struct console *console, unsigned int code, const void *in_data, size_t in_size, size_t *out_size ) { @@ -180,6 +197,10 @@ static NTSTATUS console_input_ioctl( struct console *console, unsigned int code, return STATUS_SUCCESS; }
+ case IOCTL_CONDRV_SET_TITLE: + if (in_size % sizeof(WCHAR) || *out_size) return STATUS_INVALID_PARAMETER; + return set_console_title( console, in_data, in_size ); + default: FIXME( "unsupported ioctl %x\n", code ); return STATUS_NOT_SUPPORTED;