11#define okCURSOR(hCon, c) \
13 CONSOLE_SCREEN_BUFFER_INFO __sbi; \
14 BOOL expect = GetConsoleScreenBufferInfo((hCon), &__sbi) && \
15 __sbi.dwCursorPosition.X == (c).X && __sbi.dwCursorPosition.Y == (c).Y; \
16 ok(expect, "Expected cursor at (%d,%d), got (%d,%d)\n", \
17 (c).X, (c).Y, __sbi.dwCursorPosition.X, __sbi.dwCursorPosition.Y); \
20#define ATTR (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED)
89#define ChangeOutputCP(CodePage) \
90 ChangeOutputCP_(__FILE__, __LINE__, CodePage)
93#define cmpThreadLangId(file, line, ExpectedLangId) \
95 LANGID ThreadLangId; \
96 ThreadLangId = LANGIDFROMLCID(NtCurrentTeb()->CurrentLocale); \
97 trace_((file), (line))("Thread LangId %d, expecting %d...\n", \
98 ThreadLangId, (ExpectedLangId)); \
99 ok_((file), (line))(ThreadLangId == (ExpectedLangId), \
100 "Thread LangId %d, expected %d\n", \
101 ThreadLangId, (ExpectedLangId)); \
116 skip_(
file,
line)(
"Code page %d expected to be valid!\n", CodePage);
121 ok_(
file,
line)(newcp == CodePage,
"Console output CP is %d, expected %d\n", newcp, CodePage);
128#define doTest_CP_ThreadLang(...) \
129 doTest_CP_ThreadLang_(__FILE__, __LINE__, ##__VA_ARGS__)
146 skip(
"CJK system but console CP not in CJK\n");
168 UINT CJKCodePages[] = {932, 949, 936, 950};
174 newcp = (
s_uOEMCP == 437 ? 850 : 437);
183 newcp = CJKCodePages[
i];
190 skip(
"CJK system but console CP not in CJK\n");
222 skip(
"Codepage 855 not available\n");
228 ok(
ret,
"GetConsoleScreenBufferInfo failed\n");
253 ok(
ret,
"ReadConsoleOutputCharacterW failed\n");
262 ok(
ret,
"ReadConsoleOutputAttribute failed\n");
270 ok(
ret,
"SetConsoleCursorPosition failed\n");
297 ok(
ret,
"ReadConsoleOutputCharacterW failed\n");
326 ok(
ret,
"SetConsoleCursorPosition failed\n");
332 ok(
ret,
"FillConsoleOutputCharacterW failed\n");
355 ok(
ret,
"FillConsoleOutputCharacterW failed\n");
361 ok(
ret,
"ReadConsoleOutputCharacterW failed\n");
370 ok(
ret,
"ReadConsoleOutputAttribute failed\n");
378 ok(
ret,
"ReadConsoleOutputCharacterW failed\n");
396 ok(
ret,
"ReadConsoleOutputAttribute failed\n");
408 ok(
ret,
"ReadConsoleOutputCharacterW failed\n");
438 skip(
"Codepage 932 not available\n");
444 ok(
ret,
"GetConsoleScreenBufferInfo failed\n");
470 ok(
ret,
"ReadConsoleOutputCharacterW failed\n");
479 ok(
ret,
"ReadConsoleOutputAttribute failed\n");
488 ok(
ret,
"SetConsoleCursorPosition failed\n");
516 ok(
ret,
"ReadConsoleOutputCharacterW failed\n");
545 ok(
ret,
"SetConsoleCursorPosition failed\n");
551 ok(
ret,
"FillConsoleOutputCharacterW failed\n");
574 ok(
ret,
"FillConsoleOutputCharacterW failed\n");
583 ok(
ret,
"ReadConsoleOutputCharacterW failed\n");
592 ok(
ret,
"ReadConsoleOutputAttribute failed\n");
617 ok(
ret,
"ReadConsoleOutputAttribute failed\n");
625 ok(
ret,
"ReadConsoleOutputAttribute failed\n");
633 ok(
ret,
"ReadConsoleOutputAttribute failed\n");
640 ok(
ret,
"ReadConsoleOutputAttribute failed\n");
652 ok(
ret,
"ReadConsoleOutputAttribute failed\n");
673 ok(
ret,
"ReadConsoleOutputCharacterW failed\n");
710 sr.
Right = buffSize.
X - 1;
757 sr.
Right = buffSize.
X - 1;
822 sr.
Right = buffSize.
X - 1;
1031 sr.
Right = buffSize.
X - 1;
1076 sr.
Right = buffSize.
X - 1;
1142 sr.
Right = buffSize.
X - 1;
1337 memset(attrs, 0x7F,
sizeof(attrs));
1343 ok_int(attrs[0], 0xDCFF);
1344 ok_int(attrs[1], 0xDCFF);
1348 ok_int(attrs[0], 0xFCFF);
1349 ok_int(attrs[1], 0xFCFF);
1374 buff[3].Char.UnicodeChar =
L'A';
1376 buff[4].Char.UnicodeChar =
L' ';
1377 buff[4].Attributes = 0xFFFF;
1430 memset(attrs, 0x7F,
sizeof(attrs));
1473 memset(attrs, 0x7F,
sizeof(attrs));
1479 ok_int(attrs[1], 0xDCFF);
1481 ok_int(attrs[1], 0xFCFF);
1496 memset(attrs, 0x7F,
sizeof(attrs));
1531 trace(
"Running on %s system (codepage %d)\n",
1543 skip(
"Russian testcase is skipped because of CJK\n");
1547 skip(
"Russian locale is not installed\n");
1555 skip(
"Japanese testcase is skipped because of not CJK\n");
1559 skip(
"Japanese locale is not installed\n");
static BOOL doTest_CP_ThreadLang_(_In_ const char *file, _In_ int line, _In_ UINT CodePage, _In_ LANGID ExpectedLangId)
static void test_cp932(HANDLE hConOut)
static __inline LANGID MapCJKCPToLangId(_In_ UINT CodePage)
#define ChangeOutputCP(CodePage)
static BOOL ChangeOutputCP_(_In_ const char *file, _In_ int line, _In_ UINT CodePage)
static const LCID lcidRussian
static VOID test_CP_ThreadLang(VOID)
#define okCURSOR(hCon, c)
static const WCHAR ideograph_space
#define cmpThreadLangId(file, line, ExpectedLangId)
static const WCHAR u0414[]
static const WCHAR u9580[]
static void test_cp855(HANDLE hConOut)
#define doTest_CP_ThreadLang(...)
static const WCHAR s_str[]
static const LCID lcidJapanese
#define ok_long(expression, result)
#define ok_int(expression, result)
BOOL WINAPI SetConsoleOutputCP(IN UINT wCodepage)
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)
BOOL WINAPI AllocConsole(VOID)
BOOL WINAPI FreeConsole(VOID)
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 IsCJKCodePage(CodePage)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
UINT WINAPI DECLSPEC_HOTPATCH GetConsoleOutputCP(VOID)
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 WriteConsoleW(IN HANDLE hConsoleOutput, IN CONST VOID *lpBuffer, IN DWORD nNumberOfCharsToWrite, OUT LPDWORD lpNumberOfCharsWritten, LPVOID lpReserved)
BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleOutputW(IN HANDLE hConsoleOutput, IN CONST CHAR_INFO *lpBuffer, IN COORD dwBufferSize, IN COORD dwBufferCoord, IN OUT PSMALL_RECT lpWriteRegion)
BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleOutputW(IN HANDLE hConsoleOutput, OUT PCHAR_INFO lpBuffer, IN COORD dwBufferSize, IN COORD dwBufferCoord, IN OUT PSMALL_RECT lpReadRegion)
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 FillConsoleOutputCharacterW(IN HANDLE hConsoleOutput, IN WCHAR cCharacter, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfCharsWritten)
BOOL WINAPI GetVersionExA(IN LPOSVERSIONINFOA lpVersionInformation)
BOOL WINAPI IsValidCodePage(UINT codepage)
BOOL WINAPI IsValidLocale(LCID lcid, DWORD flags)
UINT WINAPI GetOEMCP(void)
static unsigned char buff[32768]
GLuint GLuint GLsizei count
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
#define skip_(test, file, line,...)
#define MAKELCID(lgid, srtid)
#define LANGIDFROMLCID(l)
#define SUBLANG_CHINESE_TRADITIONAL
#define SUBLANG_CHINESE_SIMPLIFIED
#define SUBLANG_ENGLISH_US
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
DWORD WINAPI GetLastError(void)
#define COMMON_LVB_TRAILING_BYTE
#define COMMON_LVB_LEADING_BYTE