Signed-off-by: Aaro Altonen a.altonen@hotmail.com --- v2: - Fix code formatting and a typo --- dlls/kernel32/tests/console.c | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+)
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 5f8003760d..9c05784a28 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -3142,6 +3142,48 @@ static void test_GetConsoleScreenBufferInfoEx(HANDLE std_output) ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); }
+static void test_SetConsoleScreenBufferInfoEx(HANDLE std_output) +{ + BOOL ret; + HANDLE hmod; + HANDLE std_input = CreateFileA("CONIN$", GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); + BOOL (WINAPI *pSetConsoleScreenBufferInfoEx)(HANDLE, CONSOLE_SCREEN_BUFFER_INFOEX *); + CONSOLE_SCREEN_BUFFER_INFOEX info; + info.cbSize = sizeof(CONSOLE_SCREEN_BUFFER_INFOEX); + + hmod = GetModuleHandleA("kernel32.dll"); + pSetConsoleScreenBufferInfoEx = (void *)GetProcAddress(hmod, "SetConsoleScreenBufferInfoEx"); + if (!pSetConsoleScreenBufferInfoEx) + { + win_skip("SetConsoleScreenBufferInfoEx is not available\n"); + return; + } + + SetLastError(0xdeadbeef); + ret = pSetConsoleScreenBufferInfoEx(NULL, &info); + ok(!ret, "got %d, expected zero\n", ret); + todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pSetConsoleScreenBufferInfoEx(std_output, &info); + todo_wine ok(ret, "got %d, expected one\n", ret); + todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pSetConsoleScreenBufferInfoEx(std_input, &info); + ok(!ret, "got %d, expected zero\n", ret); + todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE || GetLastError() == ERROR_ACCESS_DENIED, + "got %u, expected 5 or 6\n", GetLastError()); + + info.cbSize = 0; + SetLastError(0xdeadbeef); + ret = pSetConsoleScreenBufferInfoEx(std_output, &info); + ok(!ret, "got %d, expected zero\n", ret); + todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + + CloseHandle(std_input); +} + static void test_AttachConsole_child(DWORD console_pid) { HANDLE pipe_in, pipe_out; @@ -3398,5 +3440,6 @@ START_TEST(console) test_GetConsoleFontInfo(hConOut); test_SetConsoleFont(hConOut); test_GetConsoleScreenBufferInfoEx(hConOut); + test_SetConsoleScreenBufferInfoEx(hConOut); test_AttachConsole(hConOut); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=66203
Your paranoid android.
=== w2008s64 (64 bit report) ===
kernel32: console.c:3165: Test failed: got 87, expected 6 console.c:3169: Test failed: got 0, expected one console.c:3170: Test failed: got 87, expected 0xdeadbeef console.c:3175: Test failed: got 87, expected 5 or 6
=== w864 (64 bit report) ===
kernel32: console.c:3165: Test failed: got 87, expected 6 console.c:3169: Test failed: got 0, expected one console.c:3170: Test failed: got 87, expected 0xdeadbeef console.c:3175: Test failed: got 87, expected 5 or 6
=== w1064v1507 (64 bit report) ===
kernel32: console.c:3165: Test failed: got 87, expected 6 console.c:3169: Test failed: got 0, expected one console.c:3170: Test failed: got 87, expected 0xdeadbeef console.c:3175: Test failed: got 87, expected 5 or 6
=== w1064v1809 (64 bit report) ===
kernel32: console.c:3169: Test failed: got 0, expected one console.c:3170: Test failed: got 87, expected 0xdeadbeef