[PATCH 2/2] kernel32: Match the Windows 10 1709+ GetConsoleFontInfo().

Francois Gouget fgouget at free.fr
Wed Nov 6 09:46:09 CST 2019


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: Francois Gouget <fgouget at free.fr>
---

Again the SetConsoleFont() tests need the same treatment so there will 
still be 3 or so test failures on recent Windows 10.

 dlls/kernel32/console.c       |  2 +-
 dlls/kernel32/tests/console.c | 42 +++++++++++++++++------------------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c
index 03df90c7e17..4c0bee2caf9 100644
--- a/dlls/kernel32/console.c
+++ b/dlls/kernel32/console.c
@@ -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;
 }
 
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c
index 97bea44e195..a22051deafe 100644
--- a/dlls/kernel32/tests/console.c
+++ b/dlls/kernel32/tests/console.c
@@ -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);
-- 
2.20.1



More information about the wine-devel mailing list