Commit 31046449 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

kernel32: Match the Windows 10 1709+ GetConsoleFontInfo().

That is return the same 'E_NOTIMPL' error code. Remove the todo_wine-s but keep the tests in case we want to implement the API for compatibility with older Windows versions. Signed-off-by: 's avatarFrancois Gouget <fgouget@free.fr> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 2f30f28b
......@@ -1711,7 +1711,7 @@ COORD WINAPI GetConsoleFontSize(HANDLE hConsole, DWORD index)
BOOL WINAPI GetConsoleFontInfo(HANDLE hConsole, BOOL maximize, DWORD numfonts, CONSOLE_FONT_INFO *info)
{
FIXME("(%p %d %u %p): stub!\n", hConsole, maximize, numfonts, info);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
SetLastError(LOWORD(E_NOTIMPL) /* win10 1709+ */);
return FALSE;
}
......
......@@ -2847,7 +2847,7 @@ static void test_GetConsoleFontInfo(HANDLE std_output)
pGetNumberOfConsoleFonts = (void *)GetProcAddress(hmod, "GetNumberOfConsoleFonts");
if (!pGetNumberOfConsoleFonts)
{
win_skip("GetNumberOfConsoleFonts is not available\n");
skip("GetNumberOfConsoleFonts is not available\n");
return;
}
......@@ -2873,17 +2873,17 @@ static void test_GetConsoleFontInfo(HANDLE std_output)
HeapFree(GetProcessHeap(), 0, cfi);
return;
}
todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
SetLastError(0xdeadbeef);
ret = pGetConsoleFontInfo(GetStdHandle(STD_INPUT_HANDLE), FALSE, 0, cfi);
ok(!ret, "got %d, expected zero\n", ret);
todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
SetLastError(0xdeadbeef);
ret = pGetConsoleFontInfo(std_output, FALSE, 0, cfi);
ok(!ret, "got %d, expected zero\n", ret);
todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
GetConsoleScreenBufferInfo(std_output, &csbi);
win_width = csbi.srWindow.Right - csbi.srWindow.Left + 1;
......@@ -2895,11 +2895,11 @@ static void test_GetConsoleFontInfo(HANDLE std_output)
memset(cfi, 0, memsize);
ret = pGetConsoleFontInfo(std_output, FALSE, num_fonts, cfi);
todo_wine ok(ret, "got %d, expected non-zero\n", ret);
todo_wine ok(cfi[index].dwFontSize.X == win_width, "got %d, expected %d\n",
cfi[index].dwFontSize.X, win_width);
todo_wine ok(cfi[index].dwFontSize.Y == win_height, "got %d, expected %d\n",
cfi[index].dwFontSize.Y, win_height);
ok(ret, "got %d, expected non-zero\n", ret);
ok(cfi[index].dwFontSize.X == win_width, "got %d, expected %d\n",
cfi[index].dwFontSize.X, win_width);
ok(cfi[index].dwFontSize.Y == win_height, "got %d, expected %d\n",
cfi[index].dwFontSize.Y, win_height);
for (i = 0; i < num_fonts; i++)
{
......@@ -2907,32 +2907,32 @@ static void test_GetConsoleFontInfo(HANDLE std_output)
tmp_font = GetConsoleFontSize(std_output, cfi[i].nFont);
tmp_w = (double)orig_font.X / tmp_font.X * win_width;
tmp_h = (double)orig_font.Y / tmp_font.Y * win_height;
todo_wine ok(cfi[i].dwFontSize.X == tmp_w, "got %d, expected %d\n", cfi[i].dwFontSize.X, tmp_w);
todo_wine ok(cfi[i].dwFontSize.Y == tmp_h, "got %d, expected %d\n", cfi[i].dwFontSize.Y, tmp_h);
ok(cfi[i].dwFontSize.X == tmp_w, "got %d, expected %d\n", cfi[i].dwFontSize.X, tmp_w);
ok(cfi[i].dwFontSize.Y == tmp_h, "got %d, expected %d\n", cfi[i].dwFontSize.Y, tmp_h);
}
SetLastError(0xdeadbeef);
ret = pGetConsoleFontInfo(NULL, TRUE, 0, cfi);
ok(!ret, "got %d, expected zero\n", ret);
todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
SetLastError(0xdeadbeef);
ret = pGetConsoleFontInfo(GetStdHandle(STD_INPUT_HANDLE), TRUE, 0, cfi);
ok(!ret, "got %d, expected zero\n", ret);
todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
SetLastError(0xdeadbeef);
ret = pGetConsoleFontInfo(std_output, TRUE, 0, cfi);
ok(!ret, "got %d, expected zero\n", ret);
todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
memset(cfi, 0, memsize);
ret = pGetConsoleFontInfo(std_output, TRUE, num_fonts, cfi);
todo_wine ok(ret, "got %d, expected non-zero\n", ret);
todo_wine ok(cfi[index].dwFontSize.X == csbi.dwMaximumWindowSize.X, "got %d, expected %d\n",
cfi[index].dwFontSize.X, csbi.dwMaximumWindowSize.X);
todo_wine ok(cfi[index].dwFontSize.Y == csbi.dwMaximumWindowSize.Y, "got %d, expected %d\n",
cfi[index].dwFontSize.Y, csbi.dwMaximumWindowSize.Y);
ok(ret, "got %d, expected non-zero\n", ret);
ok(cfi[index].dwFontSize.X == csbi.dwMaximumWindowSize.X, "got %d, expected %d\n",
cfi[index].dwFontSize.X, csbi.dwMaximumWindowSize.X);
ok(cfi[index].dwFontSize.Y == csbi.dwMaximumWindowSize.Y, "got %d, expected %d\n",
cfi[index].dwFontSize.Y, csbi.dwMaximumWindowSize.Y);
for (i = 0; i < num_fonts; i++)
{
......@@ -2940,8 +2940,8 @@ static void test_GetConsoleFontInfo(HANDLE std_output)
tmp_font = GetConsoleFontSize(std_output, cfi[i].nFont);
tmp_w = (double)orig_font.X / tmp_font.X * csbi.dwMaximumWindowSize.X;
tmp_h = (double)orig_font.Y / tmp_font.Y * csbi.dwMaximumWindowSize.Y;
todo_wine ok(cfi[i].dwFontSize.X == tmp_w, "got %d, expected %d\n", cfi[i].dwFontSize.X, tmp_w);
todo_wine ok(cfi[i].dwFontSize.Y == tmp_h, "got %d, expected %d\n", cfi[i].dwFontSize.Y, tmp_h);
ok(cfi[i].dwFontSize.X == tmp_w, "got %d, expected %d\n", cfi[i].dwFontSize.X, tmp_w);
ok(cfi[i].dwFontSize.Y == tmp_h, "got %d, expected %d\n", cfi[i].dwFontSize.Y, tmp_h);
}
HeapFree(GetProcessHeap(), 0, cfi);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment