Jacek Caban : kernelbase: Use IOCTL_CONDRV_GET_OUTPUT_INFO in GetConsoleCursorInfo.

Alexandre Julliard julliard at winehq.org
Thu Jul 9 17:10:40 CDT 2020


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Jul  9 19:28:48 2020 +0200

kernelbase: Use IOCTL_CONDRV_GET_OUTPUT_INFO in GetConsoleCursorInfo.

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

---

 dlls/kernelbase/console.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/dlls/kernelbase/console.c b/dlls/kernelbase/console.c
index 83cbce38d5..fe4b798988 100644
--- a/dlls/kernelbase/console.c
+++ b/dlls/kernelbase/console.c
@@ -541,26 +541,22 @@ UINT WINAPI DECLSPEC_HOTPATCH GetConsoleCP(void)
  */
 BOOL WINAPI DECLSPEC_HOTPATCH GetConsoleCursorInfo( HANDLE handle, CONSOLE_CURSOR_INFO *info )
 {
-    BOOL ret;
+    struct condrv_output_info condrv_info;
 
-    SERVER_START_REQ( get_console_output_info )
+    if (!DeviceIoControl( handle, IOCTL_CONDRV_GET_OUTPUT_INFO, NULL, 0, &condrv_info, sizeof(condrv_info), NULL, NULL ))
     {
-        req->handle = console_handle_unmap( handle );
-        ret = !wine_server_call_err( req );
-        if (ret && info)
-        {
-            info->dwSize = reply->cursor_size;
-            info->bVisible = reply->cursor_visible;
-        }
+        SetLastError( ERROR_INVALID_HANDLE );
+        return FALSE;
     }
-    SERVER_END_REQ;
 
-    if (!ret) return FALSE;
     if (!info)
     {
         SetLastError( ERROR_INVALID_ACCESS );
         return FALSE;
     }
+
+    info->dwSize   = condrv_info.cursor_size;
+    info->bVisible = condrv_info.cursor_visible;
     TRACE("(%p) returning (%d,%d)\n", handle, info->dwSize, info->bVisible);
     return TRUE;
 }




More information about the wine-cvs mailing list