[PATCH 1/7 v3] kernel32: Implement the FALSE pathway of GetCurrentConsoleFont

Hugh McMaster hugh.mcmaster at outlook.com
Mon Oct 26 01:42:13 CDT 2015


Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 dlls/kernel32/console.c | 29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c
index 14f1189..51a2b44 100644
--- a/dlls/kernel32/console.c
+++ b/dlls/kernel32/console.c
@@ -3236,9 +3236,32 @@ BOOL WINAPI SetConsoleIcon(HICON icon)
 
 BOOL WINAPI GetCurrentConsoleFont(HANDLE hConsole, BOOL maxwindow, LPCONSOLE_FONT_INFO fontinfo)
 {
-    FIXME(": (%p, %d, %p) stub!\n", hConsole, maxwindow, fontinfo);
-    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-    return FALSE;
+    BOOL ret;
+
+    memset(fontinfo, 0, sizeof(CONSOLE_FONT_INFO));
+
+    if (maxwindow)
+    {
+        FIXME(": (%p, %d, %p) stub!\n", hConsole, maxwindow, fontinfo);
+        SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+        return FALSE;
+    }
+
+    SERVER_START_REQ(get_console_output_info)
+    {
+        req->handle = console_handle_unmap(hConsole);
+        if ((ret = !wine_server_call_err(req)))
+        {
+            fontinfo->dwFontSize.X = reply->win_right - reply->win_left + 1;
+            fontinfo->dwFontSize.Y = reply->win_bottom - reply->win_top + 1;
+        }
+        else
+        {
+            SetLastError(ERROR_INVALID_HANDLE);
+        }
+    }
+    SERVER_END_REQ;
+    return ret;
 }
 
 #ifdef __i386__
-- 
1.9.1




More information about the wine-patches mailing list