Commit 5a151b06 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

conhost: Implement IOCTL_CONDRV_SET_MODE.

parent 2105602e
......@@ -3945,6 +3945,29 @@ static void test_AllocConsole(void)
CloseHandle(pipe_write);
}
static void test_pseudo_console_child(HANDLE input)
{
DWORD mode;
BOOL ret;
ret = GetConsoleMode(input, &mode);
ok(ret, "GetConsoleMode failed: %u\n", GetLastError());
ok(mode == (ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT |
ENABLE_INSERT_MODE | ENABLE_QUICK_EDIT_MODE | ENABLE_EXTENDED_FLAGS | ENABLE_AUTO_POSITION),
"mode = %x\n", mode);
ret = SetConsoleMode(input, mode & ~ENABLE_AUTO_POSITION);
ok(ret, "SetConsoleMode failed: %u\n", GetLastError());
ret = GetConsoleMode(input, &mode);
ok(ret, "GetConsoleMode failed: %u\n", GetLastError());
ok(mode == (ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT |
ENABLE_INSERT_MODE | ENABLE_QUICK_EDIT_MODE | ENABLE_EXTENDED_FLAGS), "mode = %x\n", mode);
ret = SetConsoleMode(input, mode | ENABLE_AUTO_POSITION);
ok(ret, "SetConsoleMode failed: %u\n", GetLastError());
}
static DWORD WINAPI read_pipe_proc( void *handle )
{
char buf[64];
......@@ -4118,13 +4141,7 @@ START_TEST(console)
if (using_pseudo_console)
{
DWORD mode;
ret = GetConsoleMode(hConIn, &mode);
ok(ret, "GetConsoleMode failed: %u\n", GetLastError());
ok(mode == (ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT |
ENABLE_INSERT_MODE | ENABLE_QUICK_EDIT_MODE | ENABLE_EXTENDED_FLAGS | ENABLE_AUTO_POSITION),
"mode = %x\n", mode);
test_pseudo_console_child(hConIn);
return;
}
......
......@@ -67,6 +67,12 @@ static NTSTATUS console_input_ioctl( struct console *console, unsigned int code,
return STATUS_SUCCESS;
}
case IOCTL_CONDRV_SET_MODE:
if (in_size != sizeof(unsigned int) || *out_size) return STATUS_INVALID_PARAMETER;
console->mode = *(unsigned int *)in_data;
TRACE( "set %x mode\n", console->mode );
return STATUS_SUCCESS;
default:
FIXME( "unsupported ioctl %x\n", code );
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