Commit 3c9d10d7 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

conhost: Implement IOCTL_CONDRV_GET_MODE.

parent 8231dbf0
......@@ -4121,9 +4121,7 @@ START_TEST(console)
DWORD mode;
ret = GetConsoleMode(hConIn, &mode);
todo_wine
ok(ret, "GetConsoleMode failed: %u\n", GetLastError());
todo_wine
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);
......
......@@ -25,6 +25,7 @@
#include <winuser.h>
#include <winternl.h>
#include "wine/condrv.h"
#include "wine/server.h"
#include "wine/debug.h"
......@@ -33,6 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(conhost);
struct console
{
HANDLE server; /* console server handle */
unsigned int mode; /* input mode */
};
static void *ioctl_buffer;
......@@ -53,8 +55,22 @@ static void *alloc_ioctl_buffer( size_t size )
static NTSTATUS console_input_ioctl( struct console *console, unsigned int code, const void *in_data,
size_t in_size, size_t *out_size )
{
FIXME( "unsupported ioctl %x\n", code );
return STATUS_NOT_SUPPORTED;
switch (code)
{
case IOCTL_CONDRV_GET_MODE:
{
DWORD *mode;
TRACE( "returning mode %x\n", console->mode );
if (in_size || *out_size != sizeof(*mode)) return STATUS_INVALID_PARAMETER;
if (!(mode = alloc_ioctl_buffer( *out_size ))) return STATUS_NO_MEMORY;
*mode = console->mode;
return STATUS_SUCCESS;
}
default:
FIXME( "unsupported ioctl %x\n", code );
return STATUS_NOT_SUPPORTED;
}
}
static NTSTATUS process_console_ioctls( struct console *console )
......@@ -162,6 +178,10 @@ int __cdecl wmain(int argc, WCHAR *argv[])
for (i = 0; i < argc; i++) TRACE("%s ", wine_dbgstr_w(argv[i]));
TRACE("\n");
console.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;
for (i = 1; i < argc; i++)
{
if (!wcscmp( argv[i], L"--headless"))
......
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