23#define WIN32_NO_STATUS
48#define TEST_ATTRIB (BACKGROUND_BLUE | FOREGROUND_GREEN)
49#define DEFAULT_ATTRIB (FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED)
53#define CONTENT(c) ('A' + (((c).Y * 17 + (c).X) % 23))
55#define okCURSOR(hCon, c) do { \
56 CONSOLE_SCREEN_BUFFER_INFO __sbi; \
57 BOOL expect = GetConsoleScreenBufferInfo((hCon), &__sbi) && \
58 __sbi.dwCursorPosition.X == (c).X && __sbi.dwCursorPosition.Y == (c).Y; \
59 ok(expect, "Expected cursor at (%d,%d), got (%d,%d)\n", \
60 (c).X, (c).Y, __sbi.dwCursorPosition.X, __sbi.dwCursorPosition.Y); \
63#define okCHAR(hCon, c, ch, attr) do { \
64 char __ch; WORD __attr; DWORD __len; BOOL expect; \
65 expect = ReadConsoleOutputCharacterA((hCon), &__ch, 1, (c), &__len) == 1 && __len == 1 && __ch == (ch); \
66 ok(expect, "At (%d,%d): expecting char '%c'/%02x got '%c'/%02x\n", (c).X, (c).Y, (ch), (ch), __ch, __ch); \
67 expect = ReadConsoleOutputAttribute((hCon), &__attr, 1, (c), &__len) == 1 && __len == 1 && __attr == (attr); \
68 ok(expect, "At (%d,%d): expecting attr %04x got %04x\n", (c).X, (c).Y, (attr), __attr); \
75#define KERNEL32_GET_PROC(func) \
76 p##func = (void *)GetProcAddress(hKernel32, #func); \
77 if(!p##func) trace("GetProcAddress(hKernel32, '%s') failed\n", #func);
88#undef KERNEL32_GET_PROC
106 if (test_status)
ok(!
status,
"NtCreateFile failed: %#lx\n",
status);
118 for (
c.X = 0;
c.X < sbSize.
X;
c.X++)
120 for (
c.Y = 0;
c.Y < sbSize.
Y;
c.Y++)
186 ok(!
ret,
"Expected failure\n");
193 ok(!
ret,
"Expected failure\n");
194 ok(
info.dwSize == -1,
"Expected no change for dwSize\n");
201 ok(
ret,
"Expected success\n");
204 "Expected 12 or 25, got %ld\n",
info.dwSize);
205 ok(
info.bVisible,
"Expected the cursor to be visible\n");
206 ok(
GetLastError() == 0xdeadbeef,
"GetLastError: expecting %u got %lu\n",
212 ok(!
ret,
"Expected failure\n");
213 ok(
info.dwSize == -1,
"Expected no change for dwSize\n");
223 static const char emptybuf[16];
277 const char*
mytest =
"abcdefg";
285 for (
c.X = 0;
c.X < mylen;
c.X++)
295 ok(
len == mylen,
"unexpected len = %lu\n",
len);
297 for (
c.X = 0;
c.X < 2 * mylen;
c.X++)
310 const char*
mytest =
"123";
317 "clearing wrap at EOL & processed output\n");
320 c.X = sbSize.
X - 3;
c.Y = 0;
324 ok(
ret != 0 &&
len == mylen,
"Couldn't write, ret = %d, len = %ld\n",
ret,
len);
326 for (
p = mylen - 3;
p < mylen;
p++)
328 c.X = sbSize.
X - 3 +
p % 3;
335 p = sbSize.
X - 3 + mylen % 3;
339 c.X = sbSize.
X - mylen;
c.Y = 0;
347 for (
p = 0;
p < 32;
p++) ctrl_buf[
p] = (
char)
p;
349 for (
p = 0;
p < 32;
p++)
360 const char*
mytest =
"abcd\nf\tg";
368 "clearing wrap at EOL & setting processed output\n");
371 c.X = sbSize.
X - 5;
c.Y = 0;
376 for (
c.X = sbSize.
X - 5;
c.X < sbSize.
X - 1;
c.X++)
385 win_skip(
"Win9x/WinMe don't respect ~ENABLE_WRAP_AT_EOL_OUTPUT\n");
393 for (
c.X = 1;
c.X < 8;
c.X++)
402 c.X = sbSize.
X - 4;
c.Y = 0;
407 for (
c.X = sbSize.
X - 4;
c.X < sbSize.
X;
c.X++)
413 for (
c.X = 1;
c.X < 8;
c.X++)
422 c.X = sbSize.
X - 3;
c.Y = 0;
427 for (
p = mylen2 - 3;
p < mylen2;
p++)
429 c.X = sbSize.
X - 3 +
p % 3;
434 for (
c.X = 1;
c.X < 8;
c.X++)
447 const char*
mytest =
"abcd\nf\tg";
452 "setting wrap at EOL & clearing processed output\n");
455 c.X = sbSize.
X - 9;
c.Y = 0;
460 for (
p = 0;
p < mylen;
p++)
462 c.X = sbSize.
X - 9 +
p;
465 c.X = sbSize.
X - 9 + mylen;
471 c.X = sbSize.
X - 3;
c.Y = 0;
483 const char*
mytest =
"abcd\nf\tg";
489 "setting wrap at EOL & processed output\n");
492 c.X = sbSize.
X - 9;
c.Y = 0;
496 for (
p = 0;
p < 4;
p++)
498 c.X = sbSize.
X - 9 +
p;
501 c.X = sbSize.
X - 9 +
p;
504 win_skip(
"Win9x/WinMe changes attribs for '\\n' up to 'f'\n");
509 for (
c.X = 1;
c.X < 8;
c.X++)
517 c.X = sbSize.
X - 3;
c.Y = 2;
521 for (
p = 0;
p < 3;
p++)
523 c.X = sbSize.
X - 3 +
p;
531 win_skip(
"Win9x/WinMe changes attribs for '\\n' up to 'f'\n");
537 for (
c.X = 1;
c.X < 8;
c.X++)
573#define IN_SRECT(r,c) ((r).Left <= (c).X && (c).X <= (r).Right && (r).Top <= (c).Y && (c).Y <= (r).Bottom)
574#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)
589 clip.
Right = sbSize.
X - 1;
595 for (
c.Y = 0;
c.Y < sbSize.
Y;
c.Y++)
597 for (
c.X = 0;
c.X < sbSize.
X;
c.X++)
624 clip.
Right = sbSize.
X - 1;
630 for (
c.Y = 0;
c.Y < sbSize.
Y;
c.Y++)
632 for (
c.X = 0;
c.X < sbSize.
X;
c.X++)
666 for (
c.Y = 0;
c.Y < sbSize.
Y;
c.Y++)
668 for (
c.X = 0;
c.X < sbSize.
X;
c.X++)
686 "Expected ERROR_NOT_ENOUGH_MEMORY, got %lu\n",
GetLastError());
727 "ScrollConsoleScreenBufferA failed: %lu\n",
GetLastError());
729 for (
c.Y = 0;
c.Y < sbSize.
Y;
c.Y++)
731 for (
c.X = 0;
c.X < sbSize.
X;
c.X++)
771 if (0)
ok(
mch_count == 1,
"Event isn't synchronous\n");
782 "Unexpect ConsoleFlags value %lx\n",
RtlGetCurrentPeb()->ProcessParameters->ConsoleFlags);
787 "Unexpect ConsoleFlags value %lx\n",
RtlGetCurrentPeb()->ProcessParameters->ConsoleFlags);
815 HANDLE hConOutRW, hConOutRO, hConOutWT;
816 HANDLE hFileOutRW, hFileOutRO, hFileOutWT;
818 char test_str1[] =
"Test for SB1";
819 char test_str2[] =
"Test for SB2";
820 char test_cp866[] = {0xe2, 0xa5, 0xe1, 0xe2, 0};
821 char test_cp1251[] = {0xf2, 0xe5, 0xf1, 0xf2, 0};
832 skip(
"Codepage 866 not available\n");
842 win_skip(
"SetConsoleOutputCP is not implemented\n");
845 ok(
ret,
"Cannot set output codepage to 866\n");
851 "Cannot create a new screen buffer for ReadWrite\n");
856 "Cannot create a new screen buffer for ReadOnly\n");
861 "Cannot create a new screen buffer for WriteOnly\n");
877 "Shouldn't succeed\n");
879 "GetLastError: expecting %u got %lu\n",
886 "GetLastError: expecting %u got %lu\n",
892 "GetLastError: expecting %u got %lu\n",
898 "GetLastError: expecting %u got %lu\n",
905 ok(!
ret,
"Shouldn't succeed\n");
907 "GetLastError: got %lu\n",
error);
912 ok(!
ret,
"Shouldn't succeed\n");
914 "GetLastError: got %lu\n",
error);
919 ok(!
ret,
"Shouldn't succeed\n");
921 "GetLastError: got %lu\n",
error);
965 ok(
ret &&
len ==
lstrlenA(test_str2),
"ReadConsoleOutputCharacterA failed\n");
980 ok(
ret,
"ReadConsoleOutputCharacterW failed\n");
983 "string does not match the pattern\n");
994 ok(
ret &&
len ==
lstrlenA(test_cp1251),
"ReadConsoleOutputCharacterW failed\n");
995 str_wbuf[
lstrlenA(test_cp1251)] = 0;
1003 ok(
ret &&
len ==
lstrlenA(test_cp1251),
"ReadConsoleOutputCharacterW failed\n");
1004 str_wbuf[
lstrlenA(test_cp1251)] = 0;
1022 ok(
ret &&
len ==
lstrlenA(test_str1),
"ReadConsoleOutputCharacterA failed\n");
1036#if defined(__REACTOS__) && DLL_EXPORT_VERSION < 0x600
1038 skip(
"Cannot build test_new_screen_buffer_properties() unless DLL_EXPORT_VERSION >= 0x600.\n");
1059 ok(cfi2.
nFont == cfi.
nFont,
"Font index should match: "
1060 "got %lu, expected %lu\n", cfi2.
nFont, cfi.
nFont);
1093#if defined(__REACTOS__) && DLL_EXPORT_VERSION < 0x600
1095 skip(
"Cannot build test_new_screen_buffer_color_attributes() unless DLL_EXPORT_VERSION >= 0x600.\n");
1117 ok(csbi2.
wAttributes == orig_attr,
"Character Attributes should have been copied: "
1118 "got %#x, expected %#x\n", csbi2.
wAttributes, orig_attr);
1119 ok(csbi2.
wPopupAttributes != orig_popup,
"Popup Attributes should not match original value\n");
1120 ok(csbi2.
wPopupAttributes == orig_attr,
"Popup Attributes should match Character Attributes\n");
1140 ok(csbi2.
wPopupAttributes != orig_popup,
"Popup Attributes should not match original value\n");
1162 ok(csbi2.
wAttributes == orig_attr,
"Character Attributes should have been copied: "
1163 "got %#x, expected %#x\n", csbi2.
wAttributes, orig_attr);
1164 ok(csbi2.
wPopupAttributes != orig_popup,
"Popup Attributes should not match original value\n");
1165 ok(csbi2.
wPopupAttributes == orig_attr,
"Popup Attributes should match Character Attributes\n");
1177 ok(!
timeout,
"wait shouldn't have timed out\n");
1185 DWORD events_written;
1193 ok(
ret ==
TRUE,
"Expected RegisterWaitForSingleObject to return TRUE, got %d\n",
ret);
1197 record.Event.KeyEvent.bKeyDown = 1;
1198 record.Event.KeyEvent.wRepeatCount = 1;
1201 record.Event.KeyEvent.uChar.UnicodeChar =
'\r';
1202 record.Event.KeyEvent.dwControlKeyState = 0;
1204 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
1206 ok(wait_ret ==
WAIT_OBJECT_0,
"Expected the handle to be signaled\n");
1211 "UnregisterWait failed with error %ld\n",
GetLastError());
1236 ok(0,
"Unexcepted mouse message: state=%lx ctrl=%lx flags=%lx (%u, %u)\n",
1253 HANDLE output, unbound_output, unbound_input;
1262 memset(&ir, 0,
sizeof(ir));
1310 "NtWaitForSingleObject returned %lx\n",
status);
1316 "NtWaitForSingleObject returned %lx\n",
status);
1322 ok(!
res,
"WaitForSingleObject returned %lx\n",
res);
1324 ok(!
res,
"WaitForSingleObject returned %lx\n",
res);
1326 ok(!
res,
"WaitForSingleObject returned %lx\n",
res);
1328 ok(!
res,
"WaitForSingleObject returned %lx\n",
res);
1330 ok(!
res,
"WaitForSingleObject returned %lx\n",
res);
1333 "NtWaitForSingleObject returned %lx\n",
status);
1336 "NtWaitForSingleObject returned %lx\n",
status);
1354 ret = pGetConsoleInputExeNameA(0,
NULL);
1356 ok(
ret,
"GetConsoleInputExeNameA failed\n");
1360 ret = pGetConsoleInputExeNameA(0,
buffer);
1362 ok(
ret,
"GetConsoleInputExeNameA failed\n");
1369 ok(
ret,
"GetConsoleInputExeNameA failed\n");
1373 ret = pSetConsoleInputExeNameA(
NULL);
1375 ok(!
ret,
"SetConsoleInputExeNameA failed\n");
1379 ret = pSetConsoleInputExeNameA(
"");
1381 ok(!
ret,
"SetConsoleInputExeNameA failed\n");
1385 ok(
ret,
"SetConsoleInputExeNameA failed\n");
1388 ok(
ret,
"GetConsoleInputExeNameA failed\n");
1396 if (!pGetConsoleProcessList)
1398 win_skip(
"GetConsoleProcessList is not available\n");
1403 ret = pGetConsoleProcessList(
NULL, 0);
1404 ok(
ret == 0,
"Expected failure\n");
1406 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
1410 ret = pGetConsoleProcessList(
NULL, 1);
1411 ok(
ret == 0,
"Expected failure\n");
1413 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
1423 ret = pGetConsoleProcessList(
list, 0);
1424 ok(
ret == 0,
"Expected failure\n");
1426 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
1430 ret = pGetConsoleProcessList(
list, 1);
1431 ok(
ret == 1,
"Expected 1, got %ld\n",
ret);
1439 ok(
ret == 1,
"Expected 1, got %ld\n",
ret);
1452 static const WCHAR conW[] = {
'C',
'O',
'N',0};
1462 "Expected to open the CON device on write (%lx)\n", accesses[
i]);
1472 "Expected to open the CON device on read (%lx)\n", accesses[
i]);
1483 static const WCHAR coninW[] = {
'C',
'O',
'N',
'I',
'N',
'$',0};
1484 static const WCHAR conoutW[] = {
'C',
'O',
'N',
'O',
'U',
'T',
'$',0};
1486 static const WCHAR invalidW[] = {
'I',
'N',
'V',
'A',
'L',
'I',
'D',0};
1496 } invalid_table[] = {
1535 {coninW, 0,
FALSE, 0 },
1536 {coninW, 0,
TRUE, 0 },
1545 {conoutW, 0,
FALSE, 0 },
1559 win_skip(
"OpenConsoleW is not available\n");
1570 "Expected OpenConsoleW to return INVALID_HANDLE_VALUE for index %d, got %p\n",
1572 ok(gle == invalid_table[
index].gle || (gle != 0 && gle == invalid_table[
index].gle2),
1573 "Expected GetLastError() to return %lu/%lu for index %d, got %lu\n",
1583 "Expected OpenConsoleW to succeed for index %d, got %p\n",
index,
ret);
1625 static const UINT nt_disposition[5] =
1646 sa.nLength =
sizeof(
sa);
1647 sa.lpSecurityDescriptor =
NULL;
1648 sa.bInheritHandle = cf_table[
index].inherit;
1656 "Expected CreateFileW not to return INVALID_HANDLE_VALUE for index %d\n",
index);
1658 "Expected GetLastError() to return %lu for index %d, got %lu\n",
1664 "Expected CreateFileW to succeed for index %d\n",
index);
1672 sa.nLength =
sizeof(
sa);
1673 sa.lpSecurityDescriptor =
NULL;
1674 sa.bInheritHandle = cf_table[
index].inherit;
1679 if (cf_table[
index].gle)
1687 if (cf_table[
index].gle)
continue;
1690 ?
L"\\Device\\ConDrv\\CurrentIn" :
L"\\Device\\ConDrv\\CurrentOut");
1713 if (!pVerifyConsoleIoHandle)
1715 win_skip(
"VerifyConsoleIoHandle is not available\n");
1721 ret = pVerifyConsoleIoHandle((
HANDLE)0xdeadbee0);
1723 ok(!
ret,
"expected VerifyConsoleIoHandle to fail\n");
1724 ok(
error == 0xdeadbeef,
"wrong GetLastError() %ld\n",
error);
1728 ret = pVerifyConsoleIoHandle((
HANDLE)0xdeadbee1);
1730 ok(!
ret,
"expected VerifyConsoleIoHandle to fail\n");
1731 ok(
error == 0xdeadbeef,
"wrong GetLastError() %ld\n",
error);
1735 ret = pVerifyConsoleIoHandle((
HANDLE)0xdeadbee2);
1737 ok(!
ret,
"expected VerifyConsoleIoHandle to fail\n");
1738 ok(
error == 0xdeadbeef,
"wrong GetLastError() %ld\n",
error);
1742 ret = pVerifyConsoleIoHandle((
HANDLE)0xdeadbee3);
1744 ok(!
ret,
"expected VerifyConsoleIoHandle to fail\n");
1745 ok(
error == 0xdeadbeef,
"wrong GetLastError() %ld\n",
error);
1753 "expected VerifyConsoleIoHandle to succeed\n");
1754 ok(
error == 0xdeadbeef,
"wrong GetLastError() %ld\n",
error);
1768 "wrong GetLastError() %ld\n",
error);
1775 ok(
error == 0xdeadbeef,
"wrong GetLastError() %ld\n",
error);
1781 ok(!
ret,
"expected SetStdHandle to fail\n");
1783 "wrong GetLastError() %ld\n",
error);
1789 ok(
ret,
"expected SetStdHandle to succeed\n");
1790 ok(
error == 0xdeadbeef,
"wrong GetLastError() %ld\n",
error);
1841 if (invalid_table[
i].nrofevents)
count = 0xdeadbeef;
1843 invalid_table[
i].nrofevents);
1844 ok(!
ret,
"[%d] Expected GetNumberOfConsoleInputEvents to return FALSE, got %d\n",
i,
ret);
1845 if (invalid_table[
i].nrofevents)
1848 "[%d] Expected output count to be unmodified, got %lu\n",
i,
count);
1851 "[%d] Expected last error to be %lu, got %lu\n",
1860 ok(!
ret,
"Expected GetNumberOfConsoleInputEvents to return FALSE, got %d\n",
ret);
1862 "Expected last error to be ERROR_INVALID_ACCESS, got %lu\n",
1868 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1869 ok(
count != 0xdeadbeef,
"Expected output count to initialized\n");
1917 ok(
ret ==
TRUE,
"Expected GetConsoleMode to return TRUE, got %d\n",
ret);
1925 ok(
ret ==
TRUE,
"Expected SetConsoleMode to return TRUE, got %d\n",
ret);
1934 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
1941 if (invalid_table[
i].win_crash)
1945 if (invalid_table[
i].written)
count = 0xdeadbeef;
1949 invalid_table[
i].written);
1950 ok(!
ret,
"[%d] Expected WriteConsoleInputA to return FALSE, got %d\n",
i,
ret);
1952 ok(gle == invalid_table[
i].gle || (gle != 0 && gle == invalid_table[
i].gle2),
1953 "[%d] Expected last error to be %lu or %lu, got %lu\n",
1954 i, invalid_table[
i].gle, invalid_table[
i].gle2, gle);
1959 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1960 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
1964 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1965 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
1969 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1970 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
1973 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
1980 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1981 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
1984 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1985 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
1988 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
1989 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
1992 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
1994 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
1997 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
2007 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
2009 "Expected count to be event list length, got %lu\n",
count);
2012 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2014 "Expected count to be event list length, got %lu\n",
count);
2017 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
2019 "Expected count to be event list length, got %lu\n",
count);
2022 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2024 "Expected count to be twice event list length, got %lu\n",
count);
2028 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
2029 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2032 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2035 "Expected count to be twice event list length, got %lu\n",
count);
2038 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
2052 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
2053 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2056 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2057 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2060 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
2061 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2064 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2065 ok(
count == 2,
"Expected count to be 2, got %lu\n",
count);
2068 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
2075 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
2076 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2079 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2080 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2086 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
2087 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2090 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2091 ok(
count == 2,
"Expected count to be 2, got %lu\n",
count);
2097 ok(
ret ==
TRUE,
"Expected WriteConsoleInputA to return TRUE, got %d\n",
ret);
2098 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2101 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2102 ok(
count == 3,
"Expected count to be 3, got %lu\n",
count);
2106 ok(
ret ==
TRUE,
"Expected SetConsoleMode to return TRUE, got %d\n",
ret);
2154 ok(
ret ==
TRUE,
"Expected GetConsoleMode to return TRUE, got %d\n",
ret);
2162 ok(
ret ==
TRUE,
"Expected SetConsoleMode to return TRUE, got %d\n",
ret);
2171 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
2178 if (invalid_table[
i].win_crash)
2182 if (invalid_table[
i].written)
count = 0xdeadbeef;
2186 invalid_table[
i].written);
2187 ok(!
ret,
"[%d] Expected WriteConsoleInputW to return FALSE, got %d\n",
i,
ret);
2189 ok(gle == invalid_table[
i].gle || (gle != 0 && gle == invalid_table[
i].gle2),
2190 "[%d] Expected last error to be %lu or %lu, got %lu\n",
2191 i, invalid_table[
i].gle, invalid_table[
i].gle2, gle);
2196 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
2197 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
2201 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
2202 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
2206 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
2207 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2210 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
2217 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
2218 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2221 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2222 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2225 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
2226 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2229 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2231 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2234 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
2244 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
2246 "Expected count to be event list length, got %lu\n",
count);
2249 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2251 "Expected count to be event list length, got %lu\n",
count);
2254 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
2256 "Expected count to be event list length, got %lu\n",
count);
2259 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2261 "Expected count to be twice event list length, got %lu\n",
count);
2265 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
2266 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2269 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2272 "Expected count to be twice event list length, got %lu\n",
count);
2275 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
2289 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
2290 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2293 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2294 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2297 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
2298 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2301 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2302 ok(
count == 2,
"Expected count to be 2, got %lu\n",
count);
2305 ok(
ret ==
TRUE,
"Expected FlushConsoleInputBuffer to return TRUE, got %d\n",
ret);
2312 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
2313 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2316 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2317 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2323 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
2324 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2327 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2328 ok(
count == 2,
"Expected count to be 2, got %lu\n",
count);
2334 ok(
ret ==
TRUE,
"Expected WriteConsoleInputW to return TRUE, got %d\n",
ret);
2335 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2338 ok(
ret ==
TRUE,
"Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n",
ret);
2339 ok(
count == 3,
"Expected count to be 3, got %lu\n",
count);
2343 ok(
ret ==
TRUE,
"Expected SetConsoleMode to return TRUE, got %d\n",
ret);
2357 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
2360 record.Event.KeyEvent.bKeyDown = 1;
2361 record.Event.KeyEvent.wRepeatCount = 1;
2364 record.Event.KeyEvent.uChar.UnicodeChar =
'\r';
2365 record.Event.KeyEvent.dwControlKeyState = 0;
2371 ok(
count == 1,
"Expected count to be 0, got %lu\n",
count);
2378 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
2385 ok(
count == 1,
"Expected count to be 0, got %lu\n",
count);
2392 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
2405 static const char output[] = {
'a', 0};
2449 if (invalid_table[
i].win7_crash)
2453 if (invalid_table[
i].lpNumCharsWritten)
count = 0xdeadbeef;
2455 invalid_table[
i].
str,
2458 invalid_table[
i].lpNumCharsWritten);
2459 ok(!
ret,
"[%d] Expected WriteConsoleOutputCharacterA to return FALSE, got %d\n",
i,
ret);
2461 "[%d] Expected last error to be %lu, got %lu\n",
2467 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
2468 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
2472 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
2473 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
2477 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
2478 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2483 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
2484 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
2486 for (
i = 1;
i < 32;
i++)
2493 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
2494 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2495 okCHAR(output_handle,
c, (
char)
i, 7);
2502 static const WCHAR outputW[] = {
'a',0};
2546 if (invalid_table[
i].win7_crash)
2550 if (invalid_table[
i].lpNumCharsWritten)
count = 0xdeadbeef;
2552 invalid_table[
i].
str,
2555 invalid_table[
i].lpNumCharsWritten);
2556 ok(!
ret,
"[%d] Expected WriteConsoleOutputCharacterW to return FALSE, got %d\n",
i,
ret);
2558 "[%d] Expected last error to be %lu, got %lu\n",
2564 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
2565 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
2569 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
2570 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
2574 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
2575 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2580 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
2581 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
2630 if (invalid_table[
i].win7_crash)
2634 if (invalid_table[
i].lpNumAttrsWritten)
count = 0xdeadbeef;
2636 invalid_table[
i].
attr,
2639 invalid_table[
i].lpNumAttrsWritten);
2640 ok(!
ret,
"[%d] Expected WriteConsoleOutputAttribute to return FALSE, got %d\n",
i,
ret);
2642 "[%d] Expected last error to be %lu, got %lu\n",
2648 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputAttribute to return TRUE, got %d\n",
ret);
2649 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
2653 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputAttribute to return TRUE, got %d\n",
ret);
2654 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
2658 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputAttribute to return TRUE, got %d\n",
ret);
2659 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2664 ok(
ret ==
TRUE,
"Expected WriteConsoleOutputAttribute to return TRUE, got %d\n",
ret);
2665 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
2676#define check_region(a,b,c,d,e) check_region_(__LINE__,a,b,c,d,e)
2686 "Right = %u, expected %d\n", region->
Right,
right);
2844 if (invalid_table[
i].win7_crash)
2848 if (invalid_table[
i].lpNumCharsWritten)
count = 0xdeadbeef;
2850 invalid_table[
i].
ch,
2853 invalid_table[
i].lpNumCharsWritten);
2854 ok(!
ret,
"[%d] Expected FillConsoleOutputCharacterA to return FALSE, got %d\n",
i,
ret);
2856 "[%d] Expected last error to be %lu, got %lu\n",
2862 ok(
ret ==
TRUE,
"Expected FillConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
2863 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
2867 ok(
ret ==
TRUE,
"Expected FillConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
2868 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2903 if (invalid_table[
i].win7_crash)
2907 if (invalid_table[
i].lpNumCharsWritten)
count = 0xdeadbeef;
2909 invalid_table[
i].
ch,
2912 invalid_table[
i].lpNumCharsWritten);
2913 ok(!
ret,
"[%d] Expected FillConsoleOutputCharacterW to return FALSE, got %d\n",
i,
ret);
2915 "[%d] Expected last error to be %lu, got %lu\n",
2921 ok(
ret ==
TRUE,
"Expected FillConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
2922 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
2926 ok(
ret ==
TRUE,
"Expected FillConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
2927 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2962 if (invalid_table[
i].win7_crash)
2966 if (invalid_table[
i].lpNumAttrsWritten)
count = 0xdeadbeef;
2968 invalid_table[
i].
attr,
2971 invalid_table[
i].lpNumAttrsWritten);
2972 ok(!
ret,
"[%d] Expected FillConsoleOutputAttribute to return FALSE, got %d\n",
i,
ret);
2974 "[%d] Expected last error to be %lu, got %lu\n",
2980 ok(
ret ==
TRUE,
"Expected FillConsoleOutputAttribute to return TRUE, got %d\n",
ret);
2981 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
2985 ok(
ret ==
TRUE,
"Expected FillConsoleOutputAttribute to return TRUE, got %d\n",
ret);
2986 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
2990 ok(
ret ==
TRUE,
"Expected FillConsoleOutputAttribute to return TRUE, got %d\n",
ret);
2991 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
3040 if (invalid_table[
i].win7_crash)
3044 if (invalid_table[
i].read_count)
count = 0xdeadbeef;
3049 invalid_table[
i].read_count);
3050 ok(!
ret,
"[%d] Expected ReadConsoleOutputCharacterA to return FALSE, got %d\n",
i,
ret);
3052 "[%d] Expected last error to be %lu, got %lu\n",
3058 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
3059 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
3063 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
3064 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
3068 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
3069 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
3074 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputCharacterA to return TRUE, got %d\n",
ret);
3075 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
3124 if (invalid_table[
i].win7_crash)
3128 if (invalid_table[
i].read_count)
count = 0xdeadbeef;
3133 invalid_table[
i].read_count);
3134 ok(!
ret,
"[%d] Expected ReadConsoleOutputCharacterW to return FALSE, got %d\n",
i,
ret);
3136 "[%d] Expected last error to be %lu, got %lu\n",
3142 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
3143 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
3147 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
3148 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
3152 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
3153 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
3158 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputCharacterW to return TRUE, got %d\n",
ret);
3159 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
3207 if (invalid_table[
i].win7_crash)
3211 if (invalid_table[
i].read_count)
count = 0xdeadbeef;
3213 invalid_table[
i].lpAttribute,
3216 invalid_table[
i].read_count);
3217 ok(!
ret,
"[%d] Expected ReadConsoleOutputAttribute to return FALSE, got %d\n",
i,
ret);
3219 "[%d] Expected last error to be %lu, got %lu\n",
3225 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputAttribute to return TRUE, got %d\n",
ret);
3226 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
3230 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputAttribute to return TRUE, got %d\n",
ret);
3231 ok(
count == 0,
"Expected count to be 0, got %lu\n",
count);
3235 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputAttribute to return TRUE, got %d\n",
ret);
3236 ok(
count == 1,
"Expected count to be 1, got %lu\n",
count);
3241 ok(
ret ==
TRUE,
"Expected ReadConsoleOutputAttribute to return TRUE, got %d\n",
ret);
3242 ok(
count == 0,
"Expected count to be 1, got %lu\n",
count);
3370 memset(char_info_buf, 0xc0,
sizeof(char_info_buf));
3380 ok(
ch ==
'x',
"unexpected char %c/%x\n",
ch,
ch);
3382 ok(
ch ==
'y',
"unexpected char %c/%x\n",
ch,
ch);
3384 ok(
ch ==
'z',
"unexpected char %c/%x\n",
ch,
ch);
3396 "expected INVALID_FILE_SIZE, got %#lx\n",
ret);
3400 "expected ERROR_INVALID_HANDLE, got %ld\n",
GetLastError());
3405 ok(!
ret,
"expected 0, got %lu\n",
ret);
3408 "expected ERROR_NOT_ENOUGH_MEMORY, got %ld\n",
GetLastError());
3414 ok(!
ret,
"expected 0, got %lu\n",
ret);
3417 "expected ERROR_NOT_ENOUGH_MEMORY, got %ld\n",
GetLastError());
3418 ok(
bytes == 0xdeadbeef,
"expected 0xdeadbeef, got %#lx\n",
bytes);
3423 ok(!
ret,
"expected 0, got %lu\n",
ret);
3426 "expected ERROR_NOT_ENOUGH_MEMORY, got %ld\n",
GetLastError());
3427 ok(
bytes == 0xdeadbeef,
"expected 0xdeadbeef, got %#lx\n",
bytes);
3459 ok(!
ret,
"got %d, expected 0\n",
ret);
3467 ok(!
ret,
"got %d, expected 0\n",
ret);
3475 ok(!
ret,
"got %d, expected 0\n",
ret);
3483 ok(!
ret,
"got %d, expected 0\n",
ret);
3492 ok(!
ret,
"got %d, expected 0\n",
ret);
3502 ok(
ret,
"got %d, expected non-zero\n",
ret);
3516 ok(
ret,
"got %d, expected non-zero\n",
ret);
3526#if defined(__REACTOS__) && DLL_EXPORT_VERSION < 0x600
3528 skip(
"Cannot build test_GetCurrentConsoleFontEx() unless DLL_EXPORT_VERSION >= 0x600.\n");
3541 if (!pGetCurrentConsoleFontEx)
3543 win_skip(
"GetCurrentConsoleFontEx is not available\n");
3549 ok(!
ret,
"got %d, expected 0\n",
ret);
3553 ret = pGetCurrentConsoleFontEx(
NULL,
TRUE, &cfix);
3554 ok(!
ret,
"got %d, expected 0\n",
ret);
3558 ret = pGetCurrentConsoleFontEx(std_input,
FALSE, &cfix);
3559 ok(!
ret,
"got %d, expected 0\n",
ret);
3563 ret = pGetCurrentConsoleFontEx(std_input,
TRUE, &cfix);
3564 ok(!
ret,
"got %d, expected 0\n",
ret);
3568 ret = pGetCurrentConsoleFontEx(std_output,
FALSE, &cfix);
3569 ok(!
ret,
"got %d, expected 0\n",
ret);
3573 ret = pGetCurrentConsoleFontEx(std_output,
TRUE, &cfix);
3574 ok(!
ret,
"got %d, expected 0\n",
ret);
3581 ok(!
ret,
"got %d, expected 0\n",
ret);
3585 ret = pGetCurrentConsoleFontEx(
NULL,
TRUE, &cfix);
3586 ok(!
ret,
"got %d, expected 0\n",
ret);
3590 ret = pGetCurrentConsoleFontEx(std_input,
FALSE, &cfix);
3591 ok(!
ret,
"got %d, expected 0\n",
ret);
3595 ret = pGetCurrentConsoleFontEx(std_input,
TRUE, &cfix);
3596 ok(!
ret,
"got %d, expected 0\n",
ret);
3602 ret = pGetCurrentConsoleFontEx(pipe1,
TRUE, &cfix);
3603 ok(!
ret,
"got %d, expected 0\n",
ret);
3609 ret = pGetCurrentConsoleFontEx(std_output,
FALSE, &cfix);
3610 ok(
ret,
"got %d, expected non-zero\n",
ret);
3616 ok(
ret,
"got %d, expected non-zero\n",
ret);
3627 ok(cfix.
dwFontSize.
X ==
c.X,
"Font width doesn't match; got %u, expected %u\n",
3629 ok(cfix.
dwFontSize.
Y ==
c.Y,
"Font height doesn't match; got %u, expected %u\n",
3632 ok(cfi.
dwFontSize.
X ==
c.X,
"Font width doesn't match; got %u, expected %u\n",
3634 ok(cfi.
dwFontSize.
Y ==
c.Y,
"Font height doesn't match; got %u, expected %u\n",
3638 ret = pGetCurrentConsoleFontEx(std_output,
TRUE, &cfix);
3639 ok(
ret,
"got %d, expected non-zero\n",
ret);
3645 ok(
ret,
"got %d, expected non-zero\n",
ret);
3657 skip(
"Cannot build test_SetCurrentConsoleFontEx() until kernelbase is synced.\n");
3667 ok(
ret,
"got %d, expected non-zero\n",
ret);
3674 ok(!
ret,
"got %d, expected 0\n",
ret);
3679 ok(!
ret,
"got %d, expected 0\n",
ret);
3685 ok(!
ret,
"got %d, expected 0\n",
ret);
3693 ok(!
ret,
"got %d, expected 0\n",
ret);
3700 ok(!
ret,
"got %d, expected 0\n",
ret);
3705 ok(!
ret,
"got %d, expected 0\n",
ret);
3710 ok(!
ret,
"got %d, expected 0\n",
ret);
3715 ok(!
ret,
"got %d, expected 0\n",
ret);
3722 ok(!
ret,
"got %d, expected 0\n",
ret);
3727 ok(!
ret,
"got %d, expected 0\n",
ret);
3733 ok(!
ret,
"got %d, expected 0\n",
ret);
3741 ok(!
ret,
"got %d, expected 0\n",
ret);
3748 ok(!
ret,
"got %d, expected 0\n",
ret);
3753 ok(!
ret,
"got %d, expected 0\n",
ret);
3758 ok(
ret,
"got %d, expected non-zero\n",
ret);
3763 ok(
ret,
"got %d, expected non-zero\n",
ret);
3769 ok(
ret,
"got %d, expected non-zero\n",
ret);
3790 ok(!
c.X,
"got %d, expected 0\n",
c.X);
3791 ok(!
c.Y,
"got %d, expected 0\n",
c.Y);
3797 ok(!
c.X,
"got %d, expected 0\n",
c.X);
3798 ok(!
c.Y,
"got %d, expected 0\n",
c.Y);
3805 ok(!
c.X,
"got %d, expected 0\n",
c.X);
3806 ok(!
c.Y,
"got %d, expected 0\n",
c.Y);
3819 ok(
c.X == font_width,
"got %d, expected %ld\n",
c.X, font_width);
3824 if (!pGetNumberOfConsoleFonts)
3826 win_skip(
"GetNumberOfConsoleFonts is not available\n");
3829 index = pGetNumberOfConsoleFonts();
3838 ok(!
c.X,
"got %d, expected 0\n",
c.X);
3839 ok(!
c.Y,
"got %d, expected 0\n",
c.Y);
3847 LONG workarea_w, workarea_h, maxcon_w, maxcon_h;
3861 ok(!
c.X,
"got %d, expected 0\n",
c.X);
3862 ok(!
c.Y,
"got %d, expected 0\n",
c.Y);
3868 ok(!
c.X,
"got %d, expected 0\n",
c.X);
3869 ok(!
c.Y,
"got %d, expected 0\n",
c.Y);
3876 ok(!
c.X,
"got %d, expected 0\n",
c.X);
3877 ok(!
c.Y,
"got %d, expected 0\n",
c.Y);
3882 workarea_w =
r.right -
r.left;
3890 if (!pGetNumberOfConsoleFonts)
3892 win_skip(
"GetNumberOfConsoleFonts is not available\n");
3896 if (!pSetConsoleFont)
3898 win_skip(
"SetConsoleFont is not available\n");
3902 for (
i = 0;
i < pGetNumberOfConsoleFonts();
i++)
3904 pSetConsoleFont(std_output,
i);
3911 maxcon_w = workarea_w /
font.X;
3912 maxcon_h = workarea_h /
font.Y;
3913 ok(
c.X == maxcon_w ||
c.X == maxcon_w - 1 ,
"got %d, expected %ld\n",
c.X, maxcon_w);
3914 ok(
c.Y == maxcon_h ||
c.Y == maxcon_h - 1 ,
"got %d, expected %ld\n",
c.Y, maxcon_h);
3923 pSetConsoleFont(std_output,
index);
3932 int memsize, win_width, win_height, tmp_w, tmp_h;
3936 COORD orig_sb_size, tmp_sb_size, orig_font, tmp_font;
3940 if (!pGetConsoleFontInfo)
3942 win_skip(
"GetConsoleFontInfo is not available\n");
3947 if (!pGetNumberOfConsoleFonts)
3949 win_skip(
"GetNumberOfConsoleFonts is not available\n");
3953 num_fonts = pGetNumberOfConsoleFonts();
3959 orig_sb_size = csbi.
dwSize;
3966 ok(!
ret,
"got %d, expected zero\n",
ret);
3970 skip(
"GetConsoleFontInfo is not implemented\n");
3979 ok(!
ret,
"got %d, expected zero\n",
ret);
3983 ret = pGetConsoleFontInfo(std_output,
FALSE, 0, cfi);
3984 ok(!
ret,
"got %d, expected zero\n",
ret);
3996 ret = pGetConsoleFontInfo(std_output,
FALSE, num_fonts, cfi);
3997 ok(
ret,
"got %d, expected non-zero\n",
ret);
3998 ok(cfi[
index].dwFontSize.X == win_width,
"got %d, expected %d\n",
4000 ok(cfi[
index].dwFontSize.Y == win_height,
"got %d, expected %d\n",
4003 for (
i = 0;
i < num_fonts;
i++)
4005 ok(cfi[
i].nFont ==
i,
"element out of order, got nFont %ld, expected %ld\n", cfi[
i].nFont,
i);
4007 tmp_w = (
double)orig_font.
X / tmp_font.
X * win_width;
4008 tmp_h = (
double)orig_font.
Y / tmp_font.
Y * win_height;
4009 ok(cfi[
i].dwFontSize.X == tmp_w,
"got %d, expected %d\n", cfi[
i].
dwFontSize.
X, tmp_w);
4010 ok(cfi[
i].dwFontSize.Y == tmp_h,
"got %d, expected %d\n", cfi[
i].
dwFontSize.
Y, tmp_h);
4015 ok(!
ret,
"got %d, expected zero\n",
ret);
4020 ok(!
ret,
"got %d, expected zero\n",
ret);
4024 ret = pGetConsoleFontInfo(std_output,
TRUE, 0, cfi);
4025 ok(!
ret,
"got %d, expected zero\n",
ret);
4029 ret = pGetConsoleFontInfo(std_output,
TRUE, num_fonts, cfi);
4030 ok(
ret,
"got %d, expected non-zero\n",
ret);
4036 for (
i = 0;
i < num_fonts;
i++)
4038 ok(cfi[
i].nFont ==
i,
"element out of order, got nFont %ld, expected %ld\n", cfi[
i].nFont,
i);
4042 ok(cfi[
i].dwFontSize.X == tmp_w,
"got %d, expected %d\n", cfi[
i].
dwFontSize.
X, tmp_w);
4043 ok(cfi[
i].dwFontSize.Y == tmp_h,
"got %d, expected %d\n", cfi[
i].
dwFontSize.
Y, tmp_h);
4060 if (!pSetConsoleFont)
4062 win_skip(
"SetConsoleFont is not available\n");
4067 ret = pSetConsoleFont(
NULL, 0);
4068 ok(!
ret,
"got %d, expected zero\n",
ret);
4072 skip(
"SetConsoleFont is not implemented\n");
4079 ok(!
ret,
"got %d, expected zero\n",
ret);
4083 if (!pGetNumberOfConsoleFonts)
4085 win_skip(
"GetNumberOfConsoleFonts is not available\n");
4089 num_fonts = pGetNumberOfConsoleFonts();
4092 ret = pSetConsoleFont(std_output, num_fonts);
4093 ok(!
ret,
"got %d, expected zero\n",
ret);
4107 pGetConsoleScreenBufferInfoEx = (
void *)
GetProcAddress(
hmod,
"GetConsoleScreenBufferInfoEx");
4108 if (!pGetConsoleScreenBufferInfoEx)
4110 win_skip(
"GetConsoleScreenBufferInfoEx is not available\n");
4115 ret = pGetConsoleScreenBufferInfoEx(
NULL, &csbix);
4116 ok(!
ret,
"got %d, expected zero\n",
ret);
4120 ret = pGetConsoleScreenBufferInfoEx(std_input, &csbix);
4121 ok(!
ret,
"got %d, expected zero\n",
ret);
4125 ret = pGetConsoleScreenBufferInfoEx(std_output, &csbix);
4126 ok(!
ret,
"got %d, expected zero\n",
ret);
4132 ret = pGetConsoleScreenBufferInfoEx(
NULL, &csbix);
4133 ok(!
ret,
"got %d, expected zero\n",
ret);
4137 ret = pGetConsoleScreenBufferInfoEx(std_input, &csbix);
4138 ok(!
ret,
"got %d, expected zero\n",
ret);
4143 ret = pGetConsoleScreenBufferInfoEx(std_input, &csbix);
4144 ok(!
ret,
"got %d, expected zero\n",
ret);
4150 ret = pGetConsoleScreenBufferInfoEx(std_output, &csbix);
4151 ok(
ret,
"got %d, expected non-zero\n",
ret);
4209 ok(!
cp,
"cp = %x\n",
cp);
4214 ok(!
cp,
"cp = %x\n",
cp);
4230 ok(!
size,
"GetConsoleTitleW returned %lu\n",
size);
4231 ok(
title[0] == 0xc0c0,
"title byffer changed\n");
4287#if defined(__REACTOS__) && DLL_EXPORT_VERSION < 0x600
4289 skip(
"Cannot build test_SetConsoleScreenBufferInfoEx() unless DLL_EXPORT_VERSION >= 0x600.\n");
4299 pSetConsoleScreenBufferInfoEx = (
void *)
GetProcAddress(
hmod,
"SetConsoleScreenBufferInfoEx");
4300 pGetConsoleScreenBufferInfoEx = (
void *)
GetProcAddress(
hmod,
"GetConsoleScreenBufferInfoEx");
4301 if (!pSetConsoleScreenBufferInfoEx || !pGetConsoleScreenBufferInfoEx)
4303 win_skip(
"SetConsoleScreenBufferInfoEx is not available\n");
4309 pGetConsoleScreenBufferInfoEx(std_output, &
info);
4313 ok(!
ret,
"got %d, expected zero\n",
ret);
4317 ret = pSetConsoleScreenBufferInfoEx(std_output, &
info);
4318 ok(
ret,
"got %d, expected one\n",
ret);
4322 ret = pSetConsoleScreenBufferInfoEx(std_input, &
info);
4323 ok(!
ret,
"got %d, expected zero\n",
ret);
4329 ret = pSetConsoleScreenBufferInfoEx(std_output, &
info);
4330 ok(!
ret,
"got %d, expected zero\n",
ret);
4339#if defined(__REACTOS__) && DLL_EXPORT_VERSION < 0x600
4340 skip(
"Cannot build test_GetConsoleOriginalTitleA() unless DLL_EXPORT_VERSION >= 0x600.\n");
4342 char title[] =
"Original Console Title";
4355 ok(
ret == title_len,
"got %lu, expected %lu\n",
ret, title_len);
4363 ok(
ret == title_len,
"got %lu, expected %lu\n",
ret, title_len);
4369#if defined(__REACTOS__) && DLL_EXPORT_VERSION < 0x600
4370 skip(
"Cannot build test_GetConsoleOriginalTitleW() unless DLL_EXPORT_VERSION >= 0x600.\n");
4386 ok(
ret == title_len,
"got %lu, expected %lu\n",
ret, title_len);
4394 ok(
ret == title_len,
"got %lu, expected %lu\n",
ret, title_len);
4399 ok(
ret == title_len,
"got %lu, expected %lu\n",
ret, title_len);
4405#if defined(__REACTOS__) && DLL_EXPORT_VERSION < 0x600
4406 skip(
"Cannot build test_GetConsoleOriginalTitleW_empty() unless DLL_EXPORT_VERSION >= 0x600.\n");
4421 char title[] =
"Original Console Title";
4426 skip(
"This test is incredibly broken on WS03\n");
4450 char buf[64],
str[] =
"test";
4543 ok(!
status,
"NtQueryVolumeInformationFile failed: %#lx\n",
status);
4549 ok(!
status,
"NtQueryVolumeInformationFile failed: %#lx\n",
status);
4581 "NtCreateFile returned %#lx\n",
status );
4602 "NtCreateFile returned %#lx\n",
status );
4606 win_skip(
"cannot open \\Device\\ConDrv\\Server, skipping RootDirectory test" );
4623 HANDLE pipe_in, pipe_out;
4661 ok(!
memcmp(
buf,
"Parent", 6),
"Unexpected console output\n");
4675 if (pGetConsoleProcessList)
4681 len = pGetConsoleProcessList(
list, 1);
4682 ok(
len == 2,
"Expected 2 processes, got %ld\n",
len);
4683 ok(
list[0] == 0xbabebabe,
"Unexpected value in list %lu\n",
list[0]);
4685 len = pGetConsoleProcessList(
list, 2);
4686 ok(
len == 2,
"Expected 2 processes, got %ld\n",
len);
4687 ok(
list[0] == console_pid ||
list[1] == console_pid,
"Parent PID not in list\n");
4701 ok(!
memcmp(
buf,
"Parent", 6),
"Unexpected console output\n");
4710 ok(
res,
"pipe_in is no longer valid\n");
4712 ok(
res,
"pipe_out is no longer valid\n");
4738 ok(!
memcmp(
buf,
"Child", 5),
"Unexpected console output\n");
4744 HANDLE prev_output, prev_error;
4817 HANDLE pipe_read, pipe_write;
4830 res =
CreatePipe(&pipe_read, &pipe_write, &inheritable_attr, 0);
4834 si.hStdError = pipe_write;
4857 "mode = %lx\n",
mode);
4872 mode &= ~ENABLE_VIRTUAL_TERMINAL_PROCESSING;
4901 ok(cursor_info.
dwSize == 25,
"dwSize = %lu\n", cursor_info.
dwSize);
4934 if (!pCreatePseudoConsole)
4936 win_skip(
"CreatePseudoConsole not available\n");
4967#if !defined(__REACTOS__) || DLL_EXPORT_VERSION >= 0x600
5007 ok(nthdr !=
NULL,
"Cannot get NT headers out of %s\n",
out);
5029 sprintf(
buf,
"\"%s\" console check_console", exec);
5053 inherit_handles =
TRUE;
5081#define CP_WITH_CONSOLE 0x01
5082#define CP_WITH_HANDLE 0x02
5083#define CP_WITH_WINDOW 0x04
5084#define CP_ALONE 0x08
5085#define CP_GROUP_LEADER 0x10
5086#define CP_INPUT_VALID 0x20
5087#define CP_OUTPUT_VALID 0x40
5088#define CP_ENABLED_CTRLC 0x80
5090#define CP_OWN_CONSOLE (CP_WITH_CONSOLE | CP_WITH_HANDLE | CP_INPUT_VALID | CP_OUTPUT_VALID | CP_ALONE)
5091#define CP_INH_CONSOLE (CP_WITH_CONSOLE | CP_WITH_HANDLE | CP_INPUT_VALID | CP_OUTPUT_VALID)
5101 BOOL saved_console_flags;
5111 no_console_tests[] =
5127 with_console_tests[] =
5177 static struct group_flags_tests
5187 group_flags_tests[] =
5223 strcat(guiexec,
"console_gui.exe");
5226 strcat(cuiexec,
"console_cui.exe");
5238 no_console_tests[
i].cp_flags,
5240 ok(
res == no_console_tests[
i].
expected,
"[%d] Unexpected result %x (%lx)\n",
5249 with_console_tests[
i].cp_flags,
5252 broken(with_console_tests[
i].is_broken &&
res == (with_console_tests[
i].is_broken & 0xff)),
5253 "[%d] Unexpected result %x (%lx)\n",
5262 ok(
res,
"Couldn't set ctrl handler\n");
5264 group_flags_tests[
i].cp_flags,
5269 "[%d] Unexpected result %x (%lx)\n",
5283#define NO_EVENT 0xfe
5304 enum pgid {PGID_PARENT, PGID_ZERO, PGID_CHILD} pgid_kind;
5306 unsigned child_event;
5332 DWORD saved_console_flags;
5340 strcat(guiexec,
"console_gui.exe");
5343 strcat(cuiexec,
"console_cui.exe");
5347 ok(event_child !=
NULL,
"Couldn't create event\n");
5354 ok(
ret,
"Couldn't set ctrl-c handler flag\n");
5370 switch (
tests[
i].pgid_kind)
5377 "PGID should only be used with new process groupw\n");
5378 pgid =
info.dwProcessId;
5384 ok(0,
"Unexpected pgid kind %u\n",
tests[
i].pgid_kind);
5390 "GenerateConsoleCtrlEvent failed: %lu\n",
GetLastError());
5398 ok(
ret,
"Couldn't get exit code\n");
5400 ok(
tests[
i].child_event ==
exit_code,
"Unexpected exit code %#lx, instead of %#x\n",
5436 ok(
ret,
"Couldn't get exit code\n");
5456 ok(
ret,
"Couldn't remove ctrl-c handler flag\n");
5464 HANDLE hConIn, hConOut, revert_output =
NULL, unbound_output;
5467 BOOL using_pseudo_console;
5499 ok(
ret,
"SetEvent failed\n");
5512 ok(
ret,
"SetEvent failed\n");
5519 ok(0,
"Shouldn't happen\n");
5558 using_pseudo_console =
argc >= 3 && !
strcmp(
argv[2],
"--pseudo-console");
5560 if (!test_current && !using_pseudo_console)
5562 static const char font_name[] =
"Lucida Console";
5579 size =
sizeof(old_font);
5586 (
const BYTE *) font_name,
sizeof(font_name));
5588 trace(
"Unable to change default console font, error %ld\n",
err);
5592 trace(
"Unable to query default console font, error %ld\n",
err);
5599 trace(
"Unable to open HKCU\\Console, error %ld\n",
err);
5608 if (console_key !=
NULL)
5614 (
const BYTE *) old_font,
strlen(old_font) + 1);
5620 if (!unbound_output)
5622 win_skip(
"Skipping NT path tests, not supported on this Windows version\n");
5643 if (using_pseudo_console)
5650 ok(
ret,
"Getting sb info\n");
5659 ok(
ret,
"Setting sb info\n");
5661 ok(
ret,
"Getting sb info\n");
5700 if (!pGetConsoleInputExeNameA || !pSetConsoleInputExeNameA)
5701 win_skip(
"GetConsoleInputExeNameA and/or SetConsoleInputExeNameA is not available\n");
static void startup(void)
static unsigned char bytes[4]
static struct sockaddr_in sa
#define FILE_NON_DIRECTORY_FILE
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 SetConsoleTextAttribute(IN HANDLE hConsoleOutput, IN WORD wAttributes)
BOOL WINAPI AttachConsole(IN DWORD dwProcessId)
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 FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL
#define STATUS_INVALID_HANDLE
#define STATUS_OBJECT_TYPE_MISMATCH
#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 CreateFileMappingW(a, b, c, d, e, f)
#define CreateFileA(a, b, c, d, e, f, g)
#define GetCurrentProcess()
#define HeapFree(x, y, z)
#define ERROR_INVALID_HANDLE
#define FILE_ATTRIBUTE_NORMAL
#define ERROR_ACCESS_DENIED
BOOL WINAPI DECLSPEC_HOTPATCH CloseConsoleHandle(HANDLE hHandle)
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleTitleA(LPSTR lpConsoleTitle, DWORD nSize)
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)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleTitleA(LPCSTR lpConsoleTitle)
COORD WINAPI DECLSPEC_HOTPATCH GetConsoleFontSize(IN HANDLE hConsoleOutput, IN DWORD nFont)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleCP(UINT wCodePageID)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleTitleW(LPCWSTR lpConsoleTitle)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleMode(HANDLE hConsoleHandle, DWORD dwMode)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleCtrlHandler(PHANDLER_ROUTINE HandlerRoutine, BOOL Add)
HANDLE WINAPI DECLSPEC_HOTPATCH DuplicateConsoleHandle(HANDLE hSourceHandle, DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwOptions)
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)
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleTitleW(LPWSTR lpConsoleTitle, DWORD nSize)
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 CopyFileA(IN LPCSTR lpExistingFileName, IN LPCSTR lpNewFileName, IN BOOL bFailIfExists)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
DWORD WINAPI GetFileType(HANDLE hFile)
BOOL WINAPI FlushFileBuffers(IN HANDLE hFile)
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
VOID WINAPI ExitProcess(IN UINT uExitCode)
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
VOID WINAPI GetStartupInfoW(IN LPSTARTUPINFOW lpStartupInfo)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
BOOL WINAPI IsValidCodePage(UINT codepage)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
UINT WINAPI GetOEMCP(void)
BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleInputA(HANDLE handle, const INPUT_RECORD *buffer, DWORD count, DWORD *written)
BOOL WINAPI DECLSPEC_HOTPATCH FreeConsole(void)
void WINAPI ClosePseudoConsole(HPCON handle)
UINT WINAPI DECLSPEC_HOTPATCH GetConsoleCP(void)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleScreenBufferInfoEx(HANDLE handle, CONSOLE_SCREEN_BUFFER_INFOEX *info)
BOOL WINAPI GetCurrentConsoleFontEx(HANDLE handle, BOOL maxwindow, CONSOLE_FONT_INFOEX *info)
BOOL WINAPI ReadConsoleA(HANDLE handle, void *buffer, DWORD length, DWORD *count, void *reserved)
static WCHAR input_exe[MAX_PATH+1]
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleOriginalTitleA(LPSTR title, DWORD size)
HRESULT WINAPI CreatePseudoConsole(COORD size, HANDLE input, HANDLE output, DWORD flags, HPCON *ret)
BOOL WINAPI ReadConsoleInputW(HANDLE handle, INPUT_RECORD *buffer, DWORD length, DWORD *count)
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleOriginalTitleW(LPWSTR title, DWORD size)
BOOL WINAPI DECLSPEC_HOTPATCH GetConsoleScreenBufferInfoEx(HANDLE handle, CONSOLE_SCREEN_BUFFER_INFOEX *info)
UINT WINAPI DECLSPEC_HOTPATCH GetConsoleOutputCP(void)
BOOL WINAPI SetCurrentConsoleFontEx(HANDLE handle, BOOL maxwindow, CONSOLE_FONT_INFOEX *info)
BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleInputW(HANDLE handle, const INPUT_RECORD *buffer, DWORD count, DWORD *written)
BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleOutputW(HANDLE handle, CHAR_INFO *buffer, COORD size, COORD coord, SMALL_RECT *region)
BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleOutputCharacterW(HANDLE handle, LPWSTR buffer, DWORD length, COORD coord, DWORD *count)
BOOL WINAPI AllocConsole(void)
BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleOutputCharacterA(HANDLE handle, LPSTR buffer, DWORD length, COORD coord, DWORD *count)
BOOL WINAPI DECLSPEC_HOTPATCH FillConsoleOutputCharacterW(HANDLE handle, WCHAR ch, DWORD length, COORD coord, DWORD *written)
HWND WINAPI GetConsoleWindow(void)
BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleA(HANDLE handle, const void *buffer, DWORD length, DWORD *written, void *reserved)
BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleOutputAttribute(HANDLE handle, WORD *attr, DWORD length, COORD coord, DWORD *count)
BOOL WINAPI ReadConsoleW(HANDLE handle, void *buffer, DWORD length, DWORD *count, void *reserved)
BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleOutputW(HANDLE handle, const CHAR_INFO *buffer, COORD size, COORD coord, SMALL_RECT *region)
BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleOutputAttribute(HANDLE handle, const WORD *attr, DWORD length, COORD coord, DWORD *written)
BOOL WINAPI DECLSPEC_HOTPATCH UpdateProcThreadAttribute(struct _PROC_THREAD_ATTRIBUTE_LIST *list, DWORD flags, DWORD_PTR attr, void *value, SIZE_T size, void *prev_ret, SIZE_T *size_ret)
BOOL WINAPI DECLSPEC_HOTPATCH InitializeProcThreadAttributeList(struct _PROC_THREAD_ATTRIBUTE_LIST *list, DWORD count, DWORD flags, SIZE_T *size)
DWORD WINAPI GetVersion(void)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl sscanf(const char *, const char *,...) __WINE_CRT_SCANF_ATTR(2
_ACRTIMP char *__cdecl strchr(const char *, int)
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
_ACRTIMP char *__cdecl strrchr(const char *, int)
#define FILE_OVERWRITE_IF
#define FILE_SYNCHRONOUS_IO_NONALERT
@ FileFsDeviceInformation
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLdouble GLdouble GLdouble GLdouble top
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLuint GLint GLboolean GLint GLenum access
GLenum GLenum GLenum GLenum mapping
GLenum GLenum GLenum input
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[]
NTSYSAPI PEB *WINAPI RtlGetCurrentPeb(void)
int WINAPI lstrlenA(LPCSTR lpString)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
#define TRUNCATE_EXISTING
#define FILE_FLAG_OVERLAPPED
#define ERROR_FILE_NOT_FOUND
static struct test_info tests[]
static PEXPLICIT_ACCESSW *static HMODULE hmod
static void test_unicode(void)
static void test_WriteConsoleOutputAttribute(HANDLE output_handle)
static void set_region(SMALL_RECT *region, unsigned int left, unsigned int top, unsigned int right, unsigned int bottom)
static DWORD mch_child_event
static void test_VerifyConsoleIoHandle(HANDLE handle)
static void test_GetConsoleTitleA(void)
static void test_AllocConsole(void)
static void test_GetConsoleOriginalTitleW(void)
static void test_CtrlHandlerSubsystem(void)
static void test_SetConsoleScreenBufferInfoEx(HANDLE std_output)
#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_AllocConsole_child(void)
static void test_GetConsoleScreenBufferInfoEx(HANDLE std_output)
static void test_FreeConsole(void)
static void test_OpenCON(void)
static void simple_write_console(HANDLE console, const char *text)
static DWORD check_child_console_bits(const char *exec, DWORD flags, enum inheritance_model inherit)
static HPCON *static LPSTR
static void check_region_(unsigned int line, const SMALL_RECT *region, unsigned int left, unsigned int top, int right, int bottom)
static void test_GetConsoleOriginalTitleA(void)
static void test_AttachConsole_child(DWORD console_pid)
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_CreateProcessCUI(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 BOOL filter_spurious_event(HANDLE input)
static void test_OpenConsoleW(void)
#define KERNEL32_GET_PROC(func)
static void test_CreateFileW(void)
static void test_GetCurrentConsoleFontEx(HANDLE std_output)
static void testScreenBuffer(HANDLE hConOut)
static HANDLE mch_child_kill_event
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 test_ReadConsoleOutput(HANDLE console)
static void testCursorInfo(HANDLE hCon)
static DWORD WINAPI read_pipe_proc(void *handle)
static void test_pseudo_console_child(HANDLE input, HANDLE output)
static void test_WriteConsoleOutput(HANDLE console)
static void testWaitForConsoleInput(HANDLE input_handle)
static void test_FlushConsoleInputBuffer(HANDLE input, HANDLE output)
#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 copy_change_subsystem(const char *in, const char *out, DWORD subsyst)
static void test_DuplicateConsoleHandle(void)
static HANDLE create_unbound_handle(BOOL output, BOOL test_status)
static void test_GetConsoleTitleW(void)
static void test_GetCurrentConsoleFont(HANDLE std_output)
static void testWriteWrappedProcessed(HANDLE hCon, COORD sbSize)
static void testWrite(HANDLE hCon, COORD sbSize)
static void test_GetConsoleOriginalTitle(void)
static void test_ReadConsole(HANDLE input)
static BOOL WINAPI mydummych(DWORD event)
#define check_region(a, b, c, d, e)
static void test_new_screen_buffer_color_attributes(HANDLE hConOut)
static void test_GetConsoleFontInfo(HANDLE std_output)
static void resetContent(HANDLE hCon, COORD sbSize, BOOL content)
static BOOL WINAPI mch_child(DWORD event)
static void test_new_screen_buffer_properties(HANDLE hConOut)
static void test_GetSetStdHandle(void)
static void test_SetCurrentConsoleFontEx(HANDLE std_output)
static void test_GetConsoleOriginalTitleW_empty(void)
static void test_pseudo_console(void)
static void test_condrv_server_as_root_directory(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_wait(HANDLE input, HANDLE orig_output)
static void test_ReadConsoleOutputCharacterW(HANDLE output_handle)
static void test_AttachConsole(HANDLE console)
static void test_console_as_root_directory(void)
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 PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK io
static PIO_STATUS_BLOCK iosb
#define InitializeObjectAttributes(p, n, a, r, s)
static HANDLE complete_event
static int font_height(HFONT hFont)
BOOL WINAPI CreatePipe(PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize)
HANDLE WINAPI CreateNamedPipeW(LPCWSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
#define FILE_READ_ATTRIBUTES
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS NTAPI NtQueryInformationFile(IN HANDLE hFile, OUT PIO_STATUS_BLOCK pIoStatusBlock, OUT PVOID FileInformationBuffer, IN ULONG FileInformationBufferLength, IN FILE_INFORMATION_CLASS FileInfoClass)
#define FILE_SHARE_DELETE
#define FILE_WRITE_ATTRIBUTES
NTSYSAPI NTSTATUS NTAPI NtWaitForSingleObject(IN HANDLE hObject, IN BOOLEAN bAlertable, IN PLARGE_INTEGER Timeout)
NTSTATUS NTAPI NtCreateFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength)
#define UNREFERENCED_PARAMETER(P)
static void test_file_info(void)
#define IMAGE_SUBSYSTEM_WINDOWS_CUI
#define IMAGE_SUBSYSTEM_WINDOWS_GUI
#define STATUS_CONTROL_C_EXIT
#define FILE_DEVICE_CONSOLE
#define offsetof(TYPE, MEMBER)
const char int int int static __inline const char * wine_dbgstr_a(const char *s)
int winetest_get_mainargs(char ***pargv)
#define wait_child_process
#define _WIN32_WINNT_WIN7
#define _WIN32_WINNT_VISTA
#define FileStandardInformation
NTSTATUS NTAPI NtQueryVolumeInformationFile(HANDLE FileHandle, PIO_STATUS_BLOCK IoStatusBlock, PVOID FsInformation, ULONG Length, FS_INFORMATION_CLASS FsInformationClass)
TCHAR str_buf[MAX_LOADSTRING]
union _CHAR_INFO::@3510 Char
WCHAR FaceName[LF_FACESIZE]
PRTL_USER_PROCESS_PARAMETERS ProcessParameters
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)
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_ACCESS_DENIED
#define STATUS_OBJECT_PATH_NOT_FOUND
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
#define STD_OUTPUT_HANDLE
#define PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE
DWORD WINAPI GetLastError(void)
#define NMPWAIT_USE_DEFAULT_WAIT
#define PIPE_ACCESS_DUPLEX
#define FILE_MAP_ALL_ACCESS
DWORD WINAPI GetCurrentProcessId(void)
#define INVALID_FILE_SIZE
#define CREATE_NEW_PROCESS_GROUP
#define EXTENDED_STARTUPINFO_PRESENT
#define STARTF_USESTDHANDLES
#define CREATE_NEW_CONSOLE
#define ATTACH_PARENT_PROCESS
#define ENABLE_QUICK_EDIT_MODE
#define ENABLE_ECHO_INPUT
#define ENABLE_MOUSE_INPUT
#define ENABLE_EXTENDED_FLAGS
#define WINDOW_BUFFER_SIZE_EVENT
struct _CONSOLE_FONT_INFOEX CONSOLE_FONT_INFOEX
struct _CONSOLE_SCREEN_BUFFER_INFOEX CONSOLE_SCREEN_BUFFER_INFOEX
#define ENABLE_INSERT_MODE
#define CONSOLE_TEXTMODE_BUFFER
struct _CONSOLE_FONT_INFO CONSOLE_FONT_INFO
#define ENABLE_LINE_INPUT
#define ENABLE_PROCESSED_INPUT
#define ENABLE_WINDOW_INPUT
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING
#define ENABLE_AUTO_POSITION
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
WINBASEAPI HANDLE WINAPI GetConsoleInputWaitHandle(void)
#define ERROR_BUFFER_OVERFLOW
#define ERROR_PATH_NOT_FOUND
#define ERROR_GEN_FAILURE
#define ERROR_BROKEN_PIPE
#define ERROR_INVALID_ACCESS
#define WT_EXECUTEONLYONCE
#define HKEY_CURRENT_USER
BOOL WINAPI IsWindow(_In_opt_ HWND)
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)
#define DUPLICATE_SAME_ACCESS