Commit 95f8270b authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

kernel32/tests: Add tests for GetConsoleScreenBufferInfoEx.

parent 1def1e2f
......@@ -2938,6 +2938,55 @@ static void test_SetConsoleFont(HANDLE std_output)
todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
}
static void test_GetConsoleScreenBufferInfoEx(HANDLE std_output)
{
HANDLE hmod;
BOOL (WINAPI *pGetConsoleScreenBufferInfoEx)(HANDLE, CONSOLE_SCREEN_BUFFER_INFOEX *);
CONSOLE_SCREEN_BUFFER_INFOEX csbix;
BOOL ret;
HANDLE std_input = GetStdHandle(STD_INPUT_HANDLE);
hmod = GetModuleHandleA("kernel32.dll");
pGetConsoleScreenBufferInfoEx = (void *)GetProcAddress(hmod, "GetConsoleScreenBufferInfoEx");
if (!pGetConsoleScreenBufferInfoEx)
{
win_skip("GetConsoleScreenBufferInfoEx is not available\n");
return;
}
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());
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());
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());
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());
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());
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());
}
START_TEST(console)
{
static const char font_name[] = "Lucida Console";
......@@ -3086,4 +3135,5 @@ START_TEST(console)
test_GetLargestConsoleWindowSize(hConOut);
test_GetConsoleFontInfo(hConOut);
test_SetConsoleFont(hConOut);
test_GetConsoleScreenBufferInfoEx(hConOut);
}
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