From: Hugh McMaster hugh.mcmaster@outlook.com
--- dlls/kernel32/tests/console.c | 40 ++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 19 deletions(-)
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index c698618db0d..3327e74b3cc 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -37,6 +37,7 @@ static DWORD (WINAPI *pGetConsoleProcessList)(LPDWORD, DWORD); static BOOL (WINAPI *pGetCurrentConsoleFontEx)(HANDLE, BOOL, CONSOLE_FONT_INFOEX *); static HANDLE (WINAPI *pOpenConsoleW)(LPCWSTR,DWORD,BOOL,DWORD); static BOOL (WINAPI *pSetConsoleInputExeNameA)(LPCSTR); +static BOOL (WINAPI *pSetCurrentConsoleFontEx)(HANDLE, BOOL, CONSOLE_FONT_INFOEX *); static BOOL (WINAPI *pVerifyConsoleIoHandle)(HANDLE handle);
static BOOL skip_nt; @@ -86,6 +87,7 @@ static void init_function_pointers(void) KERNEL32_GET_PROC(GetCurrentConsoleFontEx); KERNEL32_GET_PROC(OpenConsoleW); KERNEL32_GET_PROC(SetConsoleInputExeNameA); + KERNEL32_GET_PROC(SetCurrentConsoleFontEx); KERNEL32_GET_PROC(VerifyConsoleIoHandle);
#undef KERNEL32_GET_PROC @@ -3566,9 +3568,9 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output) HANDLE pipe1, pipe2; HANDLE std_input = GetStdHandle(STD_INPUT_HANDLE);
- if (!pGetCurrentConsoleFontEx) + if (!pGetCurrentConsoleFontEx || !pSetCurrentConsoleFontEx) { - win_skip("GetCurrentConsoleFontEx not available.\n"); + win_skip("GetCurrentConsoleFontEx or SetCurrentConsoleFontEx not available.\n"); return; }
@@ -3581,18 +3583,18 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output) cfix.cbSize = 0;
SetLastError(0xdeadbeef); - ret = SetCurrentConsoleFontEx(NULL, FALSE, &cfix); + ret = pSetCurrentConsoleFontEx(NULL, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); - ret = SetCurrentConsoleFontEx(NULL, TRUE, &cfix); + ret = pSetCurrentConsoleFontEx(NULL, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
CreatePipe(&pipe1, &pipe2, NULL, 0); SetLastError(0xdeadbeef); - ret = SetCurrentConsoleFontEx(pipe1, FALSE, &cfix); + ret = pSetCurrentConsoleFontEx(pipe1, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError()); CloseHandle(pipe1); @@ -3600,47 +3602,47 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
CreatePipe(&pipe1, &pipe2, NULL, 0); SetLastError(0xdeadbeef); - ret = SetCurrentConsoleFontEx(pipe1, TRUE, &cfix); + ret = pSetCurrentConsoleFontEx(pipe1, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError()); CloseHandle(pipe1); CloseHandle(pipe2);
SetLastError(0xdeadbeef); - ret = SetCurrentConsoleFontEx(std_input, FALSE, &cfix); + ret = pSetCurrentConsoleFontEx(std_input, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); - ret = SetCurrentConsoleFontEx(std_input, TRUE, &cfix); + ret = pSetCurrentConsoleFontEx(std_input, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); - ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix); + ret = pSetCurrentConsoleFontEx(std_output, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); - ret = SetCurrentConsoleFontEx(std_output, TRUE, &cfix); + ret = pSetCurrentConsoleFontEx(std_output, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
cfix = orig_cfix;
SetLastError(0xdeadbeef); - ret = SetCurrentConsoleFontEx(NULL, FALSE, &cfix); + ret = pSetCurrentConsoleFontEx(NULL, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); - ret = SetCurrentConsoleFontEx(NULL, TRUE, &cfix); + ret = pSetCurrentConsoleFontEx(NULL, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
CreatePipe(&pipe1, &pipe2, NULL, 0); SetLastError(0xdeadbeef); - ret = SetCurrentConsoleFontEx(pipe1, FALSE, &cfix); + ret = pSetCurrentConsoleFontEx(pipe1, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError()); CloseHandle(pipe1); @@ -3648,35 +3650,35 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
CreatePipe(&pipe1, &pipe2, NULL, 0); SetLastError(0xdeadbeef); - ret = SetCurrentConsoleFontEx(pipe1, TRUE, &cfix); + ret = pSetCurrentConsoleFontEx(pipe1, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError()); CloseHandle(pipe1); CloseHandle(pipe2);
SetLastError(0xdeadbeef); - ret = SetCurrentConsoleFontEx(std_input, FALSE, &cfix); + ret = pSetCurrentConsoleFontEx(std_input, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); - ret = SetCurrentConsoleFontEx(std_input, TRUE, &cfix); + ret = pSetCurrentConsoleFontEx(std_input, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); - ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix); + ret = pSetCurrentConsoleFontEx(std_output, FALSE, &cfix); ok(ret, "got %d, expected non-zero\n", ret); ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError());
SetLastError(0xdeadbeef); - ret = SetCurrentConsoleFontEx(std_output, TRUE, &cfix); + ret = pSetCurrentConsoleFontEx(std_output, TRUE, &cfix); ok(ret, "got %d, expected non-zero\n", ret); ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError());
/* Restore original console font parameters */ SetLastError(0xdeadbeef); - ret = SetCurrentConsoleFontEx(std_output, FALSE, &orig_cfix); + ret = pSetCurrentConsoleFontEx(std_output, FALSE, &orig_cfix); ok(ret, "got %d, expected non-zero\n", ret); ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError()); }