From 1be569368b258704a0ffc3c944ccb1d416e903b0 Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Fri, 12 Jul 2013 20:30:17 +1000 Subject: Kernel32 changes to allow screen buffer resize --- dlls/kernel32/console.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c index 8405f4f..970ee1b 100644 --- a/dlls/kernel32/console.c +++ b/dlls/kernel32/console.c @@ -1364,6 +1364,28 @@ DWORD WINAPI GetConsoleTitleW(LPWSTR title, DWORD size) return ret; } +/*********************************************************************** + * GetLargestConsoleWindowSize_helper + * + * + */ +static COORD GetLargestConsoleWindowSize_helper(HANDLE hConOut) +{ + COORD c; + + SERVER_START_REQ(get_console_output_info) + { + req->handle = console_handle_unmap(hConOut); + if (!wine_server_call_err(req)) + { + c.X = reply->max_width; + c.Y = reply->max_height; + } + } + SERVER_END_REQ; + + return c; +} /*********************************************************************** * GetLargestConsoleWindowSize (KERNEL32.@) @@ -1382,8 +1404,7 @@ DWORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput) COORD c; DWORD w; } x; - x.c.X = 80; - x.c.Y = 24; + x.c = GetLargestConsoleWindowSize_helper(hConsoleOutput); TRACE("(%p), returning %dx%d (%x)\n", hConsoleOutput, x.c.X, x.c.Y, x.w); return x.w; } @@ -1403,8 +1424,7 @@ DWORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput) COORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput) { COORD c; - c.X = 80; - c.Y = 24; + c = GetLargestConsoleWindowSize_helper(hConsoleOutput); TRACE("(%p), returning %dx%d\n", hConsoleOutput, c.X, c.Y); return c; } -- 1.7.10.4