Hugh McMaster : kernel32: Implement GetConsoleFontSize.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Nov 2 09:47:15 CST 2015
Module: wine
Branch: master
Commit: 4925f75869f577849d5f35d5b654c7680f8932cd
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4925f75869f577849d5f35d5b654c7680f8932cd
Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date: Thu Oct 29 23:17:21 2015 +1100
kernel32: Implement GetConsoleFontSize.
Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/kernel32/console.c | 41 ++++++++++++++++++++++++++++-------------
1 file changed, 28 insertions(+), 13 deletions(-)
diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c
index 67627cc..d4c4a05 100644
--- a/dlls/kernel32/console.c
+++ b/dlls/kernel32/console.c
@@ -3265,32 +3265,47 @@ BOOL WINAPI GetCurrentConsoleFont(HANDLE hConsole, BOOL maxwindow, LPCONSOLE_FON
return ret;
}
+static COORD get_console_font_size(HANDLE hConsole, DWORD index)
+{
+ COORD c = {0,0};
+
+ if (index >= GetNumberOfConsoleFonts())
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return c;
+ }
+
+ SERVER_START_REQ(get_console_output_info)
+ {
+ req->handle = console_handle_unmap(hConsole);
+ if (!wine_server_call_err(req))
+ {
+ c.X = reply->font_width;
+ c.Y = reply->font_height;
+ }
+ }
+ SERVER_END_REQ;
+ return c;
+}
+
#ifdef __i386__
#undef GetConsoleFontSize
-DWORD WINAPI GetConsoleFontSize(HANDLE hConsole, DWORD font)
+DWORD WINAPI GetConsoleFontSize(HANDLE hConsole, DWORD index)
{
union {
COORD c;
DWORD w;
} x;
- FIXME(": (%p, %d) stub!\n", hConsole, font);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-
- x.c.X = 0;
- x.c.Y = 0;
+ x.c = get_console_font_size(hConsole, index);
return x.w;
}
#endif /* defined(__i386__) */
#ifndef __i386__
-COORD WINAPI GetConsoleFontSize(HANDLE hConsole, DWORD font)
+COORD WINAPI GetConsoleFontSize(HANDLE hConsole, DWORD index)
{
- COORD c;
- c.X = 80;
- c.Y = 24;
- FIXME(": (%p, %d) stub!\n", hConsole, font);
- return c;
+ return get_console_font_size(hConsole, index);
}
-#endif /* defined(__i386__) */
+#endif /* !defined(__i386__) */
More information about the wine-cvs
mailing list