Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47288 Signed-off-by: Aaro Altonen a.altonen@hotmail.com --- dlls/kernel32/tests/console.c | 10 +++++----- dlls/kernelbase/console.c | 37 ++++++++++++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 8 deletions(-)
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index e6c2c8e364..7da82ae47d 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -3161,24 +3161,24 @@ static void test_SetConsoleScreenBufferInfoEx(HANDLE std_output) SetLastError(0xdeadbeef); ret = pSetConsoleScreenBufferInfoEx(NULL, &info); ok(!ret, "got %d, expected zero\n", ret); - todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 87\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()); + ok(ret, "got %d, expected one\n", ret); + 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, + 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()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
CloseHandle(std_input); } diff --git a/dlls/kernelbase/console.c b/dlls/kernelbase/console.c index 91e8129fbe..9d38398d25 100644 --- a/dlls/kernelbase/console.c +++ b/dlls/kernelbase/console.c @@ -1146,9 +1146,40 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleOutputCP( UINT cp ) BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleScreenBufferInfoEx( HANDLE handle, CONSOLE_SCREEN_BUFFER_INFOEX *info ) { - FIXME( "(%p %p): stub!\n", handle, info ); - SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); - return FALSE; + BOOL ret; + + if (info->cbSize != sizeof(CONSOLE_SCREEN_BUFFER_INFOEX)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + if (!handle) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + + SERVER_START_REQ(set_console_output_info) + { + req->handle = console_handle_unmap(handle); + req->width = info->dwSize.X; + req->height = info->dwSize.Y; + req->cursor_x = info->dwCursorPosition.X; + req->cursor_y = info->dwCursorPosition.Y; + req->attr = info->wAttributes; + req->win_left = info->srWindow.Left; + req->win_top = info->srWindow.Top; + req->win_right = info->srWindow.Right; + req->win_bottom = info->srWindow.Bottom; + req->popup_attr = info->wPopupAttributes; + req->max_width = min(info->dwMaximumWindowSize.X, info->dwSize.X); + req->max_height = min(info->dwMaximumWindowSize.Y, info->dwSize.Y); + ret = !wine_server_call_err(req); + } + SERVER_END_REQ; + + return ret; }
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=66110
Your paranoid android.
=== w2008s64 (32 bit report) ===
kernel32: console.c:3164: Test failed: got 87, expected 87 console.c:3168: Test failed: got 0, expected one console.c:3169: Test failed: got 87, expected 0xdeadbeef console.c:3174: Test failed: got 87, expected 5 or 6
=== w8 (32 bit report) ===
kernel32: console.c:3164: Test failed: got 87, expected 87 console.c:3168: Test failed: got 0, expected one console.c:3169: Test failed: got 87, expected 0xdeadbeef console.c:3174: Test failed: got 87, expected 5 or 6
=== w8adm (32 bit report) ===
kernel32: console.c:3164: Test failed: got 87, expected 87 console.c:3168: Test failed: got 0, expected one console.c:3169: Test failed: got 87, expected 0xdeadbeef console.c:3174: Test failed: got 87, expected 5 or 6
=== w864 (32 bit report) ===
kernel32: console.c:3164: Test failed: got 87, expected 87 console.c:3168: Test failed: got 0, expected one console.c:3169: Test failed: got 87, expected 0xdeadbeef console.c:3174: Test failed: got 87, expected 5 or 6
=== w1064v1507 (32 bit report) ===
kernel32: console.c:3164: Test failed: got 87, expected 87 console.c:3168: Test failed: got 0, expected one console.c:3169: Test failed: got 87, expected 0xdeadbeef console.c:3174: Test failed: got 87, expected 5 or 6
=== w1064v1809 (32 bit report) ===
kernel32: console.c:3168: Test failed: got 0, expected one console.c:3169: Test failed: got 87, expected 0xdeadbeef
=== w1064v1809_2scr (32 bit report) ===
kernel32: console.c:3168: Test failed: got 0, expected one console.c:3169: Test failed: got 87, expected 0xdeadbeef
=== w1064v1809_ar (32 bit report) ===
kernel32: console.c:3168: Test failed: got 0, expected one console.c:3169: Test failed: got 87, expected 0xdeadbeef
=== w1064v1809_he (32 bit report) ===
kernel32: console.c:3168: Test failed: got 0, expected one console.c:3169: Test failed: got 87, expected 0xdeadbeef
=== w1064v1809_ja (32 bit report) ===
kernel32: console.c:3168: Test failed: got 0, expected one console.c:3169: Test failed: got 87, expected 0xdeadbeef
=== w1064v1809_zh_CN (32 bit report) ===
kernel32: console.c:3168: Test failed: got 0, expected one console.c:3169: Test failed: got 87, expected 0xdeadbeef
=== w2008s64 (64 bit report) ===
kernel32: console.c:3164: Test failed: got 87, expected 87 console.c:3168: Test failed: got 0, expected one console.c:3169: Test failed: got 87, expected 0xdeadbeef console.c:3174: Test failed: got 87, expected 5 or 6
=== w864 (64 bit report) ===
kernel32: console.c:3164: Test failed: got 87, expected 87 console.c:3168: Test failed: got 0, expected one console.c:3169: Test failed: got 87, expected 0xdeadbeef console.c:3174: Test failed: got 87, expected 5 or 6
=== w1064v1507 (64 bit report) ===
kernel32: console.c:3164: Test failed: got 87, expected 87 console.c:3168: Test failed: got 0, expected one console.c:3169: Test failed: got 87, expected 0xdeadbeef console.c:3174: Test failed: got 87, expected 5 or 6
=== w1064v1809 (64 bit report) ===
kernel32: console.c:3168: Test failed: got 0, expected one console.c:3169: Test failed: got 87, expected 0xdeadbeef