Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- dlls/kernel32/tests/console.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 0bce88716d0..7c74ddf195a 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -3437,6 +3437,7 @@ static void test_GetCurrentConsoleFontEx(HANDLE std_output) BOOL ret; HANDLE std_input = GetStdHandle(STD_INPUT_HANDLE); HANDLE pipe1, pipe2; + COORD c;
hmod = GetModuleHandleA("kernel32.dll"); pGetCurrentConsoleFontEx = (void *)GetProcAddress(hmod, "GetCurrentConsoleFontEx"); @@ -3521,6 +3522,21 @@ static void test_GetCurrentConsoleFontEx(HANDLE std_output) ok(cfix.dwFontSize.X == cfi.dwFontSize.X, "expected values to match\n"); ok(cfix.dwFontSize.Y == cfi.dwFontSize.Y, "expected values to match\n");
+ SetLastError(0xdeadbeef); + c = GetConsoleFontSize(std_output, cfix.nFont); + ok(c.X && c.Y, "GetConsoleFontSize failed; err = %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + + todo_wine ok(cfix.dwFontSize.X == c.X, "Font width doesn't match; got %u, expected %u\n", + cfix.dwFontSize.X, c.X); + todo_wine ok(cfix.dwFontSize.Y == c.Y, "Font height doesn't match; got %u, expected %u\n", + cfix.dwFontSize.Y, c.Y); + + todo_wine ok(cfi.dwFontSize.X == c.X, "Font width doesn't match; got %u, expected %u\n", + cfi.dwFontSize.X, c.X); + todo_wine ok(cfi.dwFontSize.Y == c.Y, "Font height doesn't match; got %u, expected %u\n", + cfi.dwFontSize.Y, c.Y); + SetLastError(0xdeadbeef); ret = pGetCurrentConsoleFontEx(std_output, TRUE, &cfix); ok(ret, "got %d, expected non-zero\n", ret);
GetCurrentConsoleFontEx currently returns the screen buffer size when maxwindow is FALSE. It should return the current console font size.
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- dlls/kernel32/console.c | 4 ++-- dlls/kernel32/tests/console.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c index 4810feb4987..80f3419cd7a 100644 --- a/dlls/kernel32/console.c +++ b/dlls/kernel32/console.c @@ -407,8 +407,8 @@ BOOL WINAPI GetCurrentConsoleFontEx(HANDLE hConsole, BOOL maxwindow, CONSOLE_FON } else { - fontinfo->dwFontSize.X = data.info.win_right - data.info.win_left + 1; - fontinfo->dwFontSize.Y = data.info.win_bottom - data.info.win_top + 1; + fontinfo->dwFontSize.X = data.info.font_width; + fontinfo->dwFontSize.Y = data.info.font_height; } size -= sizeof(data.info); if (size) memcpy( fontinfo->FaceName, data.face_name, size ); diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 7c74ddf195a..8b5abfa2da9 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -3527,14 +3527,14 @@ static void test_GetCurrentConsoleFontEx(HANDLE std_output) ok(c.X && c.Y, "GetConsoleFontSize failed; err = %u\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
- todo_wine ok(cfix.dwFontSize.X == c.X, "Font width doesn't match; got %u, expected %u\n", + ok(cfix.dwFontSize.X == c.X, "Font width doesn't match; got %u, expected %u\n", cfix.dwFontSize.X, c.X); - todo_wine ok(cfix.dwFontSize.Y == c.Y, "Font height doesn't match; got %u, expected %u\n", + ok(cfix.dwFontSize.Y == c.Y, "Font height doesn't match; got %u, expected %u\n", cfix.dwFontSize.Y, c.Y);
- todo_wine ok(cfi.dwFontSize.X == c.X, "Font width doesn't match; got %u, expected %u\n", + ok(cfi.dwFontSize.X == c.X, "Font width doesn't match; got %u, expected %u\n", cfi.dwFontSize.X, c.X); - todo_wine ok(cfi.dwFontSize.Y == c.Y, "Font height doesn't match; got %u, expected %u\n", + ok(cfi.dwFontSize.Y == c.Y, "Font height doesn't match; got %u, expected %u\n", cfi.dwFontSize.Y, c.Y);
SetLastError(0xdeadbeef);