Commit d2496e2d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

conhost: Implement IOCTL_CONDRV_SET_TITLE.

parent e40de801
...@@ -3966,6 +3966,8 @@ static void test_pseudo_console_child(HANDLE input) ...@@ -3966,6 +3966,8 @@ static void test_pseudo_console_child(HANDLE input)
ret = SetConsoleMode(input, mode | ENABLE_AUTO_POSITION); ret = SetConsoleMode(input, mode | ENABLE_AUTO_POSITION);
ok(ret, "SetConsoleMode failed: %u\n", GetLastError()); ok(ret, "SetConsoleMode failed: %u\n", GetLastError());
test_console_title();
} }
static DWORD WINAPI read_pipe_proc( void *handle ) static DWORD WINAPI read_pipe_proc( void *handle )
......
...@@ -73,6 +73,23 @@ static void *alloc_ioctl_buffer( size_t size ) ...@@ -73,6 +73,23 @@ static void *alloc_ioctl_buffer( size_t size )
return ioctl_buffer; 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, static NTSTATUS console_input_ioctl( struct console *console, unsigned int code, const void *in_data,
size_t in_size, size_t *out_size ) size_t in_size, size_t *out_size )
{ {
...@@ -180,6 +197,10 @@ static NTSTATUS console_input_ioctl( struct console *console, unsigned int code, ...@@ -180,6 +197,10 @@ static NTSTATUS console_input_ioctl( struct console *console, unsigned int code,
return STATUS_SUCCESS; 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: default:
FIXME( "unsupported ioctl %x\n", code ); FIXME( "unsupported ioctl %x\n", code );
return STATUS_NOT_SUPPORTED; return STATUS_NOT_SUPPORTED;
......
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