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

conhost: Implement IOCTL_CONDRV_GET_MODE.

parent eb293d76
...@@ -3945,7 +3945,7 @@ static void test_AllocConsole(void) ...@@ -3945,7 +3945,7 @@ static void test_AllocConsole(void)
CloseHandle(pipe_write); CloseHandle(pipe_write);
} }
static void test_pseudo_console_child(HANDLE input) static void test_pseudo_console_child(HANDLE input, HANDLE output)
{ {
DWORD mode; DWORD mode;
BOOL ret; BOOL ret;
...@@ -3967,6 +3967,10 @@ static void test_pseudo_console_child(HANDLE input) ...@@ -3967,6 +3967,10 @@ 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());
ret = GetConsoleMode(output, &mode);
ok(ret, "GetConsoleMode failed: %u\n", GetLastError());
ok(mode == (ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT), "mode = %x\n", mode);
test_console_title(); test_console_title();
test_WriteConsoleInputW(input); test_WriteConsoleInputW(input);
} }
...@@ -4144,7 +4148,7 @@ START_TEST(console) ...@@ -4144,7 +4148,7 @@ START_TEST(console)
if (using_pseudo_console) if (using_pseudo_console)
{ {
test_pseudo_console_child(hConIn); test_pseudo_console_child(hConIn, hConOut);
return; return;
} }
......
...@@ -67,6 +67,7 @@ struct screen_buffer ...@@ -67,6 +67,7 @@ struct screen_buffer
{ {
struct console *console; /* console reference */ struct console *console; /* console reference */
unsigned int id; /* screen buffer id */ unsigned int id; /* screen buffer id */
unsigned int mode; /* output mode */
unsigned int width; /* size (w-h) of the screen buffer */ unsigned int width; /* size (w-h) of the screen buffer */
unsigned int height; unsigned int height;
struct wine_rb_entry entry; /* map entry */ struct wine_rb_entry entry; /* map entry */
...@@ -102,6 +103,7 @@ static struct screen_buffer *create_screen_buffer( struct console *console, int ...@@ -102,6 +103,7 @@ static struct screen_buffer *create_screen_buffer( struct console *console, int
if (!(screen_buffer = malloc( sizeof(*screen_buffer) ))) return NULL; if (!(screen_buffer = malloc( sizeof(*screen_buffer) ))) return NULL;
screen_buffer->console = console; screen_buffer->console = console;
screen_buffer->id = id; screen_buffer->id = id;
screen_buffer->mode = ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT;
screen_buffer->width = width; screen_buffer->width = width;
screen_buffer->height = height; screen_buffer->height = height;
...@@ -232,6 +234,16 @@ static NTSTATUS screen_buffer_ioctl( struct screen_buffer *screen_buffer, unsign ...@@ -232,6 +234,16 @@ static NTSTATUS screen_buffer_ioctl( struct screen_buffer *screen_buffer, unsign
screen_buffer->console->active = screen_buffer; screen_buffer->console->active = screen_buffer;
return STATUS_SUCCESS; return STATUS_SUCCESS;
case IOCTL_CONDRV_GET_MODE:
{
DWORD *mode;
TRACE( "returning mode %x\n", screen_buffer->mode );
if (in_size || *out_size != sizeof(*mode)) return STATUS_INVALID_PARAMETER;
if (!(mode = alloc_ioctl_buffer( *out_size ))) return STATUS_NO_MEMORY;
*mode = screen_buffer->mode;
return STATUS_SUCCESS;
}
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