From d25a267978de5949a283c5f76405175316f8f773 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 9 Jul 2020 19:28:42 +0200 Subject: [PATCH] kernelbase: Use IOCTL_CONDRV_GET_OUTPUT_INFO in GetLargestConsoleWindowSize. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/kernelbase/console.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dlls/kernelbase/console.c b/dlls/kernelbase/console.c index f5612de4075..83cbce38d59 100644 --- a/dlls/kernelbase/console.c +++ b/dlls/kernelbase/console.c @@ -159,18 +159,17 @@ static void fill_console_output( HANDLE handle, int i, int j, int len, CHAR_INFO /* helper function for GetLargestConsoleWindowSize */ static COORD get_largest_console_window_size( HANDLE handle ) { + struct condrv_output_info info; COORD c = { 0, 0 }; - SERVER_START_REQ( get_console_output_info ) + if (!DeviceIoControl( handle, IOCTL_CONDRV_GET_OUTPUT_INFO, NULL, 0, &info, sizeof(info), NULL, NULL )) { - req->handle = console_handle_unmap( handle ); - if (!wine_server_call_err( req )) - { - c.X = reply->max_width; - c.Y = reply->max_height; - } + SetLastError( ERROR_INVALID_HANDLE ); + return c; } - SERVER_END_REQ; + + c.X = info.max_width; + c.Y = info.max_height; TRACE( "(%p), returning %dx%d\n", handle, c.X, c.Y ); return c; }