Jacek Caban : kernelbase: Reimplement PeekConsoleInputW using IOCTL_CONDRV_PEEK.

Alexandre Julliard julliard at winehq.org
Mon Jul 6 16:20:46 CDT 2020


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

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

kernelbase: Reimplement PeekConsoleInputW using IOCTL_CONDRV_PEEK.

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

---

 dlls/kernelbase/console.c | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/dlls/kernelbase/console.c b/dlls/kernelbase/console.c
index f4af228436..59285f75e1 100644
--- a/dlls/kernelbase/console.c
+++ b/dlls/kernelbase/console.c
@@ -790,20 +790,11 @@ BOOL WINAPI DECLSPEC_HOTPATCH PeekConsoleInputA( HANDLE handle, INPUT_RECORD *bu
 BOOL WINAPI DECLSPEC_HOTPATCH PeekConsoleInputW( HANDLE handle, INPUT_RECORD *buffer,
                                                  DWORD length, DWORD *count )
 {
-    BOOL ret;
-
-    SERVER_START_REQ( read_console_input )
-    {
-        req->handle = console_handle_unmap( handle );
-        req->flush  = FALSE;
-        wine_server_set_reply( req, buffer, length * sizeof(INPUT_RECORD) );
-        if ((ret = !wine_server_call_err( req )))
-        {
-            if (count) *count = length ? reply->read : 0;
-        }
-    }
-    SERVER_END_REQ;
-    return ret;
+    DWORD read;
+    if (!DeviceIoControl( handle, IOCTL_CONDRV_PEEK, NULL, 0, buffer, length * sizeof(*buffer), &read, NULL ))
+        return FALSE;
+    if (count) *count = read / sizeof(*buffer);
+    return TRUE;
 }
 
 




More information about the wine-cvs mailing list