Jacek Caban : server: Introduce IOCTL_CONDRV_SET_MODE ioctl.

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


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

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

server: Introduce IOCTL_CONDRV_SET_MODE ioctl.

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

---

 include/wine/condrv.h |  1 +
 server/console.c      | 20 +++++++++++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/include/wine/condrv.h b/include/wine/condrv.h
index c30802be66..25e5820046 100644
--- a/include/wine/condrv.h
+++ b/include/wine/condrv.h
@@ -25,6 +25,7 @@
 
 /* common console input and output ioctls */
 #define IOCTL_CONDRV_GET_MODE              CTL_CODE(FILE_DEVICE_CONSOLE,  0, METHOD_BUFFERED, FILE_READ_PROPERTIES)
+#define IOCTL_CONDRV_SET_MODE              CTL_CODE(FILE_DEVICE_CONSOLE,  1, METHOD_BUFFERED, FILE_WRITE_PROPERTIES)
 
 /* console input ioctls */
 #define IOCTL_CONDRV_READ_INPUT            CTL_CODE(FILE_DEVICE_CONSOLE, 10, METHOD_BUFFERED, FILE_READ_ACCESS)
diff --git a/server/console.c b/server/console.c
index 4c161fccb0..577d39bdaa 100644
--- a/server/console.c
+++ b/server/console.c
@@ -190,7 +190,7 @@ struct screen_buffer
     struct object         obj;           /* object header */
     struct list           entry;         /* entry in list of all screen buffers */
     struct console_input *input;         /* associated console input */
-    int                   mode;          /* output mode */
+    unsigned int          mode;          /* output mode */
     int                   cursor_size;   /* size of cursor (percentage filled) */
     int                   cursor_visible;/* cursor visibility flag */
     int                   cursor_x;      /* position of cursor */
@@ -1584,6 +1584,15 @@ static int console_input_ioctl( struct fd *fd, ioctl_code_t code, struct async *
         }
         return set_reply_data( &console->mode, sizeof(console->mode) ) != NULL;
 
+    case IOCTL_CONDRV_SET_MODE:
+        if (get_req_data_size() != sizeof(console->mode))
+        {
+            set_error( STATUS_INVALID_PARAMETER );
+            return 0;
+        }
+        console->mode = *(unsigned int *)get_req_data();
+        return 1;
+
     case IOCTL_CONDRV_READ_INPUT:
         {
             int blocking = 0;
@@ -1657,6 +1666,15 @@ static int screen_buffer_ioctl( struct fd *fd, ioctl_code_t code, struct async *
         }
         return set_reply_data( &screen_buffer->mode, sizeof(screen_buffer->mode) ) != NULL;
 
+    case IOCTL_CONDRV_SET_MODE:
+        if (get_req_data_size() != sizeof(screen_buffer->mode))
+        {
+            set_error( STATUS_INVALID_PARAMETER );
+            return 0;
+        }
+        screen_buffer->mode = *(unsigned int *)get_req_data();
+        return 1;
+
     case IOCTL_CONDRV_GET_OUTPUT_INFO:
         {
             struct condrv_output_info *info;




More information about the wine-cvs mailing list