Jacek Caban : server: Introduce IOCTL_CONDRV_GET_MODE ioctl.

Alexandre Julliard julliard at winehq.org
Mon Jul 13 16:08:49 CDT 2020


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Jul 13 13:26:29 2020 +0200

server: Introduce IOCTL_CONDRV_GET_MODE ioctl.

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

---

 include/wine/condrv.h |  3 +++
 server/console.c      | 16 ++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/include/wine/condrv.h b/include/wine/condrv.h
index 5992834069..c30802be66 100644
--- a/include/wine/condrv.h
+++ b/include/wine/condrv.h
@@ -23,6 +23,9 @@
 
 #include "winioctl.h"
 
+/* common console input and output ioctls */
+#define IOCTL_CONDRV_GET_MODE              CTL_CODE(FILE_DEVICE_CONSOLE,  0, METHOD_BUFFERED, FILE_READ_PROPERTIES)
+
 /* console input ioctls */
 #define IOCTL_CONDRV_READ_INPUT            CTL_CODE(FILE_DEVICE_CONSOLE, 10, METHOD_BUFFERED, FILE_READ_ACCESS)
 #define IOCTL_CONDRV_WRITE_INPUT           CTL_CODE(FILE_DEVICE_CONSOLE, 11, METHOD_BUFFERED, FILE_WRITE_PROPERTIES)
diff --git a/server/console.c b/server/console.c
index a91d963a41..4c161fccb0 100644
--- a/server/console.c
+++ b/server/console.c
@@ -1576,6 +1576,14 @@ static int console_input_ioctl( struct fd *fd, ioctl_code_t code, struct async *
 
     switch (code)
     {
+    case IOCTL_CONDRV_GET_MODE:
+        if (get_reply_max_size() != sizeof(console->mode))
+        {
+            set_error( STATUS_INVALID_PARAMETER );
+            return 0;
+        }
+        return set_reply_data( &console->mode, sizeof(console->mode) ) != NULL;
+
     case IOCTL_CONDRV_READ_INPUT:
         {
             int blocking = 0;
@@ -1641,6 +1649,14 @@ static int screen_buffer_ioctl( struct fd *fd, ioctl_code_t code, struct async *
 
     switch (code)
     {
+    case IOCTL_CONDRV_GET_MODE:
+        if (get_reply_max_size() != sizeof(screen_buffer->mode))
+        {
+            set_error( STATUS_INVALID_PARAMETER );
+            return 0;
+        }
+        return set_reply_data( &screen_buffer->mode, sizeof(screen_buffer->mode) ) != NULL;
+
     case IOCTL_CONDRV_GET_OUTPUT_INFO:
         {
             struct condrv_output_info *info;




More information about the wine-cvs mailing list