From 718258015358464c008bf1bd43f901fe9e84e65b Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Wed, 24 Apr 2013 16:11:07 +1000 Subject: dlls-kernel32-console.c --- dlls/kernel32/console.c | 74 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 54 insertions(+), 20 deletions(-) diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c index 8405f4f..d00d853 100644 --- a/dlls/kernel32/console.c +++ b/dlls/kernel32/console.c @@ -1366,6 +1366,26 @@ DWORD WINAPI GetConsoleTitleW(LPWSTR title, DWORD size) /*********************************************************************** + * GetLargestConsoleWindowSize_helper + */ +COORD GetLargestConsoleWindowSize_helper(void) +{ + COORD max_console; + SERVER_START_REQ(max_console_size) + { + req->mem = 0; + if (!wine_server_call_err(req)) + { + max_console.X = reply->max_x; + max_console.Y = reply->max_y; + } + } + SERVER_END_REQ; + + return max_console; +} + +/*********************************************************************** * GetLargestConsoleWindowSize (KERNEL32.@) * * NOTE @@ -1382,14 +1402,12 @@ DWORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput) COORD c; DWORD w; } x; - x.c.X = 80; - x.c.Y = 24; + x.c = GetLargestConsoleWindowSize_helper(); TRACE("(%p), returning %dx%d (%x)\n", hConsoleOutput, x.c.X, x.c.Y, x.w); return x.w; } #endif /* defined(__i386__) */ - /*********************************************************************** * GetLargestConsoleWindowSize (KERNEL32.@) * @@ -1403,8 +1421,7 @@ DWORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput) COORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput) { COORD c; - c.X = 80; - c.Y = 24; + c = GetLargestConsoleWindowSize_helper(); TRACE("(%p), returning %dx%d\n", hConsoleOutput, c.X, c.Y); return c; } @@ -3227,39 +3244,56 @@ BOOL WINAPI SetConsoleIcon(HICON icon) return FALSE; } -BOOL WINAPI GetCurrentConsoleFont(HANDLE hConsole, BOOL maxwindow, LPCONSOLE_FONT_INFO fontinfo) +/*********************************************************************** + * GetConsoleFontSize_helper + */ +COORD GetConsoleFontSize_helper(void) { - FIXME(": (%p, %d, %p) stub!\n", hConsole, maxwindow, fontinfo); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + COORD fontsize; + + SERVER_START_REQ(console_font_size) + { + req->mem = 0; + if (!wine_server_call_err(req)) + { + fontsize.X = reply->font_x; + fontsize.Y = reply->font_y; + } + } + SERVER_END_REQ; + + return fontsize; +} + +BOOL WINAPI GetCurrentConsoleFont(HANDLE hConsoleOutput, BOOL maxwindow, LPCONSOLE_FONT_INFO fontinfo) +{ + int index = 0; + + fontinfo->nFont = index; + fontinfo->dwFontSize = GetConsoleFontSize(hConsoleOutput, index); + + return TRUE; } #ifdef __i386__ #undef GetConsoleFontSize -DWORD WINAPI GetConsoleFontSize(HANDLE hConsole, DWORD font) +DWORD WINAPI GetConsoleFontSize(HANDLE hConsoleOutput, DWORD nFont) { 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 = GetConsoleFontSize_helper(); return x.w; } #endif /* defined(__i386__) */ - #ifndef __i386__ -COORD WINAPI GetConsoleFontSize(HANDLE hConsole, DWORD font) +COORD WINAPI GetConsoleFontSize(HANDLE hConsoleOutput, DWORD nFont) { COORD c; - c.X = 80; - c.Y = 24; - FIXME(": (%p, %d) stub!\n", hConsole, font); + c = GetConsoleFontSize_helper(); return c; } #endif /* defined(__i386__) */ -- 1.7.10.4