Jacek Caban : conhost: Implement IOCTL_CONDRV_SET_MODE.

Alexandre Julliard julliard at winehq.org
Thu Aug 27 15:26:50 CDT 2020


Module: wine
Branch: master
Commit: 21c99970f3c423e2b8b1f92b2b44c5dce7cc28bf
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=21c99970f3c423e2b8b1f92b2b44c5dce7cc28bf

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Aug 27 15:05:36 2020 +0200

conhost: Implement IOCTL_CONDRV_SET_MODE.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/tests/console.c | 10 ++++++++++
 programs/conhost/conhost.c    |  6 ++++++
 2 files changed, 16 insertions(+)

diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c
index 5efe4ee38c..a8c07dcae7 100644
--- a/dlls/kernel32/tests/console.c
+++ b/dlls/kernel32/tests/console.c
@@ -3971,6 +3971,16 @@ static void test_pseudo_console_child(HANDLE input, HANDLE output)
     ok(ret, "GetConsoleMode failed: %u\n", GetLastError());
     ok(mode == (ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT), "mode = %x\n", mode);
 
+    ret = SetConsoleMode(output, mode & ~ENABLE_WRAP_AT_EOL_OUTPUT);
+    ok(ret, "SetConsoleMode failed: %u\n", GetLastError());
+
+    ret = GetConsoleMode(output, &mode);
+    ok(ret, "GetConsoleMode failed: %u\n", GetLastError());
+    ok(mode == ENABLE_PROCESSED_OUTPUT, "mode = %x\n", mode);
+
+    ret = SetConsoleMode(output, mode | ENABLE_WRAP_AT_EOL_OUTPUT);
+    ok(ret, "SetConsoleMode failed: %u\n", GetLastError());
+
     test_console_title();
     test_WriteConsoleInputW(input);
 }
diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c
index 06d2b15d2a..7c20cd4eb3 100644
--- a/programs/conhost/conhost.c
+++ b/programs/conhost/conhost.c
@@ -244,6 +244,12 @@ static NTSTATUS screen_buffer_ioctl( struct screen_buffer *screen_buffer, unsign
             return STATUS_SUCCESS;
         }
 
+    case IOCTL_CONDRV_SET_MODE:
+        if (in_size != sizeof(unsigned int) || *out_size) return STATUS_INVALID_PARAMETER;
+        screen_buffer->mode = *(unsigned int *)in_data;
+        TRACE( "set %x mode\n", screen_buffer->mode );
+        return STATUS_SUCCESS;
+
     default:
         FIXME( "unsupported ioctl %x\n", code );
         return STATUS_NOT_SUPPORTED;




More information about the wine-cvs mailing list