From e3caa9c420bcad90bb850e588845d18f4d99e435 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 6 Jul 2020 19:29:13 +0200 Subject: [PATCH] kernelbase: Reimplement PeekConsoleInputW using IOCTL_CONDRV_PEEK. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- 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 f4af228436f..59285f75e18 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; }