Commit 2bda84a4 authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

kernel32: Implement GetConsoleScreenBufferInfoEx.

parent 95f8270b
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment