Module: wine Branch: master Commit: dd6477966b2628995e0a9384b04fee9658ef011b URL: http://source.winehq.org/git/wine.git/?a=commit;h=dd6477966b2628995e0a9384b0...
Author: Hugh McMaster hugh.mcmaster@outlook.com Date: Tue Jan 5 18:59:32 2016 +1100
kernel32: Implement GetLargestConsoleWindowSize.
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com Signed-off-by: Sebastian Lackner sebastian@fds-team.de Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/kernel32/console.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c index 51d6e60..f48bca7 100644 --- a/dlls/kernel32/console.c +++ b/dlls/kernel32/console.c @@ -1360,6 +1360,22 @@ DWORD WINAPI GetConsoleTitleW(LPWSTR title, DWORD size) return ret; }
+static COORD get_largest_console_window_size(HANDLE hConsole) +{ + COORD c = {0,0}; + + SERVER_START_REQ(get_console_output_info) + { + req->handle = console_handle_unmap(hConsole); + if (!wine_server_call_err(req)) + { + c.X = reply->max_width; + c.Y = reply->max_height; + } + } + SERVER_END_REQ; + return c; +}
/*********************************************************************** * GetLargestConsoleWindowSize (KERNEL32.@) @@ -1378,8 +1394,7 @@ DWORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput) COORD c; DWORD w; } x; - x.c.X = 80; - x.c.Y = 24; + x.c = get_largest_console_window_size(hConsoleOutput); TRACE("(%p), returning %dx%d (%x)\n", hConsoleOutput, x.c.X, x.c.Y, x.w); return x.w; } @@ -1399,12 +1414,11 @@ DWORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput) COORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput) { COORD c; - c.X = 80; - c.Y = 24; + c = get_largest_console_window_size(hConsoleOutput); TRACE("(%p), returning %dx%d\n", hConsoleOutput, c.X, c.Y); return c; } -#endif /* defined(__i386__) */ +#endif /* !defined(__i386__) */
static WCHAR* S_EditString /* = NULL */; static unsigned S_EditStrPos /* = 0 */;