Hugh McMaster : kernel32: Implement GetLargestConsoleWindowSize.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jan 5 12:18:33 CST 2016


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

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Tue Jan  5 18:59:32 2016 +1100

kernel32: Implement GetLargestConsoleWindowSize.

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Alexandre Julliard <julliard at 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 */;




More information about the wine-cvs mailing list