36#define TEST_ATTRIB (BACKGROUND_BLUE | FOREGROUND_GREEN)
37#define DEFAULT_ATTRIB (FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED)
41#define CONTENT(c) ('A' + (((c).Y * 17 + (c).X) % 23))
43#define okCURSOR(hCon, c) do { \
44 CONSOLE_SCREEN_BUFFER_INFO __sbi; \
45 BOOL expect = GetConsoleScreenBufferInfo((hCon), &__sbi) && \
46 __sbi.dwCursorPosition.X == (c).X && __sbi.dwCursorPosition.Y == (c).Y; \
47 ok(expect, "Expected cursor at (%d,%d), got (%d,%d)\n", \
48 (c).X, (c).Y, __sbi.dwCursorPosition.X, __sbi.dwCursorPosition.Y); \
51#define okCHAR(hCon, c, ch, attr) do { \
52 char __ch; WORD __attr; DWORD __len; BOOL expect; \
53 expect = ReadConsoleOutputCharacterA((hCon), &__ch, 1, (c), &__len) == 1 && __len == 1 && __ch == (ch); \
54 ok(expect, "At (%d,%d): expecting char '%c'/%02x got '%c'/%02x\n", (c).X, (c).Y, (ch), (ch), __ch, __ch); \
55 expect = ReadConsoleOutputAttribute((hCon), &__attr, 1, (c), &__len) == 1 && __len == 1 && __attr == (attr); \
56 ok(expect, "At (%d,%d): expecting attr %04x got %04x\n", (c).X, (c).Y, (attr), __attr); \
63#define KERNEL32_GET_PROC(func) \
64 p##func = (void *)GetProcAddress(hKernel32, #func); \
65 if(!p##func) trace("GetProcAddress(hKernel32, '%s') failed\n", #func);
74#undef KERNEL32_GET_PROC
85 for (
c.X = 0;
c.X < sbSize.
X;
c.X++)
87 for (
c.Y = 0;
c.Y < sbSize.
Y;
c.Y++)
146 ok(!
ret,
"Expected failure\n");
153 ok(!
ret,
"Expected failure\n");
154 ok(
info.dwSize == -1,
"Expected no change for dwSize\n");
161 ok(
ret,
"Expected success\n");
164 "Expected 12 or 25, got %d\n",
info.dwSize);
165 ok(
info.bVisible,
"Expected the cursor to be visible\n");
166 ok(
GetLastError() == 0xdeadbeef,
"GetLastError: expecting %u got %u\n",
174 static const char emptybuf[16];
215 const char*
mytest =
"abcdefg";
224 for (
c.X = 0;
c.X < mylen;
c.X++)
237 const char*
mytest =
"123";
243 "clearing wrap at EOL & processed output\n");
246 c.X = sbSize.
X - 3;
c.Y = 0;
250 ok(
ret != 0 &&
len == mylen,
"Couldn't write, ret = %d, len = %d\n",
ret,
len);
252 for (
p = mylen - 3;
p < mylen;
p++)
254 c.X = sbSize.
X - 3 +
p % 3;
261 p = sbSize.
X - 3 + mylen % 3;
265 c.X = sbSize.
X - mylen;
c.Y = 0;
275 const char*
mytest =
"abcd\nf\tg";
282 "clearing wrap at EOL & setting processed output\n");
285 c.X = sbSize.
X - 5;
c.Y = 0;
290 for (
c.X = sbSize.
X - 5;
c.X < sbSize.
X - 1;
c.X++)
299 win_skip(
"Win9x/WinMe don't respect ~ENABLE_WRAP_AT_EOL_OUTPUT\n");
307 for (
c.X = 1;
c.X < 8;
c.X++)
316 c.X = sbSize.
X - 4;
c.Y = 0;
321 for (
c.X = sbSize.
X - 4;
c.X < sbSize.
X;
c.X++)
327 for (
c.X = 1;
c.X < 8;
c.X++)
336 c.X = sbSize.
X - 3;
c.Y = 0;
341 for (
p = mylen2 - 3;
p < mylen2;
p++)
343 c.X = sbSize.
X - 3 +
p % 3;
348 for (
c.X = 1;
c.X < 8;
c.X++)
361 const char*
mytest =
"abcd\nf\tg";
366 "setting wrap at EOL & clearing processed output\n");
369 c.X = sbSize.
X - 9;
c.Y = 0;
374 for (
p = 0;
p < mylen;
p++)
376 c.X = sbSize.
X - 9 +
p;
379 c.X = sbSize.
X - 9 + mylen;
385 c.X = sbSize.
X - 3;
c.Y = 0;
397 const char*
mytest =
"abcd\nf\tg";
403 "setting wrap at EOL & processed output\n");
406 c.X = sbSize.
X - 9;
c.Y = 0;
410 for (
p = 0;
p < 4;
p++)
412 c.X = sbSize.
X - 9 +
p;
415 c.X = sbSize.
X - 9 +
p;
418 win_skip(
"Win9x/WinMe changes attribs for '\\n' up to 'f'\n");
423 for (
c.X = 1;
c.X < 8;
c.X++)
431 c.X = sbSize.
X - 3;
c.Y = 2;
435 for (
p = 0;
p < 3;
p++)
437 c.X = sbSize.
X - 3 +
p;
445 win_skip(
"Win9x/WinMe changes attribs for '\\n' up to 'f'\n");
451 for (
c.X = 1;
c.X < 8;
c.X++)
487#define IN_SRECT(r,c) ((r).Left <= (c).X && (c).X <= (r).Right && (r).Top <= (c).Y && (c).Y <= (r).Bottom)
488#define IN_SRECT2(r,d,c) ((d).X <= (c).X && (c).X <= (d).X + (r).Right - (r).Left && (d).Y <= (c).Y && (c).Y <= (d).Y + (r).Bottom - (r).Top)
503 clip.
Right = sbSize.
X - 1;
509 for (
c.Y = 0;
c.Y < sbSize.
Y;
c.Y++)
511 for (
c.X = 0;
c.X < sbSize.
X;
c.X++)
538 clip.
Right = sbSize.
X - 1;
544 for (
c.Y = 0;
c.Y < sbSize.
Y;
c.Y++)
546 for (
c.X = 0;
c.X < sbSize.
X;
c.X++)
580 for (
c.Y = 0;
c.Y < sbSize.
Y;
c.Y++)
582 for (
c.X = 0;
c.X < sbSize.
X;
c.X++)
600 "Expected ERROR_NOT_ENOUGH_MEMORY, got %u\n",
GetLastError());
622 for (
c.Y = 0;
c.Y < sbSize.
Y;
c.Y++)
624 for (
c.X = 0;
c.X < sbSize.
X;
c.X++)
664 if (0)
ok(
mch_count == 1,
"Event isn't synchronous\n");
697 HANDLE hConOutRW, hConOutRO, hConOutWT;
698 HANDLE hFileOutRW, hFileOutRO, hFileOutWT;
700 char test_str1[] =
"Test for SB1";
701 char test_str2[] =
"Test for SB2";
702 char test_cp866[] = {0xe2, 0xa5, 0xe1, 0xe2, 0};
703 char test_cp1251[] = {0xf2, 0xe5, 0xf1, 0xf2, 0};
714 skip(
"Codepage 866 not available\n");
724 win_skip(
"SetConsoleOutputCP is not implemented\n");
727 ok(
ret,
"Cannot set output codepage to 866\n");
733 "Cannot create a new screen buffer for ReadWrite\n");
738 "Cannot create a new screen buffer for ReadOnly\n");
743 "Cannot create a new screen buffer for WriteOnly\n");
759 "Shouldn't succeed\n");
761 "GetLastError: expecting %u got %u\n",
768 "GetLastError: expecting %u got %u\n",
774 "GetLastError: expecting %u got %u\n",
780 "GetLastError: expecting %u got %u\n",
787 ok(!
ret,
"Shouldn't succeed\n");
789 "GetLastError: got %u\n",
error);
794 ok(!
ret,
"Shouldn't succeed\n");
796 "GetLastError: got %u\n",
error);
801 ok(!
ret,
"Shouldn't succeed\n");
803 "GetLastError: got %u\n",
error);
813 "GetLastError: expecting %u got %u\n",
848 ok(
ret &&
len ==
lstrlenA(test_str2),
"ReadConsoleOutputCharacterA failed\n");
858 ok(
ret &&
len ==
lstrlenA(test_cp866),
"ReadConsoleOutputCharacterW failed\n");
871 ok(
ret &&
len ==
lstrlenA(test_cp1251),
"ReadConsoleOutputCharacterW failed\n");
872 str_wbuf[
lstrlenA(test_cp1251)] = 0;
880 ok(
ret &&
len ==
lstrlenA(test_cp1251),
"ReadConsoleOutputCharacterW failed\n");
881 str_wbuf[
lstrlenA(test_cp1251)] = 0;
899 ok(
ret &&
len ==
lstrlenA(test_str1),
"ReadConsoleOutputCharacterA failed\n");
915 ok(!
timeout,
"wait shouldn't have timed out\n");
923 DWORD events_written;
931 ok(
ret ==
TRUE,
"Expected RegisterWaitForSingleObject to return TRUE, got %d\n",
ret);
935 record.Event.KeyEvent.bKeyDown = 1;
936 record.Event.KeyEvent.wRepeatCount = 1;
939 record.Event.KeyEvent.uChar.UnicodeChar =
'\r';
940 record.Event.KeyEvent.dwControlKeyState = 0;
942 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
949 "UnregisterWait failed with error %d\n",
GetLastError());
968 static char input_exe[
MAX_PATH] =
"winetest.exe";
971 ret = pGetConsoleInputExeNameA(0,
NULL);
973 ok(
ret,
"GetConsoleInputExeNameA failed\n");
977 ret = pGetConsoleInputExeNameA(0,
buffer);
979 ok(
ret,
"GetConsoleInputExeNameA failed\n");
986 ok(
ret,
"GetConsoleInputExeNameA failed\n");
990 ret = pSetConsoleInputExeNameA(
NULL);
992 ok(!
ret,
"SetConsoleInputExeNameA failed\n");
996 ret = pSetConsoleInputExeNameA(
"");
998 ok(!
ret,
"SetConsoleInputExeNameA failed\n");
1001 ret = pSetConsoleInputExeNameA(input_exe);
1002 ok(
ret,
"SetConsoleInputExeNameA failed\n");
1005 ok(
ret,
"GetConsoleInputExeNameA failed\n");
1013 if (!pGetConsoleProcessList)
1015 win_skip(
"GetConsoleProcessList is not available\n");
1020 ret = pGetConsoleProcessList(
NULL, 0);
1021 ok(
ret == 0,
"Expected failure\n");
1023 "Expected ERROR_INVALID_PARAMETER, got %d\n",
1027 ret = pGetConsoleProcessList(
NULL, 1);
1028 ok(
ret == 0,
"Expected failure\n");
1030 "Expected ERROR_INVALID_PARAMETER, got %d\n",
1040 ret = pGetConsoleProcessList(
list, 0);
1041 ok(
ret == 0,
"Expected failure\n");
1043 "Expected ERROR_INVALID_PARAMETER, got %d\n",
1047 ret = pGetConsoleProcessList(
list, 1);
1049 ok(
ret == 1,
"Expected 1, got %d\n",
ret);
1058 ok(
ret == 1,
"Expected 1, got %d\n",
ret);
1071 static const WCHAR conW[] = {
'C',
'O',
'N',0};
1077 for (
i = 0;
i <
sizeof(accesses) /
sizeof(accesses[0]);
i++)
1081 "Expected to open the CON device on write (%x)\n", accesses[
i]);
1091 "Expected to open the CON device on read (%x)\n", accesses[
i]);
1102 static const WCHAR coninW[] = {
'C',
'O',
'N',
'I',
'N',
'$',0};
1103 static const WCHAR conoutW[] = {
'C',
'O',
'N',
'O',
'U',
'T',
'$',0};
1105 static const WCHAR invalidW[] = {
'I',
'N',
'V',
'A',
'L',
'I',
'D',0};
1115 } invalid_table[] = {
1154 {coninW, 0,
FALSE, 0 },
1155 {coninW, 0,
TRUE, 0 },
1164 {conoutW, 0,
FALSE, 0 },
1178 win_skip(
"OpenConsoleW is not available\n");
1182 for (
index = 0;
index <
sizeof(invalid_table)/
sizeof(invalid_table[0]);
index++)
1186 invalid_table[
index].inherit, invalid_table[
index].creation);
1189 "Expected OpenConsoleW to return INVALID_HANDLE_VALUE for index %d, got %p\n",
1191 ok(gle == invalid_table[
index].gle || (gle != 0 && gle == invalid_table[
index].gle2),
1192 "Expected GetLastError() to return %u/%u for index %d, got %u\n",
1196 for (
index = 0;
index <
sizeof(valid_table)/
sizeof(valid_table[0]);
index++)
1199 valid_table[
index].inherit, valid_table[
index].creation);
1202 "Expected OpenConsoleW to succeed for index %d, got %p\n",
index,
ret);
1220 static const WCHAR coninW[] = {
'C',
'O',
'N',
'I',
'N',
'$',0};
1221 static const WCHAR conoutW[] = {
'C',
'O',
'N',
'O',
'U',
'T',
'$',0};
1251 for (
index = 0;
index <
sizeof(cf_table)/
sizeof(cf_table[0]);
index++)
1255 sa.nLength =
sizeof(
sa);
1256 sa.lpSecurityDescriptor =
NULL;
1257 sa.bInheritHandle = cf_table[
index].inherit;
1265 "Expected CreateFileW not to return INVALID_HANDLE_VALUE for index %d\n",
index);
1267 "Expected GetLastError() to return %u for index %d, got %u\n",
1273 "Expected CreateFileW to succeed for index %d\n",
index);
1284 if (!pVerifyConsoleIoHandle)
1286 win_skip(
"VerifyConsoleIoHandle is not available\n");
1292 ret = pVerifyConsoleIoHandle((
HANDLE)0xdeadbee0);
1294 ok(!
ret,
"expected VerifyConsoleIoHandle to fail\n");
1295 ok(
error == 0xdeadbeef,
"wrong GetLastError() %d\n",
error);
1299 ret = pVerifyConsoleIoHandle((
HANDLE)0xdeadbee1);
1301 ok(!
ret,
"expected VerifyConsoleIoHandle to fail\n");
1302 ok(
error == 0xdeadbeef,
"wrong GetLastError() %d\n",
error);
1306 ret = pVerifyConsoleIoHandle((
HANDLE)0xdeadbee2);
1308 ok(!
ret,
"expected VerifyConsoleIoHandle to fail\n");
1309 ok(
error == 0xdeadbeef,
"wrong GetLastError() %d\n",
error);
1313 ret = pVerifyConsoleIoHandle((
HANDLE)0xdeadbee3);
1315 ok(!
ret,
"expected VerifyConsoleIoHandle to fail\n");
1316 ok(
error == 0xdeadbeef,
"wrong GetLastError() %d\n",
error);
1324 "expected VerifyConsoleIoHandle to succeed\n");
1325 ok(
error == 0xdeadbeef,
"wrong GetLastError() %d\n",
error);
1339 "wrong GetLastError() %d\n",
error);
1346 ok(
error == 0xdeadbeef,
"wrong GetLastError() %d\n",
error);
1352 ok(!
ret,
"expected SetStdHandle to fail\n");
1354 "wrong GetLastError() %d\n",
error);
1360 ok(
ret,
"expected SetStdHandle to succeed\n");
1361 ok(
error == 0xdeadbeef,
"wrong GetLastError() %d\n",
error);
1383 for (
i = 0;
i <
sizeof(invalid_table)/
sizeof(invalid_table[0]);
i++)
1386 if (invalid_table[
i].nrofevents)
count = 0xdeadbeef;
1388 invalid_table[
i].nrofevents);
1389 ok(!
ret,
"[%d] Expected GetNumberOfConsoleInputEvents to return FALSE, got %d\n",
i,
ret);
1390 if (invalid_table[
i].nrofevents)
1393 "[%d] Expected output count to be unmodified, got %u\n",
i,
count);
1396 "[%d] Expected last error to be %u, got %u\n",
1405 ok(!
ret,
"Expected GetNumberOfConsoleInputEvents to return FALSE, got %d\n",
ret);
1407 "Expected last error to be ERROR_INVALID_ACCESS, got %u\n",
1413 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1414 ok(
count != 0xdeadbeef,
"Expected output count to initialized\n");
1462 ok(
ret ==
TRUE,
"Expected GetConsoleMode to return TRUE, got %d\n",
ret);
1470 ok(
ret ==
TRUE,
"Expected SetConsoleMode to return TRUE, got %d\n",
ret);
1479 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
1484 for (
i = 0;
i <
sizeof(invalid_table)/
sizeof(invalid_table[0]);
i++)
1486 if (invalid_table[
i].win_crash)
1490 if (invalid_table[
i].written)
count = 0xdeadbeef;
1494 invalid_table[
i].written);
1495 ok(!
ret,
"[%d] Expected WriteConsoleInputA to return FALSE, got %d\n",
i,
ret);
1497 ok(gle == invalid_table[
i].gle || (gle != 0 && gle == invalid_table[
i].gle2),
1498 "[%d] Expected last error to be %u or %u, got %u\n",
1499 i, invalid_table[
i].gle, invalid_table[
i].gle2, gle);
1504 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1505 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
1509 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1510 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
1514 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1515 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1518 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
1525 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1526 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1529 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1530 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1533 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1534 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1537 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1539 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1542 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
1544 for (
i = 0;
i <
sizeof(event_list)/
sizeof(event_list[0]);
i++)
1552 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1553 ok(
count ==
sizeof(event_list)/
sizeof(event_list[0]),
1554 "Expected count to be event list length, got %u\n",
count);
1557 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1558 ok(
count ==
sizeof(event_list)/
sizeof(event_list[0]),
1559 "Expected count to be event list length, got %u\n",
count);
1562 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1563 ok(
count ==
sizeof(event_list)/
sizeof(event_list[0]),
1564 "Expected count to be event list length, got %u\n",
count);
1567 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1568 ok(
count == 2*
sizeof(event_list)/
sizeof(event_list[0]),
1569 "Expected count to be twice event list length, got %u\n",
count);
1573 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1574 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1577 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1579 ok(
count == 2*
sizeof(event_list)/
sizeof(event_list[0]),
1580 "Expected count to be twice event list length, got %u\n",
count);
1583 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
1597 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1598 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1601 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1602 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1605 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1606 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1609 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1610 ok(
count == 2,
"Expected count to be 2, got %u\n",
count);
1613 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
1620 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1621 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1624 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1625 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1631 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1632 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1635 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1636 ok(
count == 2,
"Expected count to be 2, got %u\n",
count);
1642 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1643 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1646 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1647 ok(
count == 3,
"Expected count to be 3, got %u\n",
count);
1651 ok(
ret ==
TRUE,
"Expected SetConsoleMode to return TRUE, got %d\n",
ret);
1699 ok(
ret ==
TRUE,
"Expected GetConsoleMode to return TRUE, got %d\n",
ret);
1707 ok(
ret ==
TRUE,
"Expected SetConsoleMode to return TRUE, got %d\n",
ret);
1716 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
1721 for (
i = 0;
i <
sizeof(invalid_table)/
sizeof(invalid_table[0]);
i++)
1723 if (invalid_table[
i].win_crash)
1727 if (invalid_table[
i].written)
count = 0xdeadbeef;
1731 invalid_table[
i].written);
1732 ok(!
ret,
"[%d] Expected WriteConsoleInputW to return FALSE, got %d\n",
i,
ret);
1734 ok(gle == invalid_table[
i].gle || (gle != 0 && gle == invalid_table[
i].gle2),
1735 "[%d] Expected last error to be %u or %u, got %u\n",
1736 i, invalid_table[
i].gle, invalid_table[
i].gle2, gle);
1741 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
1742 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
1746 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
1747 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
1751 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
1752 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1755 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
1762 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
1763 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1766 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1767 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1770 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
1771 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1774 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1776 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1779 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
1781 for (
i = 0;
i <
sizeof(event_list)/
sizeof(event_list[0]);
i++)
1789 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
1790 ok(
count ==
sizeof(event_list)/
sizeof(event_list[0]),
1791 "Expected count to be event list length, got %u\n",
count);
1794 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1795 ok(
count ==
sizeof(event_list)/
sizeof(event_list[0]),
1796 "Expected count to be event list length, got %u\n",
count);
1799 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
1800 ok(
count ==
sizeof(event_list)/
sizeof(event_list[0]),
1801 "Expected count to be event list length, got %u\n",
count);
1804 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1805 ok(
count == 2*
sizeof(event_list)/
sizeof(event_list[0]),
1806 "Expected count to be twice event list length, got %u\n",
count);
1810 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
1811 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1814 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1816 ok(
count == 2*
sizeof(event_list)/
sizeof(event_list[0]),
1817 "Expected count to be twice event list length, got %u\n",
count);
1820 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
1834 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
1835 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1838 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1839 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1842 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
1843 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1846 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1847 ok(
count == 2,
"Expected count to be 2, got %u\n",
count);
1850 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
1857 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
1858 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1861 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1862 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1868 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
1869 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1872 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1873 ok(
count == 2,
"Expected count to be 2, got %u\n",
count);
1879 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
1880 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1883 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1884 ok(
count == 3,
"Expected count to be 3, got %u\n",
count);
1888 ok(
ret ==
TRUE,
"Expected SetConsoleMode to return TRUE, got %d\n",
ret);
1893 static const char output[] = {
'a', 0};
1935 for (
i = 0;
i <
sizeof(invalid_table)/
sizeof(invalid_table[0]);
i++)
1937 if (invalid_table[
i].win7_crash)
1941 if (invalid_table[
i].lpNumCharsWritten)
count = 0xdeadbeef;
1943 invalid_table[
i].
str,
1946 invalid_table[
i].lpNumCharsWritten);
1947 ok(!
ret,
"[%d] Expected WriteConsoleOutputCharacterA to return FALSE, got %d\n",
i,
ret);
1948 if (invalid_table[
i].lpNumCharsWritten)
1951 "[%d] Expected count to be %u, got %u\n",
1955 "[%d] Expected last error to be %u, got %u\n",
1961 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
1962 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
1966 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
1967 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
1971 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
1972 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
1977 static const WCHAR outputW[] = {
'a',0};
2019 for (
i = 0;
i <
sizeof(invalid_table)/
sizeof(invalid_table[0]);
i++)
2021 if (invalid_table[
i].win7_crash)
2025 if (invalid_table[
i].lpNumCharsWritten)
count = 0xdeadbeef;
2027 invalid_table[
i].
str,
2030 invalid_table[
i].lpNumCharsWritten);
2031 ok(!
ret,
"[%d] Expected WriteConsoleOutputCharacterW to return FALSE, got %d\n",
i,
ret);
2032 if (invalid_table[
i].lpNumCharsWritten)
2035 "[%d] Expected count to be %u, got %u\n",
2039 "[%d] Expected last error to be %u, got %u\n",
2045 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
2046 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
2050 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
2051 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
2055 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
2056 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
2102 for (
i = 0;
i <
sizeof(invalid_table)/
sizeof(invalid_table[0]);
i++)
2104 if (invalid_table[
i].win7_crash)
2108 if (invalid_table[
i].lpNumAttrsWritten)
count = 0xdeadbeef;
2110 invalid_table[
i].
attr,
2113 invalid_table[
i].lpNumAttrsWritten);
2114 ok(!
ret,
"[%d] Expected WriteConsoleOutputAttribute to return FALSE, got %d\n",
i,
ret);
2115 if (invalid_table[
i].lpNumAttrsWritten)
2118 "[%d] Expected count to be %u, got %u\n",
2122 "[%d] Expected last error to be %u, got %u\n",
2128 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputAttribute to return TRUE, got %d\n",
ret);
2129 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
2133 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputAttribute to return TRUE, got %d\n",
ret);
2134 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
2138 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputAttribute to return TRUE, got %d\n",
ret);
2139 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
2172 for (
i = 0;
i <
sizeof(invalid_table)/
sizeof(invalid_table[0]);
i++)
2174 if (invalid_table[
i].win7_crash)
2178 if (invalid_table[
i].lpNumCharsWritten)
count = 0xdeadbeef;
2180 invalid_table[
i].ch,
2183 invalid_table[
i].lpNumCharsWritten);
2184 ok(!
ret,
"[%d] Expected FillConsoleOutputCharacterA to return FALSE, got %d\n",
i,
ret);
2186 "[%d] Expected last error to be %u, got %u\n",
2192 ok(
ret ==
TRUE,
"Expected FillConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
2193 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
2197 ok(
ret ==
TRUE,
"Expected FillConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
2198 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
2231 for (
i = 0;
i <
sizeof(invalid_table)/
sizeof(invalid_table[0]);
i++)
2233 if (invalid_table[
i].win7_crash)
2237 if (invalid_table[
i].lpNumCharsWritten)
count = 0xdeadbeef;
2239 invalid_table[
i].ch,
2242 invalid_table[
i].lpNumCharsWritten);
2243 ok(!
ret,
"[%d] Expected FillConsoleOutputCharacterW to return FALSE, got %d\n",
i,
ret);
2245 "[%d] Expected last error to be %u, got %u\n",
2251 ok(
ret ==
TRUE,
"Expected FillConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
2252 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
2256 ok(
ret ==
TRUE,
"Expected FillConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
2257 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
2290 for (
i = 0;
i <
sizeof(invalid_table)/
sizeof(invalid_table[0]);
i++)
2292 if (invalid_table[
i].win7_crash)
2296 if (invalid_table[
i].lpNumAttrsWritten)
count = 0xdeadbeef;
2298 invalid_table[
i].
attr,
2301 invalid_table[
i].lpNumAttrsWritten);
2302 ok(!
ret,
"[%d] Expected FillConsoleOutputAttribute to return FALSE, got %d\n",
i,
ret);
2304 "[%d] Expected last error to be %u, got %u\n",
2310 ok(
ret ==
TRUE,
"Expected FillConsoleOutputAttribute to return TRUE, got %d\n",
ret);
2311 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
2315 ok(
ret ==
TRUE,
"Expected FillConsoleOutputAttribute to return TRUE, got %d\n",
ret);
2316 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
2320 ok(
ret ==
TRUE,
"Expected FillConsoleOutputAttribute to return TRUE, got %d\n",
ret);
2321 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
2368 for (
i = 0;
i <
sizeof(invalid_table)/
sizeof(invalid_table[0]);
i++)
2370 if (invalid_table[
i].win7_crash)
2374 if (invalid_table[
i].read_count)
count = 0xdeadbeef;
2379 invalid_table[
i].read_count);
2380 ok(!
ret,
"[%d] Expected ReadConsoleOutputCharacterA to return FALSE, got %d\n",
i,
ret);
2381 if (invalid_table[
i].read_count)
2384 "[%d] Expected count to be %u, got %u\n",
2388 "[%d] Expected last error to be %u, got %u\n",
2394 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
2395 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
2399 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
2400 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
2404 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
2405 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
2452 for (
i = 0;
i <
sizeof(invalid_table)/
sizeof(invalid_table[0]);
i++)
2454 if (invalid_table[
i].win7_crash)
2458 if (invalid_table[
i].read_count)
count = 0xdeadbeef;
2463 invalid_table[
i].read_count);
2464 ok(!
ret,
"[%d] Expected ReadConsoleOutputCharacterW to return FALSE, got %d\n",
i,
ret);
2465 if (invalid_table[
i].read_count)
2468 "[%d] Expected count to be %u, got %u\n",
2472 "[%d] Expected last error to be %u, got %u\n",
2478 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
2479 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
2483 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
2484 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
2488 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
2489 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
2535 for (
i = 0;
i <
sizeof(invalid_table)/
sizeof(invalid_table[0]);
i++)
2537 if (invalid_table[
i].win7_crash)
2541 if (invalid_table[
i].read_count)
count = 0xdeadbeef;
2543 invalid_table[
i].lpAttribute,
2546 invalid_table[
i].read_count);
2547 ok(!
ret,
"[%d] Expected ReadConsoleOutputAttribute to return FALSE, got %d\n",
i,
ret);
2548 if (invalid_table[
i].read_count)
2551 "[%d] Expected count to be %u, got %u\n",
2555 "[%d] Expected last error to be %u, got %u\n",
2561 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputAttribute to return TRUE, got %d\n",
ret);
2562 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
2566 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputAttribute to return TRUE, got %d\n",
ret);
2567 ok(
count == 0,
"Expected count to be 0, got %u\n",
count);
2571 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputAttribute to return TRUE, got %d\n",
ret);
2572 ok(
count == 1,
"Expected count to be 1, got %u\n",
count);
2587 skip(
"stdin is redirected\n");
2593 "expected ERROR_INVALID_HANDLE, got %d\n",
GetLastError());
2598 ok(!
ret,
"expected 0, got %u\n",
ret);
2601 "expected ERROR_NOT_ENOUGH_MEMORY, got %d\n",
GetLastError());
2607 ok(!
ret,
"expected 0, got %u\n",
ret);
2610 "expected ERROR_NOT_ENOUGH_MEMORY, got %d\n",
GetLastError());
2611 ok(
bytes == 0xdeadbeef,
"expected 0xdeadbeef, got %#x\n",
bytes);
2616 ok(!
ret,
"expected 0, got %u\n",
ret);
2619 "expected ERROR_NOT_ENOUGH_MEMORY, got %d\n",
GetLastError());
2620 ok(
bytes == 0xdeadbeef,
"expected 0xdeadbeef, got %#x\n",
bytes);
2634 ok(!
ret,
"got %d, expected 0\n",
ret);
2642 ok(!
ret,
"got %d, expected 0\n",
ret);
2650 ok(!
ret,
"got %d, expected 0\n",
ret);
2658 ok(!
ret,
"got %d, expected 0\n",
ret);
2666 ok(
ret,
"got %d, expected non-zero\n",
ret);
2680 ok(
ret,
"got %d, expected non-zero\n",
ret);
2703 ok(!
c.X,
"got %d, expected 0\n",
c.X);
2704 ok(!
c.Y,
"got %d, expected 0\n",
c.Y);
2710 ok(!
c.X,
"got %d, expected 0\n",
c.X);
2711 ok(!
c.Y,
"got %d, expected 0\n",
c.Y);
2722 ok(
c.X == font_width,
"got %d, expected %d\n",
c.X, font_width);
2727 if (!pGetNumberOfConsoleFonts)
2729 win_skip(
"GetNumberOfConsoleFonts is not available\n");
2732 index = pGetNumberOfConsoleFonts();
2738 ok(!
c.X,
"got %d, expected 0\n",
c.X);
2739 ok(!
c.Y,
"got %d, expected 0\n",
c.Y);
2746 LONG workarea_w, workarea_h, maxcon_w, maxcon_h;
2759 ok(!
c.X,
"got %d, expected 0\n",
c.X);
2760 ok(!
c.Y,
"got %d, expected 0\n",
c.Y);
2766 ok(!
c.X,
"got %d, expected 0\n",
c.X);
2767 ok(!
c.Y,
"got %d, expected 0\n",
c.Y);
2770 workarea_w =
r.right -
r.left;
2778 if (!pGetNumberOfConsoleFonts)
2780 win_skip(
"GetNumberOfConsoleFonts is not available\n");
2784 if (!pSetConsoleFont)
2786 win_skip(
"SetConsoleFont is not available\n");
2790 for (
i = 0;
i < pGetNumberOfConsoleFonts();
i++)
2792 pSetConsoleFont(std_output,
i);
2799 maxcon_w = workarea_w /
font.X;
2800 maxcon_h = workarea_h /
font.Y;
2801 ok(
c.X == maxcon_w ||
c.X == maxcon_w - 1 ,
"got %d, expected %d\n",
c.X, maxcon_w);
2802 ok(
c.Y == maxcon_h ||
c.Y == maxcon_h - 1 ,
"got %d, expected %d\n",
c.Y, maxcon_h);
2811 pSetConsoleFont(std_output,
index);
2820 int memsize, win_width, win_height, tmp_w, tmp_h;
2824 COORD orig_sb_size, tmp_sb_size, orig_font, tmp_font;
2828 if (!pGetConsoleFontInfo)
2830 win_skip(
"GetConsoleFontInfo is not available\n");
2835 if (!pGetNumberOfConsoleFonts)
2837 win_skip(
"GetNumberOfConsoleFonts is not available\n");
2841 num_fonts = pGetNumberOfConsoleFonts();
2847 orig_sb_size = csbi.
dwSize;
2854 ok(!
ret,
"got %d, expected zero\n",
ret);
2859 ok(!
ret,
"got %d, expected zero\n",
ret);
2863 ret = pGetConsoleFontInfo(std_output,
FALSE, 0, cfi);
2864 ok(!
ret,
"got %d, expected zero\n",
ret);
2876 ret = pGetConsoleFontInfo(std_output,
FALSE, num_fonts, cfi);
2879 todo_wine ok(cfi[
index].dwFontSize.X == win_width,
"got %d, expected %d\n",
2881 todo_wine ok(cfi[
index].dwFontSize.Y == win_height,
"got %d, expected %d\n",
2884 for (
i = 0;
i < num_fonts;
i++)
2886 ok(cfi[
i].nFont ==
i,
"element out of order, got nFont %d, expected %d\n", cfi[
i].nFont,
i);
2888 tmp_w = (
double)orig_font.
X / tmp_font.
X * win_width;
2889 tmp_h = (
double)orig_font.
Y / tmp_font.
Y * win_height;
2896 ok(!
ret,
"got %d, expected zero\n",
ret);
2901 ok(!
ret,
"got %d, expected zero\n",
ret);
2905 ret = pGetConsoleFontInfo(std_output,
TRUE, 0, cfi);
2906 ok(!
ret,
"got %d, expected zero\n",
ret);
2910 ret = pGetConsoleFontInfo(std_output,
TRUE, num_fonts, cfi);
2918 for (
i = 0;
i < num_fonts;
i++)
2920 ok(cfi[
i].nFont ==
i,
"element out of order, got nFont %d, expected %d\n", cfi[
i].nFont,
i);
2942 if (!pSetConsoleFont)
2944 win_skip(
"SetConsoleFont is not available\n");
2949 ret = pSetConsoleFont(
NULL, 0);
2950 ok(!
ret,
"got %d, expected zero\n",
ret);
2955 ok(!
ret,
"got %d, expected zero\n",
ret);
2959 if (!pGetNumberOfConsoleFonts)
2961 win_skip(
"GetNumberOfConsoleFonts is not available\n");
2965 num_fonts = pGetNumberOfConsoleFonts();
2968 ret = pSetConsoleFont(std_output, num_fonts);
2969 ok(!
ret,
"got %d, expected zero\n",
ret);
2982 pGetConsoleScreenBufferInfoEx = (
void *)
GetProcAddress(
hmod,
"GetConsoleScreenBufferInfoEx");
2983 if (!pGetConsoleScreenBufferInfoEx)
2985 win_skip(
"GetConsoleScreenBufferInfoEx is not available\n");
2990 ret = pGetConsoleScreenBufferInfoEx(
NULL, &csbix);
2991 ok(!
ret,
"got %d, expected zero\n",
ret);
2995 ret = pGetConsoleScreenBufferInfoEx(std_input, &csbix);
2996 ok(!
ret,
"got %d, expected zero\n",
ret);
3000 ret = pGetConsoleScreenBufferInfoEx(std_output, &csbix);
3001 ok(!
ret,
"got %d, expected zero\n",
ret);
3007 ret = pGetConsoleScreenBufferInfoEx(
NULL, &csbix);
3008 ok(!
ret,
"got %d, expected zero\n",
ret);
3012 ret = pGetConsoleScreenBufferInfoEx(std_input, &csbix);
3013 ok(!
ret,
"got %d, expected zero\n",
ret);
3017 ret = pGetConsoleScreenBufferInfoEx(std_output, &csbix);
3018 ok(
ret,
"got %d, expected non-zero\n",
ret);
3024 static const char font_name[] =
"Lucida Console";
3054 size =
sizeof(old_font);
3061 (
const BYTE *) font_name,
sizeof(font_name));
3063 trace(
"Unable to change default console font, error %d\n",
err);
3067 trace(
"Unable to query default console font, error %d\n",
err);
3074 trace(
"Unable to open HKCU\\Console, error %d\n",
err);
3083 if (console_key !=
NULL)
3089 (
const BYTE *) old_font,
strlen(old_font) + 1);
3100 ok(
ret,
"Getting sb info\n");
3109 ok(
ret,
"Setting sb info\n");
3111 ok(
ret,
"Getting sb info\n");
3144 if (!pGetConsoleInputExeNameA || !pSetConsoleInputExeNameA)
3145 win_skip(
"GetConsoleInputExeNameA and/or SetConsoleInputExeNameA is not available\n");
ACPI_SIZE strlen(const char *String)
char * strchr(const char *String, int ch)
static unsigned char bytes[4]
static struct sockaddr_in sa
BOOL WINAPI SetConsoleOutputCP(IN UINT wCodepage)
BOOL WINAPI WriteConsoleOutputCharacterA(HANDLE hConsoleOutput, IN LPCSTR lpCharacter, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfCharsWritten)
BOOL WINAPI FlushConsoleInputBuffer(IN HANDLE hConsoleInput)
BOOL WINAPI FillConsoleOutputCharacterA(IN HANDLE hConsoleOutput, IN CHAR cCharacter, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfCharsWritten)
BOOL WINAPI SetConsoleCursorPosition(IN HANDLE hConsoleOutput, IN COORD dwCursorPosition)
BOOL WINAPI WriteConsoleOutputCharacterW(HANDLE hConsoleOutput, IN LPCWSTR lpCharacter, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfCharsWritten)
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
BOOL WINAPI AllocConsole(VOID)
BOOL WINAPI FreeConsole(VOID)
BOOL WINAPI SetConsoleTextAttribute(IN HANDLE hConsoleOutput, IN WORD wAttributes)
BOOL WINAPI FillConsoleOutputAttribute(IN HANDLE hConsoleOutput, IN WORD wAttribute, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfAttrsWritten)
BOOL WINAPI GetConsoleScreenBufferInfo(IN HANDLE hConsoleOutput, OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo)
#define ENABLE_WRAP_AT_EOL_OUTPUT
#define ENABLE_PROCESSED_OUTPUT
#define RegCloseKey(hKey)
#define ERROR_NOT_ENOUGH_MEMORY
#define ERROR_INVALID_FUNCTION
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define ReadFile(a, b, c, d, e)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define HeapFree(x, y, z)
#define ERROR_INVALID_HANDLE
#define FILE_ATTRIBUTE_NORMAL
#define ERROR_ACCESS_DENIED
UINT WINAPI DECLSPEC_HOTPATCH GetConsoleOutputCP(VOID)
BOOL WINAPI DECLSPEC_HOTPATCH ScrollConsoleScreenBufferA(HANDLE hConsoleOutput, CONST SMALL_RECT *lpScrollRectangle, CONST SMALL_RECT *lpClipRectangle, COORD dwDestinationOrigin, CONST CHAR_INFO *lpFill)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleScreenBufferSize(HANDLE hConsoleOutput, COORD dwSize)
COORD WINAPI DECLSPEC_HOTPATCH GetLargestConsoleWindowSize(HANDLE hConsoleOutput)
BOOL WINAPI DECLSPEC_HOTPATCH VerifyConsoleIoHandle(HANDLE hIoHandle)
HANDLE WINAPI CreateConsoleScreenBuffer(DWORD dwDesiredAccess, DWORD dwShareMode, CONST SECURITY_ATTRIBUTES *lpSecurityAttributes, DWORD dwFlags, LPVOID lpScreenBufferData)
BOOL WINAPI GetConsoleMode(HANDLE hConsoleHandle, LPDWORD lpMode)
BOOL WINAPI GetCurrentConsoleFont(IN HANDLE hConsoleOutput, IN BOOL bMaximumWindow, OUT PCONSOLE_FONT_INFO lpConsoleCurrentFont)
COORD WINAPI DECLSPEC_HOTPATCH GetConsoleFontSize(IN HANDLE hConsoleOutput, IN DWORD nFont)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleMode(HANDLE hConsoleHandle, DWORD dwMode)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleCtrlHandler(PHANDLER_ROUTINE HandlerRoutine, BOOL Add)
BOOL WINAPI DECLSPEC_HOTPATCH SetStdHandle(DWORD nStdHandle, HANDLE hHandle)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleActiveScreenBuffer(HANDLE hConsoleOutput)
BOOL WINAPI GetNumberOfConsoleInputEvents(HANDLE hConsoleInput, LPDWORD lpNumberOfEvents)
BOOL WINAPI GetConsoleCursorInfo(HANDLE hConsoleOutput, PCONSOLE_CURSOR_INFO lpConsoleCursorInfo)
HWND WINAPI DECLSPEC_HOTPATCH GetConsoleWindow(VOID)
HANDLE WINAPI OpenConsoleW(LPCWSTR wsName, DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwShareMode)
DWORD WINAPI GetConsoleProcessList(LPDWORD lpdwProcessList, DWORD dwProcessCount)
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleInputExeNameA(IN DWORD nBufferLength, OUT LPSTR lpExeName)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleInputExeNameA(IN LPCSTR lpExeName)
BOOL WINAPI DECLSPEC_HOTPATCH GenerateConsoleCtrlEvent(DWORD dwCtrlEvent, DWORD dwProcessGroupId)
BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleOutputAttribute(IN HANDLE hConsoleOutput, OUT LPWORD lpAttribute, IN DWORD nLength, IN COORD dwReadCoord, OUT LPDWORD lpNumberOfAttrsRead)
BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleOutputCharacterW(IN HANDLE hConsoleOutput, OUT LPWSTR lpCharacter, IN DWORD nLength, IN COORD dwReadCoord, OUT LPDWORD lpNumberOfCharsRead)
BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleInputA(IN HANDLE hConsoleInput, IN CONST INPUT_RECORD *lpBuffer, IN DWORD nLength, OUT LPDWORD lpNumberOfEventsWritten)
BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleA(IN HANDLE hConsoleOutput, IN CONST VOID *lpBuffer, IN DWORD nNumberOfCharsToWrite, OUT LPDWORD lpNumberOfCharsWritten, LPVOID lpReserved)
BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleInputW(IN HANDLE hConsoleInput, IN CONST INPUT_RECORD *lpBuffer, IN DWORD nLength, OUT LPDWORD lpNumberOfEventsWritten)
BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleW(IN HANDLE hConsoleInput, OUT LPVOID lpBuffer, IN DWORD nNumberOfCharsToRead, OUT LPDWORD lpNumberOfCharsRead, IN PCONSOLE_READCONSOLE_CONTROL pInputControl OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleOutputAttribute(IN HANDLE hConsoleOutput, IN CONST WORD *lpAttribute, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfAttrsWritten)
BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleA(IN HANDLE hConsoleInput, OUT LPVOID lpBuffer, IN DWORD nNumberOfCharsToRead, OUT LPDWORD lpNumberOfCharsRead, IN PCONSOLE_READCONSOLE_CONTROL pInputControl OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH FillConsoleOutputCharacterW(IN HANDLE hConsoleOutput, IN WCHAR cCharacter, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfCharsWritten)
BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleOutputCharacterA(IN HANDLE hConsoleOutput, OUT LPSTR lpCharacter, IN DWORD nLength, IN COORD dwReadCoord, OUT LPDWORD lpNumberOfCharsRead)
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
BOOL WINAPI IsValidCodePage(UINT codepage)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLuint GLint GLboolean GLint GLenum access
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static const WCHAR emptyW[]
int WINAPI lstrlenA(LPCSTR lpString)
#define TRUNCATE_EXISTING
#define ERROR_FILE_NOT_FOUND
static PEXPLICIT_ACCESSW *static HMODULE hmod
static void test_unicode(void)
static void test_WriteConsoleOutputAttribute(HANDLE output_handle)
static void test_VerifyConsoleIoHandle(HANDLE handle)
#define IN_SRECT2(r, d, c)
static void testEmptyWrite(HANDLE hCon)
static void test_WriteConsoleOutputCharacterW(HANDLE output_handle)
static void test_WriteConsoleOutputCharacterA(HANDLE output_handle)
static void test_GetConsoleFontSize(HANDLE std_output)
static void test_GetConsoleScreenBufferInfoEx(HANDLE std_output)
static void test_OpenCON(void)
static void test_ReadConsoleOutputCharacterA(HANDLE output_handle)
static void test_FillConsoleOutputCharacterW(HANDLE output_handle)
static void test_FillConsoleOutputCharacterA(HANDLE output_handle)
static void test_GetNumberOfConsoleInputEvents(HANDLE input_handle)
static void init_function_pointers(void)
static void test_ReadConsoleOutputAttribute(HANDLE output_handle)
static void test_GetSetConsoleInputExeName(void)
static BOOL WINAPI mch(DWORD event)
static void test_SetConsoleFont(HANDLE std_output)
static void test_WriteConsoleInputW(HANDLE input_handle)
static void test_ReadConsole(void)
static void test_OpenConsoleW(void)
#define KERNEL32_GET_PROC(func)
static void test_CreateFileW(void)
static void testScreenBuffer(HANDLE hConOut)
static void CALLBACK signaled_function(void *p, BOOLEAN timeout)
static void test_FillConsoleOutputAttribute(HANDLE output_handle)
static void testWriteNotWrappedNotProcessed(HANDLE hCon, COORD sbSize)
static void testCursorInfo(HANDLE hCon)
static void testWaitForConsoleInput(HANDLE input_handle)
#define okCURSOR(hCon, c)
static void testWriteNotWrappedProcessed(HANDLE hCon, COORD sbSize)
static void test_GetLargestConsoleWindowSize(HANDLE std_output)
static void testWriteWrappedNotProcessed(HANDLE hCon, COORD sbSize)
static void test_GetCurrentConsoleFont(HANDLE std_output)
static void testWriteWrappedProcessed(HANDLE hCon, COORD sbSize)
static void testWrite(HANDLE hCon, COORD sbSize)
static void test_GetConsoleFontInfo(HANDLE std_output)
static void resetContent(HANDLE hCon, COORD sbSize, BOOL content)
static void test_GetSetStdHandle(void)
#define okCHAR(hCon, c, ch, attr)
static void testCtrlHandler(void)
static void test_WriteConsoleInputA(HANDLE input_handle)
static void testScroll(HANDLE hCon, COORD sbSize)
static void test_GetConsoleProcessList(void)
static void test_ReadConsoleOutputCharacterW(HANDLE output_handle)
static void testWriteSimple(HANDLE hCon)
static void testCursor(HANDLE hCon, COORD sbSize)
static const WCHAR invalidW[]
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
static HANDLE complete_event
static int font_height(HFONT hFont)
DWORD WINAPI GetVersion()
_CRT_RESTORE_GCC_WARNINGS _CRT_DISABLE_GCC_WARNINGS _Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
TCHAR str_buf[MAX_LOADSTRING]
union _CHAR_INFO::@3337 Char
COORD dwMaximumWindowSize
void key_event(int scancode, int pressed)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
BOOL WINAPI RegisterWaitForSingleObject(OUT PHANDLE phNewWaitObject, IN HANDLE hObject, IN WAITORTIMERCALLBACK Callback, IN PVOID Context, IN ULONG dwMilliseconds, IN ULONG dwFlags)
BOOL WINAPI UnregisterWait(IN HANDLE WaitHandle)
DWORD WINAPI GetLastError(void)
DWORD WINAPI GetCurrentProcessId(void)
#define INVALID_FILE_SIZE
#define ENABLE_MOUSE_INPUT
struct _CONSOLE_SCREEN_BUFFER_INFOEX CONSOLE_SCREEN_BUFFER_INFOEX
#define CONSOLE_TEXTMODE_BUFFER
struct _CONSOLE_FONT_INFO CONSOLE_FONT_INFO
#define ENABLE_WINDOW_INPUT
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
#define ERROR_BUFFER_OVERFLOW
#define ERROR_PATH_NOT_FOUND
#define ERROR_INVALID_ACCESS
#define WT_EXECUTEONLYONCE
#define HKEY_CURRENT_USER
void WINAPI mouse_event(_In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ ULONG_PTR)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
int WINAPI GetSystemMetrics(_In_ int)