kernel32: Implement GetConsoleScreenBufferInfoEx.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hugh McMaster 2016-08-17 01:35:53 +00:00 committed by Alexandre Julliard
parent 95f8270bc2
commit 2bda84a410
2 changed files with 39 additions and 10 deletions

View File

@ -3356,9 +3356,38 @@ BOOL WINAPI GetConsoleFontInfo(HANDLE hConsole, BOOL maximize, DWORD numfonts, C
BOOL WINAPI GetConsoleScreenBufferInfoEx(HANDLE hConsole, CONSOLE_SCREEN_BUFFER_INFOEX *csbix)
{
FIXME("(%p %p): stub!\n", hConsole, csbix);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
BOOL ret;
if (csbix->cbSize != sizeof(CONSOLE_SCREEN_BUFFER_INFOEX))
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
SERVER_START_REQ(get_console_output_info)
{
req->handle = console_handle_unmap(hConsole);
wine_server_set_reply(req, csbix->ColorTable, sizeof(csbix->ColorTable));
if ((ret = !wine_server_call_err(req)))
{
csbix->dwSize.X = reply->width;
csbix->dwSize.Y = reply->height;
csbix->dwCursorPosition.X = reply->cursor_x;
csbix->dwCursorPosition.Y = reply->cursor_y;
csbix->wAttributes = reply->attr;
csbix->srWindow.Left = reply->win_left;
csbix->srWindow.Top = reply->win_top;
csbix->srWindow.Right = reply->win_right;
csbix->srWindow.Bottom = reply->win_bottom;
csbix->dwMaximumWindowSize.X = min(reply->width, reply->max_width);
csbix->dwMaximumWindowSize.Y = min(reply->height, reply->max_height);
csbix->wPopupAttributes = reply->popup_attr;
csbix->bFullscreenSupported = FALSE;
}
}
SERVER_END_REQ;
return ret;
}
BOOL WINAPI SetConsoleScreenBufferInfoEx(HANDLE hConsole, CONSOLE_SCREEN_BUFFER_INFOEX *csbix)

View File

@ -2957,34 +2957,34 @@ static void test_GetConsoleScreenBufferInfoEx(HANDLE std_output)
SetLastError(0xdeadbeef);
ret = pGetConsoleScreenBufferInfoEx(NULL, &csbix);
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());
SetLastError(0xdeadbeef);
ret = pGetConsoleScreenBufferInfoEx(std_input, &csbix);
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());
SetLastError(0xdeadbeef);
ret = pGetConsoleScreenBufferInfoEx(std_output, &csbix);
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());
csbix.cbSize = sizeof(CONSOLE_SCREEN_BUFFER_INFOEX);
SetLastError(0xdeadbeef);
ret = pGetConsoleScreenBufferInfoEx(NULL, &csbix);
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 = pGetConsoleScreenBufferInfoEx(std_input, &csbix);
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 = pGetConsoleScreenBufferInfoEx(std_output, &csbix);
todo_wine ok(ret, "got %d, expected non-zero\n", ret);
todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
ok(ret, "got %d, expected non-zero\n", ret);
ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
}
START_TEST(console)