28#define _CRT_NON_CONFORMING_WCSTOK
36#define WIN32_NO_STATUS
45static const WCHAR upper_case[] = {
'\t',
'J',
'U',
'S',
'T',
'!',
' ',
'A',
',',
' ',
'T',
'E',
'S',
'T',
';',
' ',
'S',
'T',
'R',
'I',
'N',
'G',
' ',
'1',
'/',
'*',
'+',
'-',
'.',
'\r',
'\n',0};
46static const WCHAR lower_case[] = {
'\t',
'j',
'u',
's',
't',
'!',
' ',
'a',
',',
' ',
't',
'e',
's',
't',
';',
' ',
's',
't',
'r',
'i',
'n',
'g',
' ',
'1',
'/',
'*',
'+',
'-',
'.',
'\r',
'\n',0};
47static const WCHAR title_case[] = {
'\t',
'J',
'u',
's',
't',
'!',
' ',
'A',
',',
' ',
'T',
'e',
's',
't',
';',
' ',
'S',
't',
'r',
'i',
'n',
'g',
' ',
'1',
'/',
'*',
'+',
'-',
'.',
'\r',
'\n',0};
48static const WCHAR symbols_stripped[] = {
'j',
'u',
's',
't',
'a',
't',
'e',
's',
't',
's',
't',
'r',
'i',
'n',
'g',
'1',0};
117#define X(f) p##f = (void*)GetProcAddress(mod, #f)
179#define eq(received, expected, label, type) \
180 ok((received) == (expected), "%s: got " type " instead of " type "\n", \
181 (label), (received), (expected))
183#define BUFFER_SIZE 128
185#define expect_str(r,s,e) expect_str_(__LINE__, r, s, e)
199#define expect_err(r,s,e) expect_err_(__LINE__, r, s, e, #e)
205 ok_(__FILE__,
line)(
strcmp(
str,
"pristine") == 0,
"Expected a pristine buffer, got '%s'\n",
str);
208#define expect_wstr(r,s,e) expect_wstr_(__LINE__, r, s, e)
222#define expect_werr(r,s,e) expect_werr_(__LINE__, r, s, e, #e)
235 if (
srclen <= 1)
return 0;
237 *
ch = 0x10000 + ((
src[0] & 0x3ff) << 10) + (
src[1] & 0x3ff);
253 str[0] = 0xd800 | (
c >> 10);
254 str[1] = 0xdc00 | (
c & 0x3ff);
258#define NUO LOCALE_NOUSEROVERRIDE
269 ok(
lcid == 0x409,
"wrong LCID calculated - %ld\n",
lcid);
284 "got %d with '%s' (expected %d with '%s')\n",
294 "got %d with '%s' (expected %d with '%s')\n",
298 win_skip(
"LANG_ARABIC not installed\n");
307 "got %d with '%s' (expected %d with '%s')\n",
342 "Expected ERROR_INSUFFICIENT_BUFFER, got %ld\n",
GetLastError());
361 { {
'a',
'r',0}, {
'a',
'r',
'-',
'S',
'A',0},
363 { {
'a',
'z',0}, {
'a',
'z',
'-',
'L',
'a',
't',
'n',
'-',
'A',
'Z',0},
365 { {
'd',
'e',0}, {
'd',
'e',
'-',
'D',
'E',0},
367 { {
'e',
'n',0}, {
'e',
'n',
'-',
'U',
'S',0},
369 { {
'e',
's',0}, {
'e',
's',
'-',
'E',
'S',0},
372 {
'e',
's',
'-',
'E',
'S',
'_',
't',
'r',
'a',
'd',
'n',
'l',0} },
373 { {
'g',
'a',0}, {
'g',
'a',
'-',
'I',
'E',0},
375 { {
'i',
't',0}, {
'i',
't',
'-',
'I',
'T',0},
377 { {
'm',
's',0}, {
'm',
's',
'-',
'M',
'Y',0},
379 { {
'n',
'l',0}, {
'n',
'l',
'-',
'N',
'L',0},
381 { {
'p',
't',0}, {
'p',
't',
'-',
'B',
'R',0},
383 { {
's',
'r',0}, {
'h',
'r',
'-',
'H',
'R',0},
385 { {
's',
'v',0}, {
's',
'v',
'-',
'S',
'E',0},
387 { {
'u',
'z',0}, {
'u',
'z',
'-',
'L',
'a',
't',
'n',
'-',
'U',
'Z',0},
389 { {
'z',
'h',0}, {
'z',
'h',
'-',
'C',
'N',0},
399 WCHAR bufferW[80], buffer2W[80];
407 win_skip(
"GetLocaleInfoW() isn't implemented\n");
413 ok(
val == lcid_en,
"got 0x%08lx\n",
val);
418 static const WCHAR slangW[] = {
'E',
'n',
'g',
'l',
'i',
's',
'h',
' ',
'(',
'U',
'n',
'i',
't',
'e',
'd',
' ',
419 'S',
't',
'a',
't',
'e',
's',
')',0};
420 static const WCHAR statesW[] = {
'U',
'n',
'i',
't',
'e',
'd',
' ',
'S',
't',
'a',
't',
'e',
's',0};
421 static const WCHAR enW[] = {
'e',
'n',
'-',
'U',
'S',0};
431 skip(
"Non-English locale\n");
441 skip(
"Non-English locale\n");
457 ok(
val ==
ptr->lcid || (
val &&
broken(
val ==
ptr->lcid_broken)),
"%s: got wrong lcid 0x%04lx, expected 0x%04lx\n",
469 win_skip(
"English neutral locale not supported\n");
473 win_skip(
"LANG_RUSSIAN locale data unavailable\n");
479 win_skip(
"LOCALE_RETURN_GENITIVE_NAMES isn't supported\n");
488 ok(
ret == 0,
"LOCALE_RETURN_GENITIVE_NAMES should fail with GetLocaleInfoA\n");
489 ok(bufferA[0] ==
'a',
"Expected buffer to be untouched\n");
491 "Expected ERROR_INVALID_FLAGS, got %lx\n",
GetLastError());
497 "LOCALE_RETURN_GENITIVE_NAMES itself doesn't return anything, got %ld\n",
ret);
498 ok(bufferW[0] ==
'a',
"Expected buffer to be untouched\n");
500 "Expected ERROR_INVALID_FLAGS, got %lx\n",
GetLastError());
503 for (
i = 0;
i < 12;
i++) {
507 ok(
ret,
"Expected non zero result\n");
508 ok(
ret ==
lstrlenW(bufferW)+1,
"Expected actual length, got %ld, length %d\n",
512 ok(
ret,
"Expected non zero result\n");
513 ok(
ret ==
lstrlenW(buffer2W)+1,
"Expected actual length, got %ld, length %d\n",
517 "Expected genitive name to differ, got the same for month %d\n",
i+1);
523 ok(
ret,
"Expected non zero result\n");
524 ok(
ret ==
lstrlenW(bufferW)+1,
"Expected actual length, got %ld, length %d\n",
528 ok(
ret,
"Expected non zero result\n");
529 ok(
ret ==
lstrlenW(buffer2W)+1,
"Expected actual length, got %ld, length %d\n",
533 "Expected same names, got different for month %d\n",
i+1);
731 if (!pGetTimeFormatEx)
733 win_skip(
"GetTimeFormatEx not supported\n");
905 char short_day[10],
month[10], genitive_month[10];
917 curtime.
wYear = 2002;
959 "got an unexpected date string '%s'\n",
buffer);
977 win_skip(
"LANG_RUSSIAN locale data unavailable\n");
986 ok(
strcmp(genitive_month,
month) != 0,
"Expected different month forms\n");
1048 if (!pGetDateFormatEx)
1050 win_skip(
"GetDateFormatEx not supported\n");
1080 curtime.
wYear = 2002;
1084 curtime.
wHour = 65432;
1091 curtime.
wYear = 2002;
1095 curtime.
wHour = 65432;
1106 curtime.
wYear = 1601;
1117 curtime.
wYear = 1600;
1144 win_skip(
"GetDateFormatW is not implemented\n");
1161 curtime.
wYear = 2002;
1165 curtime.
wHour = 65432;
1174 curtime.
wYear = 1601;
1185 curtime.
wYear = 1600;
1202 curtime.
wYear = 2002;
1213#define CY_POS_LEFT 0
1214#define CY_POS_RIGHT 1
1215#define CY_POS_LEFT_SPACE 2
1216#define CY_POS_RIGHT_SPACE 3
1220 static char szDot[] = {
'.',
'\0' };
1221 static char szComma[] = {
',',
'\0' };
1222 static char szDollar[] = {
'$',
'\0' };
1223 static const char*
const negative_order[] =
1325 format.NegativeOrder = 0;
1327 format.lpDecimalSep = szDot;
1328 format.lpThousandSep = szComma;
1329 format.lpCurrencySymbol = szDollar;
1363 format.NegativeOrder = 2;
1393 for (o = 0; o <= 15; o++)
1396 format.NegativeOrder = o;
1406#define NEG_LEFT_SPACE 2
1408#define NEG_RIGHT_SPACE 4
1412 static char szDot[] = {
'.',
'\0' };
1413 static char szComma[] = {
',',
'\0' };
1416 WCHAR grouping[32], t1000[8],
dec[8],
frac[8], lzero[8];
1504 format.NegativeOrder = 0;
1505 format.lpDecimalSep = szDot;
1506 format.lpThousandSep = szComma;
1602 const char *grouping;
1605 {
"3;0",
"1,234,567,890.54321" },
1606 {
"2;3",
"12345,678,90.54321" },
1607 {
"1",
"123456789,0.54321" },
1608 {
"1;0",
"1,2,3,4,5,6,7,8,9,0.54321" },
1609 {
"1;0;3",
"123456,789,,0.54321" },
1610 {
"0",
"1234567890.54321" },
1611 {
"0;0",
"1234567890.54321" },
1612 {
"0;1",
"123456789,0.54321" },
1613 {
"0;0;0",
"1234567890.54321" },
1614 {
"0;1;0",
"1,2,3,4,5,6,7,8,9,0.54321" },
1615 {
"2;0;0",
"12345678,90.54321" },
1616 {
"2;0;0;0",
"12345678,,90.54321" },
1617 {
"2;0;0;0;0",
"12345678,,,90.54321" },
1618 {
"2;0;0;1;0",
"1,2,3,4,5,6,7,8,,,90.54321" },
1619 {
"1;3;2",
"1234,56,789,0.54321" },
1620 {
"1;3;2;0",
"12,34,56,789,0.54321" },
1621 {
"3;1;1;2;0",
"1,23,45,6,7,890.54321" },
1622 {
"6;1",
"123,4,567890.54321" },
1665 static WCHAR commaW[] = {
',',0};
1666 static const WCHAR enW[] = {
'e',
'n',
'-',
'U',
'S',0};
1667 static const WCHAR frW[] = {
'f',
'r',
'-',
'F',
'R',0};
1668 static const WCHAR bogusW[] = {
'b',
'o',
'g',
'u',
's',0};
1671 if (!pGetNumberFormatEx)
1673 win_skip(
"GetNumberFormatEx is not available.\n");
1769 format.NegativeOrder = 0;
1771 format.lpThousandSep = commaW;
1831 if (pIsValidLocaleName(frW))
1836 L"-12\x202f\x33\x34\x35,00" :
1837 L"-12\xa0\x33\x34\x35,00";
1911 static const char ABC_EE[] = {
'A',
'B',
'C',0,0xEE};
1912 static const char ABC_FF[] = {
'A',
'B',
'C',0,0xFF};
1963 ok (
ret == 0,
"lstrcmpA(\"\", \"\") should return 0, got %d\n",
ret);
1966 ok (
ret == 0 ||
broken(
ret == -2) ,
"lstrcmpA(NULL, NULL) should return 0, got %d\n",
ret);
1969 ok (
ret == 1 ||
broken(
ret == -2) ,
"lstrcmpA(\"\", NULL) should return 1, got %d\n",
ret);
1972 ok (
ret == -1 ||
broken(
ret == -2) ,
"lstrcmpA(NULL, \"\") should return -1, got %d\n",
ret);
2023 "a\\0b vs a expected CSTR_EQUAL or CSTR_GREATER_THAN, got %d\n",
ret);
2035 ok(
ret == -1,
"\"#\" vs \".\" expected -1, got %d\n",
ret);
2065 static const WCHAR ABC_EE[] = {
'A',
'B',
'C',0,0xEE};
2066 static const WCHAR ABC_FF[] = {
'A',
'B',
'C',0,0xFF};
2067 static const WCHAR A_ACUTE_BC[] = {0xc1,
'B',
'C',0};
2068 static const WCHAR A_ACUTE_BC_DECOMP[] = {
'A',0x301,
'B',
'C',0};
2069 static const WCHAR A_NULL_BC[] = {
'A',0,
'B',
'C',0};
2101 "expected CSTR_EQUAL, got %d, last error %ld\n",
ret,
GetLastError());
2308 const char *
op[] = {
"ERROR",
"CSTR_LESS_THAN",
"CSTR_EQUAL",
"CSTR_GREATER_THAN"};
2313 if (!pCompareStringEx)
2315 win_skip(
"CompareStringEx not supported\n");
2326 "%d: got %s, expected %s\n",
i,
op[
ret],
op[
e->ret]);
2362 char buf[256], buf2[256];
2363 static const char upper_case[] =
"\tJUST! A, TEST; STRING 1/*+-.\r\n";
2364 static const char lower_case[] =
"\tjust! a, test; string 1/*+-.\r\n";
2371 "ret %d, error %ld, expected value %d\n",
2377 ok(!
ret,
"LCMAP_LOWERCASE and LCMAP_UPPERCASE are mutually exclusive\n");
2388 "LCMapStringA (flag %08lx) unexpected error code %ld\n",
2390 ok(!
ret,
"LCMapStringA (flag %08lx) should return 0, got %d\n",
2398 "ret %d, error %ld, expected value %d\n",
2406 "ret %d, error %ld, expected value %d\n",
2415 "should return 0 and ERROR_INSUFFICIENT_BUFFER, got %d\n",
ret);
2422 trace(
"Ignoring LCMapStringA(LCMAP_UPPERCASE, buf, buf) error on Win9x\n");
2426 "ret %d, error %ld, expected value %d\n",
2434 trace(
"Ignoring LCMapStringA(LCMAP_LOWERCASE, buf, buf) error on Win9x\n");
2438 "ret %d, error %ld, expected value %d\n",
2450 ok(!
ret,
"src == dst without LCMAP_UPPERCASE or LCMAP_LOWERCASE must fail\n");
2456 ok(
ret,
"LCMapStringA must succeed\n");
2457 ok(
buf[
ret-1] == 0,
"LCMapStringA not null-terminated\n");
2460 ok(ret2,
"LCMapStringA must succeed\n");
2461 ok(buf2[ret2-1] == 0,
"LCMapStringA not null-terminated\n" );
2462 ok(
ret == ret2,
"lengths of sort keys must be equal\n");
2468 ok(ret2,
"LCMapStringA must succeed\n");
2469 ok(
ret == ret2,
"lengths of sort keys must be equal (%d vs %d)\n",
ret, ret2);
2474 ok(
ret,
"LCMapStringA must succeed\n");
2477 ok(ret2,
"LCMapStringA must succeed\n");
2478 ok(
ret == ret2,
"lengths of sort keys must be equal\n");
2487 ok(
ret,
"LCMapStringA must succeed\n");
2490 ok(ret2,
"LCMapStringA must succeed\n");
2491 ok(
ret == ret2,
"lengths of sort keys must be equal\n");
2521 ok(!
ret,
"LCMapStringA should fail with srclen = 0\n");
2530 const static WCHAR japanese_text[] = {
2531 0x3044, 0x309d, 0x3084, 0x3001, 0x30a4, 0x30fc, 0x30cf, 0x30c8,
2532 0x30fc, 0x30f4, 0x30a9, 0x306e, 0x91ce, 0x539f, 0x306f, 0x5e83,
2533 0x3044, 0x3093, 0x3060, 0x3088, 0x3002, 0
2535 const static WCHAR hiragana_text[] = {
2536 0x3044, 0x309d, 0x3084, 0x3001, 0x3044, 0x30fc, 0x306f, 0x3068,
2537 0x30fc, 0x3094, 0x3049, 0x306e, 0x91ce, 0x539f, 0x306f, 0x5e83,
2538 0x3044, 0x3093, 0x3060, 0x3088, 0x3002, 0
2540 const static WCHAR katakana_text[] = {
2541 0x30a4, 0x30fd, 0x30e4, 0x3001, 0x30a4, 0x30fc, 0x30cf, 0x30c8,
2542 0x30fc, 0x30f4, 0x30a9, 0x30ce, 0x91ce, 0x539f, 0x30cf, 0x5e83,
2543 0x30a4, 0x30f3, 0x30c0, 0x30e8, 0x3002, 0
2545 const static WCHAR halfwidth_text[] = {
2546 0x3044, 0x309d, 0x3084, 0xff64, 0xff72, 0xff70, 0xff8a, 0xff84,
2547 0xff70, 0xff73, 0xff9e, 0xff6b, 0x306e, 0x91ce, 0x539f, 0x306f,
2548 0x5e83, 0x3044, 0x3093, 0x3060, 0x3088, 0xff61, 0
2550 const static WCHAR halfwidth_text2[] = {
2551 0xff72, 0x30fd, 0xff94, 0xff64, 0xff72, 0xff70, 0xff8a, 0xff84,
2552 0xff70, 0xff73, 0xff9e, 0xff6b, 0xff89, 0x91ce, 0x539f, 0xff8a,
2553 0x5e83, 0xff72, 0xff9d, 0xff80, 0xff9e, 0xff96, 0xff61, 0
2555 const static WCHAR math_text[] = {
2556 0xd835, 0xdc00, 0xd835, 0xdc01, 0xd835, 0xdc02, 0xd835, 0xdc03,
2557 0xd835, 0xdd52, 0xd835, 0xdd53, 0xd835, 0xdd54, 0xd835, 0xdd55, 0
2559 const static WCHAR math_result[] =
L"ABCDabcd";
2560 const static WCHAR math_arabic_text[] = {
2561 0xd83b, 0xde00, 0xd83b, 0xde01, 0xd83b, 0xde02, 0xd83b, 0xde03,
2562 0xd83b, 0xde10, 0xd83b, 0xde11, 0xd83b, 0xde12, 0xd83b, 0xde13, 0
2564 const static WCHAR math_arabic_result[] = {
2565 0x0627, 0x0628, 0x062c, 0x062f, 0x0641, 0x0635, 0x0642, 0x0631, 0
2567 const static WCHAR cjk_compat_text[] = {
2568 0xd87e, 0xdc20, 0xd87e, 0xdc21, 0xd87e, 0xdc22, 0xd87e, 0xdc23,
2569 0xd87e, 0xdc24, 0xd87e, 0xdc25, 0xd87e, 0xdc26, 0xd87e, 0xdc27, 0
2571 const static WCHAR cjk_compat_result[] = {
2572 0x523b, 0x5246, 0x5272, 0x5277, 0x3515, 0x52c7, 0x52c9, 0x52e4, 0
2574 const static WCHAR accents_text[] = {
2575 0x00e0, 0x00e7,
' ', 0x00e9,
',', 0x00ee, 0x00f1,
'/', 0x00f6, 0x00fb, 0x00fd,
'!', 0
2577 const static WCHAR accents_result[] =
L"ac e,in/ouy!";
2578 const static WCHAR accents_result2[] =
L"aceinouy";
2581 char *p_buf = (
char *)
buf, *p_buf2 = (
char *)buf2;
2586 "%s ret %d, error %ld, expected value %d\n",
func_name,
2589 "Expected title case string\n");
2598 "%s (flag %08lx) unexpected error code %ld\n",
2600 ok(!
ret,
"%s (flag %08lx) should return 0, got %d\n",
2624 ok(
ret == 1,
"%s ret %d, error %ld, expected value 1\n",
func_name,
2627 ok(buf2[0] == 0x3095 ||
broken(buf2[0] == 0x30f5 ),
2628 "%s expected %04x, got %04x\n",
func_name, 0x3095, buf2[0]);
2716 "%s should return 0 and ERROR_INSUFFICIENT_BUFFER, got %d\n",
func_name,
ret);
2724 "%s should return 0 and ERROR_INSUFFICIENT_BUFFER, got %d\n",
func_name,
ret);
2734 "%s should return 0 and ERROR_INSUFFICIENT_BUFFER, got %d\n",
func_name,
ret);
2739 "%s should return 0 and ERROR_INSUFFICIENT_BUFFER, got %d\n",
func_name,
ret);
2767 ok(!
ret,
"%s src == dst without LCMAP_UPPERCASE or LCMAP_LOWERCASE must fail\n",
func_name);
2776 ok(
ret == ret2,
"%s lengths of sort keys must be equal\n",
func_name);
2780#if defined(__REACTOS__) && defined(_WIN64)
2782 ok(
FALSE,
"FIXME: These tests crash on ReactOS x64\n");
2789 ret = (
char *)
memchr( p_buf, 0xcc,
sizeof(
buf) ) - p_buf;
2798 ret = (
char *)
memchr( p_buf, 0xcc,
sizeof(
buf) ) - p_buf;
2802#if defined(__REACTOS__) && defined(_WIN64)
2812 ok(ret2,
"%s func_ptr must succeed\n",
func_name);
2813 ok(
ret == ret2,
"%s lengths of sort keys must be equal\n",
func_name);
2825 ok(ret2,
"%s func_ptr must succeed\n",
func_name);
2826 ok(
ret == ret2,
"%s lengths of sort keys must be equal\n",
func_name);
2865 ok(
ret == 0,
"Expected a failure\n");
2872 ok(!
ret,
"%s func_ptr should fail with srclen = 0\n",
func_name);
2887 trace(
"testing LCMapStringW\n");
2891 ok(!
ret,
"LCMapStringW should fail with bad lcid\n");
2896 ok(!
ret,
"LCMapStringW should fail with bad lcid\n");
2912 if (!pLCMapStringEx)
2914 win_skip(
"LCMapStringEx not available\n" );
2918 trace(
"testing LCMapStringEx\n");
2923 ok(!
ret,
"LCMapStringEx should fail with bad locale name\n");
2932 ok(
ret,
"LCMapStringEx should not fail with bad locale name\n");
2963 { {
'a',
'r',0}, {
'a',
'r',
'-',
'S',
'A',0},
MAKELCID(
MAKELANGID(
LANG_ARABIC,
SUBLANG_ARABIC_SAUDI_ARABIA),
SORT_DEFAULT) },
2964 { {
'a',
'z',0}, {
'a',
'z',
'-',
'L',
'a',
't',
'n',
'-',
'A',
'Z',0},
MAKELCID(
MAKELANGID(
LANG_AZERI,
SUBLANG_AZERI_LATIN),
SORT_DEFAULT) },
2965 { {
'd',
'e',0}, {
'd',
'e',
'-',
'D',
'E',0},
MAKELCID(
MAKELANGID(
LANG_GERMAN,
SUBLANG_GERMAN),
SORT_DEFAULT) },
2966 { {
'e',
'n',0}, {
'e',
'n',
'-',
'U',
'S',0},
MAKELCID(
MAKELANGID(
LANG_ENGLISH,
SUBLANG_ENGLISH_US),
SORT_DEFAULT) },
2967 { {
'e',
's',0}, {
'e',
's',
'-',
'E',
'S',0},
MAKELCID(
MAKELANGID(
LANG_SPANISH,
SUBLANG_SPANISH_MODERN),
SORT_DEFAULT) },
2968 { {
'g',
'a',0}, {
'g',
'a',
'-',
'I',
'E',0},
MAKELCID(
MAKELANGID(
LANG_IRISH,
SUBLANG_IRISH_IRELAND),
SORT_DEFAULT) },
2969 { {
'i',
't',0}, {
'i',
't',
'-',
'I',
'T',0},
MAKELCID(
MAKELANGID(
LANG_ITALIAN,
SUBLANG_ITALIAN),
SORT_DEFAULT) },
2970 { {
'm',
's',0}, {
'm',
's',
'-',
'M',
'Y',0},
MAKELCID(
MAKELANGID(
LANG_MALAY,
SUBLANG_MALAY_MALAYSIA),
SORT_DEFAULT) },
2971 { {
'n',
'l',0}, {
'n',
'l',
'-',
'N',
'L',0},
MAKELCID(
MAKELANGID(
LANG_DUTCH,
SUBLANG_DUTCH),
SORT_DEFAULT) },
2972 { {
'p',
't',0}, {
'p',
't',
'-',
'B',
'R',0},
MAKELCID(
MAKELANGID(
LANG_PORTUGUESE,
SUBLANG_PORTUGUESE_BRAZILIAN),
SORT_DEFAULT) },
2973 { {
's',
'r',0}, {
's',
'r',
'-',
'L',
'a',
't',
'n',
'-',
'R',
'S',0},
MAKELCID(
MAKELANGID(
LANG_SERBIAN,
SUBLANG_SERBIAN_SERBIA_LATIN),
SORT_DEFAULT) },
2974 { {
's',
'v',0}, {
's',
'v',
'-',
'S',
'E',0},
MAKELCID(
MAKELANGID(
LANG_SWEDISH,
SUBLANG_SWEDISH),
SORT_DEFAULT) },
2975 { {
'u',
'z',0}, {
'u',
'z',
'-',
'L',
'a',
't',
'n',
'-',
'U',
'Z',0},
MAKELCID(
MAKELANGID(
LANG_UZBEK,
SUBLANG_UZBEK_LATIN),
SORT_DEFAULT) },
2976 { {
'z',
'h',0}, {
'z',
'h',
'-',
'C',
'N',0},
MAKELCID(
MAKELANGID(
LANG_CHINESE,
SUBLANG_CHINESE_SIMPLIFIED),
SORT_DEFAULT) },
2991 win_skip(
"LocaleNameToLCID not available\n" );
2994#if defined(__REACTOS__) && defined(_WIN64)
2996 ok(
FALSE,
"FIXME: Most of test_LocaleNameToLCID() crashes on ReactOS x64\n");
3013#if !defined(__REACTOS__) || DLL_EXPORT_VERSION >= 0x600
3016#if defined(__REACTOS__) && defined(_WIN64)
3075 ok(
lcid ==
ptr->lcid,
"%s: got wrong lcid 0x%04lx, expected 0x%04lx\n",
3170 ok(
lcid == 0x00010407,
"got %08lx\n",
lcid );
3180 ok(
lcid == 0xdeadbeef,
"got %08lx\n",
lcid );
3214 if (!
status)
ok(
lcid ==
ptr->lcid,
"%s: got wrong lcid 0x%04lx, expected 0x%04lx\n",
3218 else win_skip(
"RtlLocaleNameToLcid not available\n" );
3222#if !defined(__REACTOS__) || DLL_EXPORT_VERSION >= 0x600
3246 ok(
str.MaximumLength ==
sizeof(
buffer),
"wrong max len %u\n",
str.MaximumLength );
3269#if !defined(__REACTOS__) || DLL_EXPORT_VERSION >= 0x600
3279#if !defined(__REACTOS__) || DLL_EXPORT_VERSION >= 0x600
3295#if !defined(__REACTOS__) || DLL_EXPORT_VERSION >= 0x600
3307 str.Length = 0xbeef;
3308 str.MaximumLength = 5 *
sizeof(
WCHAR);
3311 ok(
str.Length == 0xbeef,
"wrong len %u\n",
str.Length );
3312 ok(
str.MaximumLength == 5 *
sizeof(
WCHAR),
"wrong len %u\n",
str.MaximumLength );
3319 ok(
str.MaximumLength ==
str.Length +
sizeof(
WCHAR),
"wrong max len %u\n",
str.MaximumLength );
3323 else win_skip(
"RtlLcidToLocaleName not available\n" );
3332 ok( !!
ret,
"failed for %04lx\n",
lcid );
3337 ok( !!
ret,
"failed for %04lx\n",
lcid );
3342 ok( !!ret2,
"failed for %04lx\n",
lcid );
3343 ok(
ret == ret2,
"got different pointer for neutral\n" );
3348 ok( !!ret2,
"failed for %04lx\n",
lcid );
3349 ok(
ret != ret2,
"got same pointer for neutral\n" );
3354 ok( !!
ret,
"failed for %04lx\n",
lcid );
3355 ok(
lcid == 0x00010407,
"wrong lcid %04lx\n",
lcid );
3359 ok( !!
ret,
"failed for %04lx\n",
lcid );
3362 ok(
ret == ret2,
"got different pointer for system\n" );
3366 ok( !!
ret,
"failed for %04lx\n",
lcid );
3369 ok(
ret == ret2,
"got different pointer for user\n" );
3373 ok( !!
ret,
"failed for %04lx\n",
lcid );
3376 ok(
ret == ret2,
"got different pointer for invariant\n" );
3380 ok( !!
ret,
"failed for %04lx\n",
lcid );
3383 ok(
ret == ret2,
"got different pointer for custom default\n" );
3397 ok( !
ret,
"succeeded\n" );
3398 ok(
lcid == 0xbeef,
"wrong lcid %04lx\n",
lcid );
3401 else win_skip(
"NlsValidateLocale not available\n" );
3470 const char *
s1 = *(
const char *
const *)e1;
3471 const char *
s2 = *(
const char *
const *)e2;
3478 const char *
s1 = *(
const char *
const *)e1;
3479 const char *
s2 = *(
const char *
const *)e2;
3486 const char *
s1 = *(
const char *
const *)e1;
3487 const char *
s2 = *(
const char *
const *)e2;
3488 char key1[256], key2[256];
3493 if (!
ret)
ret = len1 - len2;
3511 "qsort using lstrcmpA failed for element %d\n",
i);
3519 "qsort using CompareStringA failed for element %d\n",
i);
3527 "qsort using sort keys failed for element %d\n",
i);
3597 {
L"en-US", -1,
CSTR_LESS_THAN, 0,
L"\x6785\x3bff\x6f83",
L"\x7550\x34c9\x71a7" },
3639 {
L"en-US", 0,
CSTR_EQUAL, 0,
L"A\x0301\x0301",
L"A\x0301\x00ad\x0301" },
3640 {
L"en-US", 0,
CSTR_EQUAL, 0,
L"b\x07f2\x07f2",
L"b\x07f2\x2064\x07f2" },
3641 {
L"en-US", 0,
CSTR_EQUAL, 0,
L"X\x0337\x0337",
L"X\x0337\xfffd\x0337" },
3791 {
L"en-US", -1,
CSTR_EQUAL, 0,
L"\x0f75",
L"\x0f71\x0f74" },
3792 {
L"en-US", -1,
CSTR_EQUAL, 0,
L"\xfc5e",
L"\x064c\x0651" },
3793 {
L"en-US", -1,
CSTR_EQUAL, 0,
L"\xfb2b",
L"\x05e9\x05c2" },
3794 {
L"en-US", -1,
CSTR_EQUAL, 0,
L"\xfe71",
L"\x0640\x064b" },
3797 {
L"ja-JP", -1,
CSTR_LESS_THAN, 0,
L"\x685d\x1239\x1b61",
L"\x59b6\x6542\x2a62\x04a7" },
3869 if (!pLCMapStringEx)
3871 win_skip(
"LCMapStringEx not available\n");
3888 else if (len1 < len2)
result = -1;
3889 else if (len1 > len2)
result = 1;
3894 ok (
result ==
entry->result_sortkey,
"Test %d (%s, %s) - Expected %d, got %d\n",
3898#
if !defined(__REACTOS__) || DLL_EXPORT_VERSION >= 0x600
3899#
if defined(__REACTOS__) && defined(_WIN64)
3900 if ((
i == 0 ||
i == 5 ||
i == 8 ||
i == 9 ||
i == 17 ||
i == 80 ||
i == 81 ||
i == 84 ||
3901 i == 199 ||
i == 200 ||
i == 202 ||
i == 235 ||
i == 236 ||
i == 250 ||
i == 251 ||
3906 ok (
result ==
entry->result_compare,
"Test %d (%s, %s) - Expected %d, got %d\n",
3913 ok(ret1 == ret2,
"Got ret1=%d, ret2=%d\n", ret1, ret2);
3921 static const char digits_src[] = { 0xB9,0xB2,0xB3,
'\0' };
3922 static const char digits_dst[] = {
'1',
'2',
'3',
'\0' };
3923 static const char composite_src[] =
3925 0x8a,0x8e,0x9a,0x9e,0x9f,0xc0,0xc1,0xc2,
3926 0xc3,0xc4,0xc5,0xc7,0xc8,0xc9,0xca,0xcb,
3927 0xcc,0xcd,0xce,0xcf,0xd1,0xd2,0xd3,0xd4,
3928 0xd5,0xd6,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,
3929 0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe7,0xe8,
3930 0xe9,0xea,0xeb,0xec,0xed,0xee,0xef,0xf1,
3931 0xf2,0xf3,0xf4,0xf5,0xf6,0xf8,0xf9,0xfa,
3932 0xfb,0xfc,0xfd,0xff,
'\0'
3934 static const char composite_dst[] =
3936 0x53,0x3f,0x5a,0x3f,0x73,0x3f,0x7a,0x3f,
3937 0x59,0xa8,0x41,0x60,0x41,0xb4,0x41,0x5e,
3938 0x41,0x7e,0x41,0xa8,0x41,0xb0,0x43,0xb8,
3939 0x45,0x60,0x45,0xb4,0x45,0x5e,0x45,0xa8,
3940 0x49,0x60,0x49,0xb4,0x49,0x5e,0x49,0xa8,
3941 0x4e,0x7e,0x4f,0x60,0x4f,0xb4,0x4f,0x5e,
3942 0x4f,0x7e,0x4f,0xa8,0x4f,0x3f,0x55,0x60,
3943 0x55,0xb4,0x55,0x5e,0x55,0xa8,0x59,0xb4,
3944 0x61,0x60,0x61,0xb4,0x61,0x5e,0x61,0x7e,
3945 0x61,0xa8,0x61,0xb0,0x63,0xb8,0x65,0x60,
3946 0x65,0xb4,0x65,0x5e,0x65,0xa8,0x69,0x60,
3947 0x69,0xb4,0x69,0x5e,0x69,0xa8,0x6e,0x7e,
3948 0x6f,0x60,0x6f,0xb4,0x6f,0x5e,0x6f,0x7e,
3949 0x6f,0xa8,0x6f,0x3f,0x75,0x60,0x75,0xb4,
3950 0x75,0x5e,0x75,0xa8,0x79,0xb4,0x79,0xa8,
'\0'
3952 static const char composite_dst_alt[] =
3954 0x53,0x3f,0x5a,0x3f,0x73,0x3f,0x7a,0x3f,
3955 0x59,0xa8,0x41,0x60,0x41,0xb4,0x41,0x5e,
3956 0x41,0x7e,0x41,0xa8,0x41,0xb0,0x43,0xb8,
3957 0x45,0x60,0x45,0xb4,0x45,0x5e,0x45,0xa8,
3958 0x49,0x60,0x49,0xb4,0x49,0x5e,0x49,0xa8,
3959 0x4e,0x7e,0x4f,0x60,0x4f,0xb4,0x4f,0x5e,
3960 0x4f,0x7e,0x4f,0xa8,0xd8,0x55,0x60,0x55,
3961 0xb4,0x55,0x5e,0x55,0xa8,0x59,0xb4,0x61,
3962 0x60,0x61,0xb4,0x61,0x5e,0x61,0x7e,0x61,
3963 0xa8,0x61,0xb0,0x63,0xb8,0x65,0x60,0x65,
3964 0xb4,0x65,0x5e,0x65,0xa8,0x69,0x60,0x69,
3965 0xb4,0x69,0x5e,0x69,0xa8,0x6e,0x7e,0x6f,
3966 0x60,0x6f,0xb4,0x6f,0x5e,0x6f,0x7e,0x6f,
3967 0xa8,0xf8,0x75,0x60,0x75,0xb4,0x75,0x5e,
3968 0x75,0xa8,0x79,0xb4,0x79,0xa8,
'\0'
3970 static const char ligatures_src[] =
3972 0x8C,0x9C,0xC6,0xDE,0xDF,0xE6,0xFE,
'\0'
3974 static const char ligatures_dst[] =
3976 'O',
'E',
'o',
'e',
'A',
'E',
'T',
'H',
's',
's',
'a',
'e',
't',
'h',
'\0'
3978 static const struct special
3982 } foldczone_special[] =
3985 { 0x85, { 0x2e, 0x2e, 0x2e, 0x00 } },
3986 { 0x98, { 0x20, 0x7e, 0x00 } },
3987 { 0x99, { 0x54, 0x4d, 0x00 } },
3988 { 0xa0, { 0x20, 0x00 } },
3989 { 0xa8, { 0x20, 0xa8, 0x00 } },
3990 { 0xaa, { 0x61, 0x00 } },
3991 { 0xaf, { 0x20, 0xaf, 0x00 } },
3992 { 0xb2, { 0x32, 0x00 } },
3993 { 0xb3, { 0x33, 0x00 } },
3994 { 0xb4, { 0x20, 0xb4, 0x00 } },
3995 { 0xb8, { 0x20, 0xb8, 0x00 } },
3996 { 0xb9, { 0x31, 0x00 } },
3997 { 0xba, { 0x6f, 0x00 } },
3998 { 0xbc, { 0x31, 0x2f, 0x34, 0x00 } },
3999 { 0xbd, { 0x31, 0x2f, 0x32, 0x00 } },
4000 { 0xbe, { 0x33, 0x2f, 0x34, 0x00 } },
4007 trace(
"Skipping FoldStringA tests for a not Latin 1 locale\n");
4016 "MAP_FOLDDIGITS: Expected '%s', got '%s'\n", digits_dst,
dst);
4017 for (
i = 1;
i < 256;
i++)
4026 "MAP_FOLDDIGITS: Expected '%s', got '%s'\n",
src,
dst);
4035 "MAP_EXPAND_LIGATURES: Expected '%s', got '%s'\n", ligatures_dst,
dst);
4036 for (
i = 1;
i < 256;
i++)
4038 if (!
strchr(ligatures_src,
i))
4048 "Got %s for %d\n",
dst,
i);
4054 "MAP_EXPAND_LIGATURES: Expected '%s', got '%s'\n",
src,
dst);
4065 ok(
ret == 121 ||
ret == 119,
"Expected 121 or 119, got %d\n",
ret);
4067 "MAP_COMPOSITE: Mismatch, got '%s'\n",
dst);
4069 for (
i = 1;
i < 256;
i++)
4071 if (!
strchr(composite_src,
i))
4078 "0x%02x, 0x%02x,0x%02x,0x%02x,\n", (
unsigned char)
src[0],
4079 (
unsigned char)
dst[0],(
unsigned char)
dst[1],(
unsigned char)
dst[2]);
4084 for (
i = 1;
i < 256;
i++)
4091 for (
j = 0; foldczone_special[
j].src != 0 && ! is_special;
j++)
4093 if (foldczone_special[
j].
src ==
src[0])
4096 "Expected ret == 2 or %d, got %d, error %ld\n",
4099 "MAP_FOLDCZONE: string mismatch for 0x%02x\n",
4100 (
unsigned char)
src[0]);
4108 "MAP_FOLDCZONE: Expected 0x%02x, got 0x%02x\n",
4109 (
unsigned char)
src[0], (
unsigned char)
dst[0]);
4114 for (
i = 1;
i < 256;
i++)
4121 "MAP_PRECOMPOSED: Expected 0x%02x, got 0x%02x\n",
4122 (
unsigned char)
src[0], (
unsigned char)
dst[0]);
4130 unsigned int i,
j,
len;
4133 static const DWORD badFlags[] =
4149 { 0x07c0, 0, 9,
TRUE },
4158 { 0x0b66, 0, 9,
TRUE },
4159 { 0x0be6, 0, 9,
TRUE },
4165 { 0x0c78, 0, 3,
TRUE },
4166 { 0x0c7c, 1, 3,
TRUE },
4169 { 0x0de6, 0, 9,
TRUE },
4173 { 0x0f20, 0, 9,
TRUE },
4174 { 0x1040, 0, 9,
TRUE },
4175 { 0x1090, 0, 9,
TRUE },
4176 { 0x1369, 1, 9,
TRUE },
4177 { 0x17e0, 0, 9,
TRUE },
4178 { 0x1810, 0, 9,
TRUE },
4179 { 0x1946, 0, 9,
TRUE },
4180 { 0x19d0, 0, 9,
TRUE },
4191 { 0x19da, 1, 1,
TRUE },
4192 { 0x1a80, 0, 9,
TRUE },
4193 { 0x1a90, 0, 9,
TRUE },
4195 { 0x1b50, 0, 9,
TRUE },
4196 { 0x1bb0, 0, 9,
TRUE },
4197 { 0x1c40, 0, 9,
TRUE },
4198 { 0x1c50, 0, 9,
TRUE },
4213 { 0x24f5, 1, 9,
TRUE },
4214 { 0x24ff, 0, 0,
TRUE },
4223 { 0x3007, 0, 0,
TRUE },
4224 { 0x3021, 1, 9,
TRUE },
4225 { 0xa620, 0, 9,
TRUE },
4226 { 0xa8d0, 0, 9,
TRUE },
4233 { 0xa8e0, 0, 9,
TRUE },
4235 { 0xa900, 0, 9,
TRUE },
4239 { 0xa9d0, 0, 9,
TRUE },
4240 { 0xa9f0, 0, 9,
TRUE },
4242 { 0xaa50, 0, 9,
TRUE },
4246 { 0xabf0, 0, 9,
TRUE },
4249 { 0x10107, 1, 9,
TRUE },
4250 { 0x10320, 1, 1,
TRUE },
4251 { 0x10321, 5, 5,
TRUE },
4252 { 0x104a0, 0, 9,
TRUE },
4259 { 0x10a40, 1, 4,
TRUE },
4260 { 0x10d30, 0, 9,
TRUE },
4261 { 0x10d40, 0, 9,
TRUE },
4262 { 0x10e60, 1, 9,
TRUE },
4263 { 0x11052, 1, 9,
TRUE },
4264 { 0x11066, 0, 9,
TRUE },
4265 { 0x110f0, 0, 9,
TRUE },
4266 { 0x11136, 0, 9,
TRUE },
4267 { 0x111d0, 0, 9,
TRUE },
4268 { 0x112f0, 0, 9,
TRUE },
4269 { 0x11450, 0, 9,
TRUE },
4270 { 0x114d0, 0, 9,
TRUE },
4271 { 0x11650, 0, 9,
TRUE },
4272 { 0x116c0, 0, 9,
TRUE },
4273 { 0x116d0, 0, 9,
TRUE },
4274 { 0x116da, 0, 9,
TRUE },
4275 { 0x11730, 0, 9,
TRUE },
4276 { 0x118e0, 0, 9,
TRUE },
4277 { 0x11950, 0, 9,
TRUE },
4278 { 0x11bf0, 0, 9,
TRUE },
4279 { 0x11c50, 0, 9,
TRUE },
4280 { 0x11d50, 0, 9,
TRUE },
4281 { 0x11da0, 0, 9,
TRUE },
4282 { 0x11f50, 0, 9,
TRUE },
4283 { 0x16130, 0, 9,
TRUE },
4284 { 0x16a60, 0, 9,
TRUE },
4285 { 0x16ac0, 0, 9,
TRUE },
4286 { 0x16b50, 0, 9,
TRUE },
4287 { 0x16d70, 0, 9,
TRUE },
4288 { 0x1ccf0, 0, 9,
TRUE },
4290 { 0x1d7ce, 0, 9,
TRUE },
4291 { 0x1d7d8, 0, 9,
TRUE },
4292 { 0x1d7e2, 0, 9,
TRUE },
4293 { 0x1d7ec, 0, 9,
TRUE },
4294 { 0x1d7f6, 0, 9,
TRUE },
4302 { 0x1e140, 0, 9,
TRUE },
4303 { 0x1e2f0, 0, 9,
TRUE },
4304 { 0x1e4f0, 0, 9,
TRUE },
4305 { 0x1e5f1, 0, 9,
TRUE },
4306 { 0x1e950, 0, 9,
TRUE },
4307 { 0x1f100, 0, 0,
TRUE },
4308 { 0x1f101, 0, 9,
TRUE },
4309 { 0x1fbf0, 0, 9,
TRUE },
4312 static const WCHAR foldczone_src[] =
4314 'W',
'i',
'n',
'e', 0x0348, 0x0551, 0x1323, 0x280d,
4315 0xff37, 0xff49, 0xff4e, 0xff45, 0x3c5, 0x308, 0x6a, 0x30c, 0xa0, 0xaa, 0
4317 static const WCHAR foldczone_dst[] =
4319 'W',
'i',
'n',
'e',0x0348,0x0551,0x1323,0x280d,
'W',
'i',
'n',
'e',0x3cb,0x1f0,
' ',
'a',0
4321 static const WCHAR foldczone_broken_dst[] =
4323 'W',
'i',
'n',
'e',0x0348,0x0551,0x1323,0x280d,
'W',
'i',
'n',
'e',0x03c5,0x0308,
'j',0x030c,0x00a0,0x00aa,0
4325 static const WCHAR ligatures_src[] =
4327 'W',
'i',
'n',
'e', 0x03a6, 0x03b9, 0x03bd, 0x03b5,
4328 0x00c6, 0x00de, 0x00df, 0x00e6, 0x00fe, 0x0132, 0x0133, 0x0152,
4329 0x0153, 0x01c4, 0x01c5, 0x01c6, 0x01c7, 0x01c8, 0x01c9, 0x01ca,
4330 0x01cb, 0x01cc, 0x01e2, 0x01e3, 0x01f1, 0x01f2, 0x01f3, 0x01fc,
4331 0x01fd, 0x05f0, 0x05f1, 0x05f2, 0xfb00, 0xfb01, 0xfb02, 0xfb03,
4332 0xfb04, 0xfb05, 0xfb06,
'\0'
4334 static const WCHAR ligatures_dst[] =
4336 'W',
'i',
'n',
'e',0x03a6,0x03b9,0x03bd,0x03b5,
4337 'A',
'E',
'T',
'H',
's',
's',
'a',
'e',
't',
'h',
'I',
'J',
'i',
'j',
'O',
'E',
'o',
'e',
4338 'D',0x017d,
'D',0x017e,
'd',0x017e,
'L',
'J',
'L',
'j',
'l',
'j',
'N',
'J',
'N',
'j',
4339 'n',
'j',0x0100,0x0112,0x0101,0x0113,
'D',
'Z',
'D',
'z',
'd',
'z',0x00c1,0x00c9,
4340 0x00e1,0x00e9,0x05d5,0x05d5,0x05d5,0x05d9,0x05d9,0x05d9,
'f',
'f',
'f',
'i',
4341 'f',
'l',
'f',
'f',
'i',
'f',
'f',
'l',0x017f,
't',
's',
't',
'\0'
4351 "Expected ERROR_INVALID_FLAGS, got %ld\n",
GetLastError());
4358 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
4364 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
4370 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
4376 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
4385 ok(
dst[0] ==
'A' &&
dst[1] ==
'\0',
4386 "srclen=-1: Expected ret=2 [%d,%d], got ret=%d [%d,%d], err=%ld\n",
4398 "srclen=1: Expected ret=1, [%d,%d], got ret=%d,[%d,%d], err=%ld\n",
4405 for (
ch = prev_ch;
ch < digitRanges[
j].ch;
ch++)
4420 ok(
dst[0] ==
ch,
"MAP_FOLDDIGITS: ch 0x%04x Expected unchanged got %04x\n",
ch,
dst[0]);
4426 ok(!(
type &
C1_DIGIT),
"char %04x should not be a digit\n", wch );
4429 if (digitRanges[
j].
ch == 0x10ffff)
4432 for (
ch = digitRanges[
j].
ch;
ch <= digitRanges[
j].ch + digitRanges[
j].last - digitRanges[
j].first;
ch++)
4434 UINT exp =
'0' + digitRanges[
j].first +
ch - digitRanges[
j].ch;
4443 "MAP_FOLDDIGITS: ch %04x Expected %04x got %04x\n",
ch,
exp,
dst[0]);
4454 ok(!
memcmp(
dst, foldczone_dst,
sizeof(foldczone_dst))
4455 ||
broken(!
memcmp(
dst, foldczone_broken_dst,
sizeof(foldczone_broken_dst))),
4462 ok(!
memcmp(
dst, ligatures_dst,
sizeof(ligatures_dst)),
4471 ok(lcid == l, "Expected lcid = %08lx, got %08lx\n", l, lcid)
4472#define MKLCID(x,y,z) MAKELCID(MAKELANGID(x, y), z)
4473#define LCID_RES(src, res) do { lcid = ConvertDefaultLocale(src); LCID_OK(res); } while (0)
4474#define TEST_LCIDLANG(a,b) LCID_RES(MAKELCID(a,b), MAKELCID(a,b))
4475#define TEST_LCID(a,b,c) LCID_RES(MKLCID(a,b,c), MKLCID(a,b,c))
4480 static const struct {
WORD lang, sublang; } nondefault_langs[] =
4503 "Expected lcid = %08lx got %08lx\n",
4508 "Expected lcid = %08lx got %08lx\n",
4522 "Expected lcid = %08x got %08lx\n",
4565 "wrong lcid %04lx\n",
lcid );
4577 trace(
"%08lx, %s, %s, %08lx, %08Ix\n",
4581 "Enumerated grp %ld not valid (flags %ld)\n", lgrpid,
dwFlags);
4585 "Expected dwFlags == LGRPID_INSTALLED || dwFlags == LGRPID_SUPPORTED, got %ld\n",
dwFlags);
4594 if (!pEnumSystemLanguageGroupsA || !pIsValidLanguageGroup)
4596 win_skip(
"EnumSystemLanguageGroupsA and/or IsValidLanguageGroup are not available\n");
4605 win_skip(
"EnumSystemLanguageGroupsA is not implemented\n");
4609 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
4635 ok(
FALSE,
"EnumSystemLocalesA callback received unparsable LCID string \"%s\"\n",
str);
4678 if (!pEnumSystemLocalesA)
4680 win_skip(
"EnumSystemLocalesA not available");
4688 ok(
default_seen,
"EnumSystemLocalesA(..., 0) returned 0 locales "
4689 "with default sort order, expected > 0\n");
4697 ok(
default_seen,
"EnumSystemLocalesA(..., LCID_INSTALLED) returned 0 locales "
4698 "with default sort order, expected > 0\n");
4699 ok(!
alternate_seen,
"EnumSystemLocalesA(..., LCID_INSTALLED) returned %ld locales "
4706 ok(
default_seen,
"EnumSystemLocalesA(..., LCID_SUPPORTED) returned 0 locales "
4707 "with default sort order, expected > 0\n");
4708 ok(!
alternate_seen,
"EnumSystemLocalesA(..., LCID_SUPPORTED) returned %ld locales "
4715 ok(
alternate_seen,
"EnumSystemLocalesA(..., LCID_ALTERNATE_SORTS) returned 0 locales "
4716 "with alternate sort order, expected > 0\n");
4717 ok(!
default_seen,
"EnumSystemLocalesA(..., LCID_ALTERNATE_SORTS) returned %ld locales "
4724 ok(
default_seen,
"EnumSystemLocalesA(..., LCID_INSTALLED | LCID_ALTERNATE_SORTS) returned 0 locales "
4725 "with default sort order, expected > 0\n");
4726 ok(
alternate_seen,
"EnumSystemLocalesA(..., LCID_INSTALLED | LCID_ALTERNATE_SORTS) returned 0 locales "
4727 "with alternate sort order, expected > 0\n");
4733 ok(
default_seen,
"EnumSystemLocalesA(..., LCID_SUPPORTED | LCID_ALTERNATE_SORTS) returned 0 locales "
4734 "with default sort order, expected > 0\n");
4735 ok(
alternate_seen,
"EnumSystemLocalesA(..., LCID_SUPPORTED | LCID_ALTERNATE_SORTS) returned 0 locales "
4736 "with alternate sort order, expected > 0\n");
4741 if (!pEnumSystemLocalesW)
4743 win_skip(
"EnumSystemLocalesW not available");
4751 ok(
default_seen,
"EnumSystemLocalesW(..., 0) returned 0 locales "
4752 "with default sort order, expected > 0\n");
4760 ok(
default_seen,
"EnumSystemLocalesW(..., LCID_INSTALLED) returned 0 locales "
4761 "with default sort order, expected > 0\n");
4762 ok(!
alternate_seen,
"EnumSystemLocalesW(..., LCID_INSTALLED) returned %ld locales "
4769 ok(
default_seen,
"EnumSystemLocalesW(..., LCID_SUPPORTED) returned 0 locales "
4770 "with default sort order, expected > 0\n");
4771 ok(!
alternate_seen,
"EnumSystemLocalesW(..., LCID_SUPPORTED) returned %ld locales "
4778 ok(
alternate_seen,
"EnumSystemLocalesW(..., LCID_ALTERNATE_SORTS) returned 0 locales "
4779 "with alternate sort order, expected > 0\n");
4780 ok(!
default_seen,
"EnumSystemLocalesW(..., LCID_ALTERNATE_SORTS) returned %ld locales "
4787 ok(
default_seen,
"EnumSystemLocalesW(..., LCID_INSTALLED | LCID_ALTERNATE_SORTS) returned 0 locales "
4788 "with default sort order, expected > 0\n");
4789 ok(
alternate_seen,
"EnumSystemLocalesW(..., LCID_INSTALLED | LCID_ALTERNATE_SORTS) returned 0 locales "
4790 "with alternate sort order, expected > 0\n");
4796 ok(
default_seen,
"EnumSystemLocalesW(..., LCID_SUPPORTED | LCID_ALTERNATE_SORTS) returned 0 locales "
4797 "with default sort order, expected > 0\n");
4798 ok(
alternate_seen,
"EnumSystemLocalesW(..., LCID_SUPPORTED | LCID_ALTERNATE_SORTS) returned 0 locales "
4799 "with alternate sort order, expected > 0\n");
4813 if (!pEnumSystemLocalesEx)
4815 win_skip(
"EnumSystemLocalesEx not available\n" );
4820 ok( !
ret,
"should have failed\n" );
4838 "Enumerated grp %ld not valid\n", lgrpid);
4840 "Enumerated grp locale %04lx not valid\n",
lcid);
4848 if (!pEnumLanguageGroupLocalesA || !pIsValidLanguageGroup)
4850 win_skip(
"EnumLanguageGroupLocalesA and/or IsValidLanguageGroup are not available\n");
4859 win_skip(
"EnumLanguageGroupLocalesA is not implemented\n");
4863 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
4869 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
4875 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
4881 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
4896 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
4901 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
4906 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
4908 for (
i = 0;
i <= 0x1014;
i++)
4920 case LOCALE_IDIGITSUBSTITUTION:
4927 case LOCALE_IPAPERSIZE:
4948 case LOCALE_SYEARMONTH:
4956 ok( !bRet,
"%04x: succeeded\n",
i );
4972 ok(!
enumCount,
"callback called again unexpected\n");
4979 ok(0,
"callback called unexpected\n");
4986 if (!pEnumUILanguagesA) {
4987 win_skip(
"EnumUILanguagesA is not available on Win9x or NT4\n");
4995 win_skip(
"EnumUILanguagesA is not implemented\n");
5022 ret = pEnumUILanguagesA(
NULL, 0, 0);
5023 ok(!
ret,
"Expected return value FALSE, got %u\n",
ret);
5025 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
5029 ok(!
ret,
"Expected return value FALSE, got %u\n",
ret);
5033 ret = pEnumUILanguagesA(
NULL, 0x5a5a5a5a, 0);
5034 ok(!
ret,
"Expected return value FALSE, got %u\n",
ret);
5036 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
5066 win_skip(
"0 for dwFlags is not supported\n");
5084 win_skip(
"LOCALE_USE_CP_ACP is not supported\n");
5122 win_skip(
"DATE_YEARMONTH is only present on W2K and later\n");
5188 win_skip(
"EnumTimeFormatsW doesn't support TIME_NOSECONDS\n");
5222 ok(!
ret,
"GetCPInfo(CP_SYMBOL) should fail\n");
5224 "expected ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
5231 win_skip(
"Codepage CP_UTF7 is not installed/available\n");
5241 ok(!cpinfo.
LeadByte[
i],
"expected NUL byte in index %u\n",
i);
5244 memset( &cpiw, 0xcc,
sizeof(cpiw) );
5267 win_skip(
"Codepage CP_UTF8 is not installed/available\n");
5277 ok(!cpinfo.
LeadByte[
i],
"expected NUL byte in index %u\n",
i);
5280 memset( &cpiw, 0xcc,
sizeof(cpiw) );
5301 ok( !
ret,
"GetCPInfoExW succeeeded\n" );
5304#if defined(__REACTOS__) && DLL_EXPORT_VERSION >= 0x600
5308 if (pNtGetNlsSectionPtr)
5317 for (
i = 0;
i < 100;
i++)
5327 "%u: failed %lx\n",
i,
status );
5331 "%u: failed %lx\n",
i,
status );
5340 "%u: failed %lx\n",
i,
status );
5354 ok(
size > 0x1000 &&
size <= 0x8000 ,
"wrong size %Ix\n",
size );
5357 ok(
ptr != ptr2,
"got same pointer\n" );
5366 ptr = (
void *)0xdeadbeef;
5370 ok(
size > 0x10000 &&
size <= 0x20000,
"wrong size %Ix\n",
size );
5372 if (pRtlInitCodePageTable)
5374 pRtlInitCodePageTable(
ptr, &
table );
5375 ok(
table.CodePage == 437,
"wrong codepage %u\n",
table.CodePage );
5376 ok(
table.MaximumCharacterSize == 1,
"wrong char size %u\n",
table.MaximumCharacterSize );
5377 ok(
table.DefaultChar ==
'?',
"wrong default char %x\n",
table.DefaultChar );
5378 ok( !
table.DBCSCodePage,
"wrong dbcs %u\n",
table.DBCSCodePage );
5385 ok(
size > 0x30000 &&
size <= 0x40000,
"wrong size %Ix\n",
size );
5387 if (pRtlInitCodePageTable)
5389 pRtlInitCodePageTable(
ptr, &
table );
5390 ok(
table.CodePage == 936,
"wrong codepage %u\n",
table.CodePage );
5391 ok(
table.MaximumCharacterSize == 2,
"wrong char size %u\n",
table.MaximumCharacterSize );
5392 ok(
table.DefaultChar ==
'?',
"wrong default char %x\n",
table.DefaultChar );
5395 if (pRtlCustomCPToUnicodeN)
5397 static const unsigned char buf[] = { 0xbf, 0xb4, 0xc7, 0, 0x78 };
5398 static const WCHAR expect[][4] = { { 0xcccc, 0xcccc, 0xcccc, 0xcccc },
5399 { 0x0000, 0xcccc, 0xcccc, 0xcccc },
5400 { 0x770b, 0xcccc, 0xcccc, 0xcccc },
5401 { 0x770b, 0x0000, 0xcccc, 0xcccc },
5402 { 0x770b, 0x003f, 0xcccc, 0xcccc },
5403 { 0x770b, 0x003f, 0x0078, 0xcccc } };
5407 for (
i = 0;
i <=
sizeof(
buf);
i++)
5409 memset( wbuf, 0xcc,
sizeof(wbuf) );
5410 pRtlCustomCPToUnicodeN( &
table, wbuf,
sizeof(wbuf), &
reslen, (
char *)
buf,
i );
5411 for (
j = 0;
j < 4;
j++)
if (
expect[
i][
j] == 0xcccc)
break;
5413 for (
j = 0;
j < 4;
j++)
5414 ok( wbuf[
j] ==
expect[
i][
j],
"%lu: char %lu got %04x\n",
i,
j, wbuf[
j] );
5423 "failed %lx\n",
status );
5425 if (pRtlInitCodePageTable)
5432 if (
table.MaximumCharacterSize)
5434 ok(
table.MaximumCharacterSize == 4,
"wrong char size %u\n",
table.MaximumCharacterSize );
5435 ok(
table.DefaultChar ==
'?',
"wrong default char %x\n",
table.DefaultChar );
5436 ok(
table.UniDefaultChar == 0xfffd,
"wrong default char %x\n",
table.UniDefaultChar );
5437 ok(
table.TransDefaultChar ==
'?',
"wrong default char %x\n",
table.TransDefaultChar );
5438 ok(
table.TransUniDefaultChar ==
'?',
"wrong default char %x\n",
table.TransUniDefaultChar );
5439 ok( !
table.DBCSCodePage,
"wrong dbcs %u\n",
table.DBCSCodePage );
5440 ok( !
table.MultiByteTable,
"wrong mbtable %p\n",
table.MultiByteTable );
5441 ok( !
table.WideCharTable,
"wrong wctable %p\n",
table.WideCharTable );
5442 ok( !
table.DBCSRanges,
"wrong ranges %p\n",
table.DBCSRanges );
5443 ok( !
table.DBCSOffsets,
"wrong offsets %p\n",
table.DBCSOffsets );
5445 else win_skip(
"utf-8 codepage not supported\n" );
5450 for (
i = 0;
i < 100;
i++)
5462 ok(
size > 0x8000 &&
size <= 0x30000 ,
"wrong size %Ix\n",
size );
5472 else win_skip(
"NtGetNlsSectionPtr not supported\n" );
5484 static const WCHAR blanks[] = {0x9, 0x20, 0xa0, 0x3000, 0xfeff};
5496 static const WCHAR undefined[] = {0x378, 0x379, 0x5ff, 0xfff8, 0xfffe};
5499 static const WCHAR alpha[] = {0x47, 0x67, 0x1c5};
5506 static const WCHAR oldpunc[] = { 0x2c2, 0x2e5, 0x322, 0x482, 0x6de,
5508 0xffe0, 0xffe9, 0x2153};
5511 static const WCHAR changed[] = {0x2b0, 0x2160, 0x600, 0xad, 0x1f88, 0x294, 0x903};
5529 static const WCHAR punct[] = { 0x5f, 0x2d, 0x28, 0x29, 0xab, 0xbb, 0x21 };
5531 static const WCHAR punct_special[] = {0x24, 0x2b, 0x3c, 0x3e, 0x5e, 0x60,
5532 0x7c, 0x7e, 0xa2, 0xbe, 0xd7, 0xf7};
5533 static const WCHAR digit_special[] = {0xb2, 0xb3, 0xb9};
5534 static const WCHAR lower_special[] = {0x2071, 0x207f};
5535 static const WCHAR cntrl_special[] = {0x070f, 0x200c, 0x200d,
5536 0x200e, 0x200f, 0x202a, 0x202b, 0x202c, 0x202d, 0x202e,
5537 0x206a, 0x206b, 0x206c, 0x206d, 0x206e, 0x206f, 0xfeff,
5538 0xfff9, 0xfffa, 0xfffb};
5539 static const WCHAR space_special[] = {0x09, 0x0d, 0x85};
5540 static const WCHAR alpha_thai[] = {0xe31, 0xe34, 0xe35, 0xe36, 0xe37, 0xe38, 0xe39, 0xe3a,
5541 0xe47, 0xe48, 0xe49, 0xe4a, 0xe4b, 0xe4c, 0xe4d, 0xe4e,
5567 for (
i = 0;
i < 5;
i++)
5572 for (
i = 0;
i < 3;
i++)
5576 for (
i = 0;
i < 5;
i++)
5581 for (
i = 0;
i < 8;
i++)
5586 for (
i = 0;
i < 7;
i++)
5591 for (
i = 0;
i < 7;
i++)
5597 for (
i = 0;
i < 12;
i++)
5602 for (
i = 0;
i < 3;
i++)
5607 for (
i = 0;
i < 2;
i++)
5612 for (
i = 0;
i < 20;
i++)
5617 for (
i = 0;
i < 3;
i++)
5623 for (
i = 0;
i < 18;
i++)
5631 win_skip(
"C3_HIGHSURROGATE/C3_LOWSURROGATE are not supported.\n");
5650 for (
ch[0] = 0x600;
ch[0] <= 0x6ff;
ch[0] += 1)
5675 { 5,
L"test", 0, 5, 5,
L"test" },
5678 { 1,
L"T", 0, 1, 1,
L"T" },
5681 { 6,
L" -/[]", 0, 6, 6,
L" -/[]" },
5682 { 3,
L"a-a", IDN_USE_STD3_ASCII_RULES, 3, 3,
L"a-a" },
5683 { 3,
L"aa-", IDN_USE_STD3_ASCII_RULES, 0, 0,
L"aa-" },
5684 { -1,
L"T\xdf\x130\x143\x37a\x6a\x30c \xaa", 0, 12, 12,
L"tssi\x307\x144 \x3b9\x1f0 a" },
5686 { 11,
L"t\xad\x34f\x2066\x180b\x180c\x180d\x200b\x200c\x200d", 0, 0, 2,
L"t",
5690 { 2, {0x3b0}, 0, 2, 2, {0x3b0} },
5691 { 2, {0x380}, 0, 0, 2, {0x380} },
5692 { 2, {0x380}, IDN_ALLOW_UNASSIGNED, 2, 2, {0x380} },
5693 { 5,
L"a..a", 0, 0, 0,
L"a..a" },
5694 { 3,
L"a.", 0, 3, 3,
L"a." },
5696 { 5,
L"T.\x105.A", 0, 5, 5,
L"t.\x105.a" },
5697 { 5,
L"T.*.A", 0, 5, 5,
L"T.*.A" },
5698 { 5,
L"X\xff0e.Z", 0, 0, 0,
L"x..z" },
5699 { 63,
L"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 0,
5700 63, 63,
L"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" },
5701 { 64,
L"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 0,
5702 0, 0,
L"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" },
5723 ok(
err == 0xdeadbeef,
"err = %ld\n",
err);
5737 ret = pIdnToNameprepUnicode(IDN_ALLOW_UNASSIGNED|IDN_USE_STD3_ASCII_RULES,
5752 "err = %ld\n",
err);
5769 if (pRtlNormalizeString)
5776 "%ld: failed %lx\n",
i,
status );
5793 { 5,
L"Test", 0, 5, 5,
L"Test" },
5794 { 5,
L"Te\x017cst", 0, 12, 12,
L"xn--test-cbb" },
5795 { 12,
L"te\x0105st.te\x017cst", 0, 26, 26,
L"xn--test-cta.xn--test-cbb" },
5796 { 3, {0x0105,
'.',0}, 0, 9, 9,
L"xn--2da." },
5797 { 10,
L"http://t\x106", 0, 17, 17,
L"xn--http://t-78a" },
5799 { -1,
L"\x4e3a\x8bf4\x4e0d\x4ed6\x5011\x10d\x11b\x305c\x306a", 0,
5800 35, 35,
L"xn--bea2a1631avbav44tyha32b91egs2t" },
5801 { 2,
L"\x380", IDN_ALLOW_UNASSIGNED, 8, 8,
L"xn--7va" },
5802 { 63,
L"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 0,
5803 63, 63,
L"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" },
5804 { 64,
L"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 0, 0 },
5805 { -1,
L"\xe4z123456789012345678901234567890123456789012345678901234", 0,
5806 64, 64,
L"xn--z123456789012345678901234567890123456789012345678901234-9te" },
5808 { -1,
L"\xd803\xde78\x46b5-\xa861.\x2e87", 0, 28, 0,
L"xn----bm3an932a1l5d.xn--xvj" },
5809 { -1,
L"\x06ef\x06ef", 0, 9, 0,
L"xn--cmba" },
5810 { -1,
L"-\x07e1\xff61\x2184", 0, 18, 0,
L"xn----8cd.xn--r5g" },
5838 { 5,
L"Tes.", 0, 5, 5,
L"Tes." },
5839 { 2,
L"\x105", 0, 0 },
5840 { 33,
L"xn--4dbcagdahymbxekheh6e0a7fei0b", 0,
5841 23, 23,
L"\x05dc\x05de\x05d4\x05d4\x05dd\x05e4\x05e9\x05d5\x05d8\x05dc\x05d0\x05de\x05d3\x05d1\x05e8\x05d9\x05dd\x05e2\x05d1\x05e8\x05d9\x05ea" },
5842 { 34,
L"test.xn--kda9ag5e9jnfsj.xn--pz-fna", 0,
5843 16, 16,
L"test.\x0105\x0119\x015b\x0107\x0142\x00f3\x017c.p\x0119z" },
5844 { 63,
L"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 0,
5845 63, 63,
L"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" },
5847 { 64,
L"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 0, 0 },
5848 { 8,
L"xn--7va", IDN_ALLOW_UNASSIGNED, 2, 2,
L"\x380" },
5849 { 8,
L"xn--7va", 0, 0, 0,
L"\x380" },
5850 { -1,
L"xn----bm3an932a1l5d.xn--xvj", 0, 8, 0,
L"\xd803\xde78\x46b5-\xa861.\x2e87" },
5851 { -1,
L"xn--z123456789012345678901234567890123456789012345678901234-9te", 0,
5852 57, 57,
L"\xe4z123456789012345678901234567890123456789012345678901234" },
5854 { -1,
L"foo.bar", 0, 8, 8,
L"foo.bar" },
5855 { -1,
L"d.xn----dha", 0, 5, 5,
L"d.\x00fc-" },
5881 if (*
p ==
'B' || !
wcscmp(
p,
L"V8" ))
continue;
5893#if defined(__REACTOS__) && DLL_EXPORT_VERSION >= 0x600
5895 if (
is_reactos() || !pIdnToAscii || !pIdnToUnicode || !pIdnToNameprepUnicode)
5897 if (!pIdnToAscii || !pIdnToUnicode || !pIdnToNameprepUnicode)
5900 win_skip(
"Idn support is not available\n");
5911 if ((
f =
fopen(
"IdnaTestV2.txt",
"r" )))
5922 for (
i = 0;
i < 7 &&
p;
i++)
5924 while (*
p ==
' ')
p++;
5930 if (
i < 7)
continue;
5944 ok(
ret,
"line %u: toAscii failed for %s expected %s\n",
line,
5951 ok( !
ret,
"line %u: toAscii didn't fail for %s got %s expected error %s\n",
5961 for (
i = 0; columns[0][
i];
i++)
if (columns[0][
i] > 0x7f)
break;
5964 ok( !
ret,
"line %u: didn't fail for unicode chars in %s\n",
line,
debugstr_w(columns[0]) );
5968 ok(
ret,
"line %u: toUnicode failed for %s expected %s\n",
line,
5975 ok( !
ret,
"line %u: toUnicode didn't fail for %s got %s expected error %s\n",
5986 static const WCHAR enW[] = {
'e',
'n',0};
5987 WCHAR bufferW[80], buffer2[80];
5992 win_skip(
"GetLocaleInfoEx not supported\n");
6000 static const WCHAR statesW[] = {
'U',
'n',
'i',
't',
'e',
'd',
' ',
'S',
't',
'a',
't',
'e',
's',0};
6001 static const WCHAR dummyW[] = {
'd',
'u',
'm',
'm',
'y',0};
6002 static const WCHAR enusW[] = {
'e',
'n',
'-',
'U',
'S',0};
6003 static const WCHAR usaW[] = {
'U',
'S',
'A',0};
6004 static const WCHAR enuW[] = {
'E',
'N',
'U',0};
6048 skip(
"Non-English locale\n");
6058#if defined(__REACTOS__) && defined(_WIN64)
6060 ok(
FALSE,
"FIXME: These tests crash on ReactOS x64\n");
6080#if defined(__REACTOS__) && defined(_WIN64)
6090 if (!pIsValidLocaleName)
6092 win_skip(
"IsValidLocaleName not supported\n");
6096 ret = pIsValidLocaleName(
L"en-US");
6097 ok(
ret,
"IsValidLocaleName failed\n");
6098 ret = pIsValidLocaleName(
L"en");
6102 ok(
ret,
"IsValidLocaleName failed\n");
6104 ret = pIsValidLocaleName(
L"es-es");
6105 ok(
ret,
"IsValidLocaleName failed\n");
6106 ret = pIsValidLocaleName(
L"de-DE_phoneb");
6107 ok(
ret,
"IsValidLocaleName failed\n");
6108 ret = pIsValidLocaleName(
L"DE_de-phoneb");
6110 ret = pIsValidLocaleName(
L"DE_de_PHONEB");
6112 ret = pIsValidLocaleName(
L"DE_de+phoneb");
6113 ok(!
ret,
"IsValidLocaleName should have failed\n");
6114 ret = pIsValidLocaleName(
L"zz");
6115 ok(!
ret ||
broken(
ret),
"IsValidLocaleName should have failed\n");
6116 ret = pIsValidLocaleName(
L"zz-ZZ");
6117 ok(!
ret ||
broken(
ret),
"IsValidLocaleName should have failed\n");
6118 ret = pIsValidLocaleName(
L"zzz");
6119 ok(!
ret ||
broken(
ret),
"IsValidLocaleName should have failed\n");
6120 ret = pIsValidLocaleName(
L"zzz-ZZZ");
6121 ok(!
ret,
"IsValidLocaleName should have failed\n");
6122 ret = pIsValidLocaleName(
L"zzzz");
6123 ok(!
ret,
"IsValidLocaleName should have failed\n");
6124 ret = pIsValidLocaleName(LOCALE_NAME_INVARIANT);
6125 ok(
ret,
"IsValidLocaleName failed\n");
6127 ok(!
ret,
"IsValidLocaleName should have failed\n");
6128 ret = pIsValidLocaleName(LOCALE_NAME_SYSTEM_DEFAULT);
6129 ok(!
ret,
"IsValidLocaleName should have failed\n");
6131 if (!pRtlIsValidLocaleName)
6133 win_skip(
"RtlIsValidLocaleName not available\n" );
6137 ret = pRtlIsValidLocaleName(
L"en-US", 0 );
6138 ok(
ret,
"RtlIsValidLocaleName failed\n");
6139 ret = pRtlIsValidLocaleName(
L"en", 0 );
6140 ok(!
ret,
"RtlIsValidLocaleName should have failed\n");
6141 ret = pRtlIsValidLocaleName(
L"en", 1 );
6142 ok(!
ret,
"RtlIsValidLocaleName should have failed\n");
6143 ret = pRtlIsValidLocaleName(
L"en", 2 );
6144 ok(
ret,
"RtlIsValidLocaleName failed\n");
6145 ret = pRtlIsValidLocaleName(
L"en-RR", 2 );
6146 ok(!
ret,
"RtlIsValidLocaleName should have failed\n");
6147 ret = pRtlIsValidLocaleName(
L"es-es", 0 );
6148 ok(
ret,
"RtlIsValidLocaleName failed\n");
6149 ret = pRtlIsValidLocaleName(
L"de-DE_phoneb", 0 );
6150 ok(
ret,
"RtlIsValidLocaleName failed\n");
6151 ret = pRtlIsValidLocaleName(
L"DE_de_PHONEB", 0 );
6153 ret = pRtlIsValidLocaleName(
L"DE_de+phoneb", 0 );
6154 ok(!
ret,
"RtlIsValidLocaleName should have failed\n");
6155 ret = pRtlIsValidLocaleName(
L"zz", 0 );
6156 ok(!
ret,
"RtlIsValidLocaleName should have failed\n");
6157 ret = pRtlIsValidLocaleName(
L"zz", 2 );
6158 ok(!
ret,
"RtlIsValidLocaleName should have failed\n");
6159 ret = pRtlIsValidLocaleName(
L"zz-ZZ", 0 );
6160 ok(!
ret,
"RtlIsValidLocaleName should have failed\n");
6161 ret = pRtlIsValidLocaleName(
L"zzz", 0 );
6162 ok(!
ret,
"RtlIsValidLocaleName should have failed\n");
6163 ret = pRtlIsValidLocaleName(
L"zzz-ZZZ", 0 );
6164 ok(!
ret,
"RtlIsValidLocaleName should have failed\n");
6165 ret = pRtlIsValidLocaleName(
L"zzzz", 0 );
6166 ok(!
ret,
"RtlIsValidLocaleName should have failed\n");
6167 ret = pRtlIsValidLocaleName( LOCALE_NAME_INVARIANT, 0 );
6168 ok(
ret,
"RtlIsValidLocaleName failed\n");
6170 ok(!
ret,
"RtlIsValidLocaleName should have failed\n");
6171 ret = pRtlIsValidLocaleName( LOCALE_NAME_SYSTEM_DEFAULT, 0 );
6172 ok(!
ret,
"RtlIsValidLocaleName should have failed\n");
6179 {
L"en-US",
L"en-US" },
6180 {
L"en",
L"en-US" },
6181 {
L"en-RR",
L"en-US" },
6182 {
L"en-na",
L"en-NA",
TRUE },
6183 {
L"EN-zz",
L"en-US" },
6184 {
L"en-US",
L"en-US" },
6185 {
L"de-DE_phoneb",
L"de-DE" },
6186 {
L"DE-de-phoneb",
L"de-DE" },
6187 {
L"fr-029",
L"fr-029",
TRUE },
6188 {
L"fr-CH_XX",
L"fr-CH",
TRUE },
6189 {
L"fr-CHXX",
L"fr-FR" },
6190 {
L"zh",
L"zh-CN" },
6191 {
L"zh-Hant",
L"zh-HK" },
6192 {
L"zh-hans",
L"zh-CN" },
6193 {
L"ja-jp_radstr",
L"ja-JP" },
6194 {
L"az",
L"az-Latn-AZ" },
6195 {
L"uz",
L"uz-Latn-UZ" },
6196 {
L"uz-cyrl",
L"uz-Cyrl-UZ" },
6197 {
L"ia",
L"ia-001",
TRUE },
6199 {
L"zzz-ZZZ",
L"" },
6203 { LOCALE_NAME_INVARIANT,
L"" },
6206#if !defined(__REACTOS__) || DLL_EXPORT_VERSION >= 0x600
6212 if (!pResolveLocaleName)
6214 win_skip(
"ResolveLocaleName not available\n" );
6245#if !defined(__REACTOS__) || DLL_EXPORT_VERSION >= 0x600
6247#if !(defined(__REACTOS__) && defined(_WIN64))
6254 ret = pResolveLocaleName(
L"en-US",
buffer, 4 );
6260 ret = pResolveLocaleName(
L"en-US",
NULL, 0 );
6271 WCHAR null1[] = {
'a',0,
'a',0 };
6272 WCHAR null2[] = {
'a',0,
'b',0 };
6273 WCHAR bills1[] = {
'b',
'i',
'l',
'l',
'\'',
's',0 };
6274 WCHAR bills2[] = {
'b',
'i',
'l',
'l',
's',0 };
6275 WCHAR coop1[] = {
'c',
'o',
'-',
'o',
'p',0 };
6276 WCHAR coop2[] = {
'c',
'o',
'o',
'p',0 };
6277 WCHAR nonascii1[] = { 0x0102,0 };
6278 WCHAR nonascii2[] = { 0x0201,0 };
6281 if (!pCompareStringOrdinal)
6283 win_skip(
"CompareStringOrdinal not supported\n");
6290 ok(!
ret,
"Got %u, expected 0\n",
ret);
6294 ok(!
ret,
"Got %u, expected 0\n",
ret);
6298 ok(!
ret,
"Got %u, expected 0\n",
ret);
6318 ret = pCompareStringOrdinal(null1, 3, null2, 3,
FALSE);
6320 ret = pCompareStringOrdinal(null1, 3, null2, 3,
TRUE);
6328 ret = pCompareStringOrdinal(bills1, -1, bills2, -1,
FALSE);
6330 ret = pCompareStringOrdinal(coop2, -1, coop1, -1,
FALSE);
6332 ret = pCompareStringOrdinal(nonascii1, -1, nonascii2, -1,
FALSE);
6334 ret = pCompareStringOrdinal(nonascii1, -1, nonascii2, -1,
TRUE);
6337 for (ch1 = 0; ch1 < 512; ch1++)
6339 for (ch2 = 0; ch2 < 1024; ch2++)
6341 int diff = ch1 - ch2;
6342 ret = pCompareStringOrdinal( &ch1, 1, &ch2, 1,
FALSE );
6344 "wrong result %d %04x %04x\n",
ret, ch1, ch2 );
6345 diff = pRtlUpcaseUnicodeChar( ch1 ) - pRtlUpcaseUnicodeChar( ch2 );
6346 ret = pCompareStringOrdinal( &ch1, 1, &ch2, 1,
TRUE );
6348 "wrong result %d %04x %04x\n",
ret, ch1, ch2 );
6361 win_skip(
"GetGeoInfo is not available.\n");
6380 ok(!
strcmp(buffA,
"RU"),
"got %s\n", buffA);
6387 ok(buffA[0] ==
'a',
"got %c\n", buffA[0]);
6391 ok(!
strcmp(buffA,
"RUS"),
"got %s\n", buffA);
6395 buffA[1] = buffA[2] = 0;
6398 ok(!
strcmp(buffA,
"RU"),
"got %s\n", buffA);
6403 ok(
ret == 4,
"GEO_NATION of nation: expected 4, got %d\n",
ret);
6404 ok(!
strcmp(buffA,
"203"),
"GEO_NATION of nation: expected 203, got %s\n", buffA);
6408 ok(
ret == 0,
"GEO_NATION of region: expected 0, got %d\n",
ret);
6409 ok(*buffA == 0,
"GEO_NATION of region: expected empty string, got %s\n", buffA);
6415 "GEO_NATION of LOCATION_BOTH: expected 0, got %d\n",
ret);
6418 "GEO_NATION of LOCATION_BOTH: expected empty string, got %s\n", buffA);
6422 ret = pGetGeoInfoA(203,
GEO_ID, buffA, 20, 0);
6424 win_skip(
"GEO_ID not supported.\n");
6427 ok(
ret == 4,
"GEO_ID: expected 4, got %d\n",
ret);
6428 ok(!
strcmp(buffA,
"203"),
"GEO_ID: expected 203, got %s\n", buffA);
6430 ret = pGetGeoInfoA(47610,
GEO_ID, buffA, 20, 0);
6432 ok(!
strcmp(buffA,
"47610"),
"got %s\n", buffA);
6434 ret = pGetGeoInfoA(333,
GEO_ID, buffA, 20, 0);
6436 ok(!
strcmp(buffA,
"333"),
"got %s\n", buffA);
6443 win_skip(
"GEO_PARENT not supported.\n");
6447 ok(!
strcmp(buffA,
"47609"),
"got %s\n", buffA);
6453 win_skip(
"GEO_ISO_UN_NUMBER not supported.\n");
6457 ok(!
strcmp(buffA,
"643"),
"got %s\n", buffA);
6469 win_skip(
"GetGeoInfoEx is not available\n");
6476 ok(!
wcscmp(buffW,
L"ARG"),
"expected string to be ARG, got %ls\n", buffW);
6481 ok(
ret == 0,
"expected GetGeoInfoEx to fail.\n");
6483 "expected ERROR_INVALID_PARAMETER got %ld.\n",
GetLastError());
6488 ok(!
wcscmp(buffW,
L"11"),
"expected string to be 11, got %ls\n", buffW);
6493 ok(
ret == 0,
"expected GetGeoInfoEx to fail.\n");
6495 "expected ERROR_INVALID_PARAMETER got %ld.\n",
GetLastError());
6502 ok(
ret == 3,
"got %d for %ld\n",
ret, geoid);
6504 ok(geoid >= 2,
"got geoid %ld\n", geoid);
6519 if (!pEnumSystemGeoID)
6521 win_skip(
"EnumSystemGeoID is not available.\n");
6547 win_skip(
"Parent GEOID is not supported in EnumSystemGeoID.\n");
6554 win_skip(
"GEOCLASS_REGION is not supported in EnumSystemGeoID.\n");
6567 win_skip(
"GEOCLASS_ALL is not supported in EnumSystemGeoID.\n");
6686 {
X(LOCALE_IDEFAULTEBCDICCODEPAGE),
"037" },
6687 {
X(LOCALE_IPAPERSIZE),
"9" },
6688 {
X(LOCALE_SENGCURRNAME),
"International Monetary Fund" },
6689 {
X(LOCALE_SNATIVECURRNAME),
"International Monetary Fund" },
6690 {
X(LOCALE_SYEARMONTH),
"yyyy MMMM" },
6691 {
X(LOCALE_IDIGITSUBSTITUTION),
"1" },
6693 {
X(LOCALE_SSCRIPTS),
"Latn;" },
6707 win_skip(
"GetLocaleInfoA(LOCALE_INVARIANT) not supported\n");
6720 "For id %d, expected ret == %d, got %d, error %ld\n",
6723 "For id %d, Expected %s, got '%s'\n",
6733 skip(
"Non US-English locale\n");
6738 static const char lang[] =
"Invariant Language (Invariant Country)";
6739 static const char cntry[] =
"Invariant Country";
6740 static const char sortm[] =
"Math Alphanumerics";
6741 static const char sortms[] =
"Maths Alphanumerics";
6742 static const char sortd[] =
"Default";
6767 if (!pGetSystemPreferredUILanguages)
6769 win_skip(
"GetSystemPreferredUILanguages is not available.\n");
6778 ok(
ret,
"Expected GetSystemPreferredUILanguages to succeed\n");
6779 ok(
count,
"Expected count > 0\n");
6780 ok(
size % 6 == 1,
"Expected size (%ld) %% 6 == 1\n",
size);
6784 ret = pGetSystemPreferredUILanguages(MUI_FULL_LANGUAGE, &
count,
NULL, &
size);
6785 ok(!
ret,
"Expected GetSystemPreferredUILanguages to fail\n");
6787 "Expected error ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
6791 ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID | MUI_FULL_LANGUAGE, &
count,
NULL, &
size);
6792 ok(!
ret,
"Expected GetSystemPreferredUILanguages to fail\n");
6794 "Expected error ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
6798 ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID | MUI_LANGUAGE_NAME, &
count,
NULL, &
size);
6799 ok(!
ret,
"Expected GetSystemPreferredUILanguages to fail\n");
6801 "Expected error ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
6806 ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID | MUI_MACHINE_LANGUAGE_SETTINGS, &
count,
NULL, &
size);
6807 ok(
ret,
"Expected GetSystemPreferredUILanguages to succeed\n");
6808 ok(
count,
"Expected count > 0\n");
6809 ok(
size % 5 == 1,
"Expected size (%ld) %% 5 == 1\n",
size);
6814 ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_NAME | MUI_MACHINE_LANGUAGE_SETTINGS, &
count,
NULL, &
size);
6815 ok(
ret,
"Expected GetSystemPreferredUILanguages to succeed\n");
6816 ok(
count,
"Expected count > 0\n");
6817 ok(
size % 6 == 1,
"Expected size (%ld) %% 6 == 1\n",
size);
6827 ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &
count,
NULL, &
size);
6828 ok(!
ret,
"Expected GetSystemPreferredUILanguages to fail\n");
6830 "Expected error ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
6840 ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &
count,
NULL, &size_id);
6841 ok(
ret,
"Expected GetSystemPreferredUILanguages to succeed\n");
6842 ok(
count,
"Expected count > 0\n");
6843 ok(size_id % 5 == 1,
"Expected size (%ld) %% 5 == 1\n", size_id);
6848 ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_NAME, &
count,
NULL, &size_name);
6849 ok(
ret,
"Expected GetSystemPreferredUILanguages to succeed\n");
6850 ok(
count,
"Expected count > 0\n");
6851 ok(size_name % 6 == 1,
"Expected size (%ld) %% 6 == 1\n", size_name);
6853 size_buffer =
max(size_id, size_name);
6856 skip(
"No valid buffer size\n");
6863 skip(
"Failed to allocate memory for %ld chars\n", size_buffer);
6872 ok(
ret,
"Expected GetSystemPreferredUILanguages to succeed\n");
6873 ok(
count,
"Expected count > 0\n");
6874 ok(
size % 6 == 1,
"Expected size (%ld) %% 6 == 1\n",
size);
6877 "Expected last two WCHARs being empty, got 0x%x 0x%x\n",
6885 ok(
ret,
"Expected GetSystemPreferredUILanguages to succeed\n");
6886 ok(
count,
"Expected count > 0\n");
6887 ok(
size % 5 == 1,
"Expected size (%ld) %% 5 == 1\n",
size);
6890 "Expected last two WCHARs being empty, got 0x%x 0x%x\n",
6901 ok(
ret,
"Expected GetSystemPreferredUILanguages to succeed\n");
6902 ok(
count,
"Expected count > 0\n");
6903 ok(
size % 6 == 1,
"Expected size (%ld) %% 6 == 1\n",
size);
6906 "Expected last two WCHARs being empty, got 0x%x 0x%x\n",
6912 ret = pGetSystemPreferredUILanguages(MUI_MACHINE_LANGUAGE_SETTINGS, &
count,
NULL, &
size);
6913 ok(
ret,
"Expected GetSystemPreferredUILanguages to succeed\n");
6914 ok(
count,
"Expected count > 0\n");
6915 ok(
size % 6 == 1,
"Expected size (%ld) %% 6 == 1\n",
size);
6918 "Expected last two WCHARs being empty, got 0x%x 0x%x\n",
6927 ok(
count,
"Expected count > 0\n");
6928 ok(
size % 5 == 1,
"Expected size (%ld) %% 5 == 1\n",
size);
6931 "Expected last two WCHARs being empty, got 0x%x 0x%x\n",
6938 ok(
count,
"Expected count > 0\n");
6939 ok(
size % 6 == 1,
"Expected size (%ld) %% 6 == 1\n",
size);
6942 "Expected last two WCHARs being empty, got 0x%x 0x%x\n",
6947 status = pRtlGetSystemPreferredUILanguages(MUI_MACHINE_LANGUAGE_SETTINGS, 0, &
count,
NULL, &
size);
6949 ok(
count,
"Expected count > 0\n");
6950 ok(
size % 6 == 1,
"Expected size (%ld) %% 6 == 1\n",
size);
6953 "Expected last two WCHARs being empty, got 0x%x 0x%x\n",
6959 ok(!
ret,
"Expected GetSystemPreferredUILanguages to fail\n");
6961 "Expected error ERROR_INSUFFICIENT_BUFFER, got %ld\n",
GetLastError());
6962 ok(
size == size_id,
"expected %lu, got %lu\n", size_id,
size);
6967 ok(!
ret,
"Expected GetSystemPreferredUILanguages to fail\n");
6969 "Expected error ERROR_INSUFFICIENT_BUFFER, got %ld\n",
GetLastError());
6970 ok(
size == size_id,
"expected %lu, got %lu\n", size_id,
size);
6976 ok(!
ret,
"Expected GetSystemPreferredUILanguages to fail\n");
6978 "Expected error ERROR_INSUFFICIENT_BUFFER, got %ld\n",
GetLastError());
6979 ok(
size == size_id,
"expected %lu, got %lu\n", size_id,
size);
6985 ok(!
ret,
"Expected GetSystemPreferredUILanguages to fail\n");
6987 "Expected error ERROR_INSUFFICIENT_BUFFER, got %ld\n",
GetLastError());
6988 ok(
size == size_id + 2 ||
size == size_id + 1 ,
"expected %lu, got %lu\n", size_id + 2,
size);
7000 if (!pGetThreadPreferredUILanguages)
7002 win_skip(
"GetThreadPreferredUILanguages is not available.\n");
7007 ret = pGetThreadPreferredUILanguages(MUI_LANGUAGE_ID|MUI_UI_FALLBACK, &
count,
NULL, &
size);
7009 ok(
count,
"expected count > 0\n");
7010 ok(
size,
"expected size > 0\n");
7014 ret = pGetThreadPreferredUILanguages(MUI_LANGUAGE_ID|MUI_UI_FALLBACK, &
count,
buf, &
size);
7016 ok(
count,
"expected count > 0\n");
7018 size_id =
count = 0;
7019 ret = pGetThreadPreferredUILanguages(MUI_LANGUAGE_ID, &
count,
NULL, &size_id);
7021 ok(
count,
"expected count > 0\n");
7022 ok(size_id,
"expected size > 0\n");
7023 ok(size_id <= size, "expected size > 0\
n");
7025 /* ntdll function is the same */
7026 size_id = count = 0;
7027 status = pRtlGetThreadPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size_id);
7028 ok(!status, "got %lx\
n", status);
7034 SetLastError(0xdeadbeef);
7035 ret = pGetThreadPreferredUILanguages(MUI_LANGUAGE_ID, &count, buf, &size);
7037 ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
7039 ok(size == size_id, "expected %lu, got %lu\
n", size_id, size);
7042 SetLastError(0xdeadbeef);
7043 ret = pGetThreadPreferredUILanguages(MUI_LANGUAGE_ID, &count, buf, &size);
7045 ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
7047 ok(size == size_id, "expected %lu, got %lu\
n", size_id, size);
7050 SetLastError(0xdeadbeef);
7051 ret = pGetThreadPreferredUILanguages(MUI_LANGUAGE_ID, &count, buf, &size);
7053 ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
7055 ok(size == size_id, "expected %lu, got %lu\
n", size_id, size);
7058 SetLastError(0xdeadbeef);
7059 ret = pGetThreadPreferredUILanguages(0, &count, buf, &size);
7061 ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
7064 ok(size == size_id || size == size_id - 1 /* before win10 1809 */, "expected %lu, got %lu\
n", size_id, size);
7066 HeapFree(GetProcessHeap(), 0, buf);
7069static void test_GetUserPreferredUILanguages(void)
7073 ULONG count, size, size_id, size_name, size_buffer;
7076 if (!pGetUserPreferredUILanguages)
7083 SetLastError(0xdeadbeef);
7084 ret = pGetUserPreferredUILanguages(MUI_FULL_LANGUAGE, &count, NULL, &size);
7086 ok(ERROR_INVALID_PARAMETER == GetLastError(),
7090 SetLastError(0xdeadbeef);
7091 ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID | MUI_FULL_LANGUAGE, &count, NULL, &size);
7093 ok(ERROR_INVALID_PARAMETER == GetLastError(),
7097 SetLastError(0xdeadbeef);
7098 ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID | MUI_MACHINE_LANGUAGE_SETTINGS, &count, NULL, &size);
7100 ok(ERROR_INVALID_PARAMETER == GetLastError(),
7104 SetLastError(0xdeadbeef);
7105 ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size);
7107 ok(ERROR_INVALID_PARAMETER == GetLastError(),
7112 SetLastError(0xdeadbeef);
7113 ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size_id);
7116 ok(size_id % 5 == 1, "Expected size (%ld) %% 5 == 1\
n", size_id);
7120 SetLastError(0xdeadbeef);
7121 ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &count, NULL, &size_name);
7124 ok(size_name % 6 == 1, "Expected size (%ld) %% 6 == 1\
n", size_name);
7126 size_buffer = max(size_id, size_name);
7133 /* ntdll version is the same, but apparently takes an extra second parameter */
7136 SetLastError(0xdeadbeef);
7137 status = pRtlGetUserPreferredUILanguages(MUI_LANGUAGE_ID, 0, &count, NULL, &size_id);
7138 ok(!status, "got %lx\
n", status);
7140 ok(size_id % 5 == 1, "Expected size (%ld) %% 5 == 1\
n", size_id);
7142 buffer = HeapAlloc(GetProcessHeap(), 0, size_buffer * sizeof(WCHAR));
7146 memset(buffer, 0x5a, size_buffer * sizeof(WCHAR));
7147 SetLastError(0xdeadbeef);
7148 ret = pGetUserPreferredUILanguages(0, &count, buffer, &size);
7152 if (ret && size % 6 == 1)
7153 ok(!buffer[size -2] && !buffer[size -1],
7155 buffer[size -2], buffer[size -1]);
7159 memset(buffer, 0x5a, size_buffer * sizeof(WCHAR));
7160 SetLastError(0xdeadbeef);
7161 ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size);
7165 if (ret && size % 5 == 1)
7166 ok(!buffer[size -2] && !buffer[size -1],
7168 buffer[size -2], buffer[size -1]);
7172 SetLastError(0xdeadbeef);
7173 ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &count, buffer, &size);
7177 if (ret && size % 5 == 1)
7178 ok(!buffer[size -2] && !buffer[size -1],
7180 buffer[size -2], buffer[size -1]);
7183 SetLastError(0xdeadbeef);
7184 ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size);
7186 ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(),
7190 memset(buffer, 0x5a, size_buffer * sizeof(WCHAR));
7191 SetLastError(0xdeadbeef);
7192 ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size);
7194 ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(),
7199 memset(buffer, 0x5a, size_buffer * sizeof(WCHAR));
7200 SetLastError(0xdeadbeef);
7201 ret = pGetUserPreferredUILanguages(0, &count, buffer, &size);
7203 ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(),
7206 HeapFree(GetProcessHeap(), 0, buffer);
7209static void test_FindNLSStringEx(void)
7212 static const WCHAR comb_s_accent1W[] = {0x1e69, 'o','u','r','c','e',0};
7213 static const WCHAR comb_s_accent2W[] = {0x0073,0x323,0x307,'o','u','r','c','e',0};
7214 static const WCHAR comb_q_accent1W[] = {'a','b',0x0071,0x0307,0x323,'u','o','t','e','\n',0};
7215 static const WCHAR comb_q_accent2W[] = {0x0071,0x0323,0x307,'u','o','t','e',0};
7217 const WCHAR *locale;
7225 static struct test_data tests[] =
7227 { localeW, FIND_FROMSTART, L"SimpleSimple
", L"Simple", 0, 6},
7228 { localeW, FIND_FROMEND, L"SimpleSimple
", L"Simp
", 6, 4},
7229 { localeW, FIND_STARTSWITH, L"SimpleSimple
", L"Simp
", 0, 4},
7230 { localeW, FIND_ENDSWITH, L"SimpleSimple
", L"Simple", 6, 6},
7231 { localeW, FIND_ENDSWITH, L"SimpleSimple
", L"Simp
", -1, 0xdeadbeef},
7232 { localeW, FIND_FROMSTART, comb_s_accent1W, comb_s_accent2W, 0, 6 },
7233 { localeW, FIND_FROMSTART, comb_q_accent1W, comb_q_accent2W, 2, 7 },
7234 { localeW, FIND_STARTSWITH, L"--Option
", L"--
", 0, 2},
7235 { localeW, FIND_ENDSWITH, L"Option--
", L"--
", 6, 2},
7236 { localeW, FIND_FROMSTART, L"----
", L"--
", 0, 2},
7237 { localeW, FIND_FROMEND, L"----
", L"--
", 2, 2},
7238 { localeW, FIND_FROMSTART, L"opt1--opt2--opt3
", L"--
", 4, 2},
7239 { localeW, FIND_FROMEND, L"opt1--opt2--opt3
", L"--
", 10, 2},
7242 { localeW, FIND_FROMSTART, L"x-
oss-
security", L"-
oss--
", -1, 0xdeadbeef},
7243 { localeW, FIND_FROMEND, L"x-
oss-oss2
", L"-
oss", 5, 4},
7247#if defined(__REACTOS__) && DLL_EXPORT_VERSION >= 0x600
7248 /* FIXME: FindNLSStringEx is a STUB on ReactOS! */
7249 if (is_reactos() || !pFindNLSStringEx)
7251 if (!pFindNLSStringEx)
7258 SetLastError( 0xdeadbeef );
7259 res = pFindNLSStringEx(invalidW, FIND_FROMSTART, fooW, 3, fooW,
7260 3, NULL, NULL, NULL, 0);
7262 ok(ERROR_INVALID_PARAMETER == GetLastError(),
7265 SetLastError( 0xdeadbeef );
7266 res = pFindNLSStringEx(localeW, FIND_FROMSTART, NULL, 3, fooW, 3,
7267 NULL, NULL, NULL, 0);
7269 ok(ERROR_INVALID_PARAMETER == GetLastError(),
7272 SetLastError( 0xdeadbeef );
7273 res = pFindNLSStringEx(localeW, FIND_FROMSTART, fooW, -5, fooW, 3,
7274 NULL, NULL, NULL, 0);
7276 ok(ERROR_INVALID_PARAMETER == GetLastError(),
7279 SetLastError( 0xdeadbeef );
7280 res = pFindNLSStringEx(localeW, FIND_FROMSTART, fooW, 3, NULL, 3,
7281 NULL, NULL, NULL, 0);
7283 ok(ERROR_INVALID_PARAMETER == GetLastError(),
7286 SetLastError( 0xdeadbeef );
7287 res = pFindNLSStringEx(localeW, FIND_FROMSTART, fooW, 3, fooW, -5,
7288 NULL, NULL, NULL, 0);
7290 ok(ERROR_INVALID_PARAMETER == GetLastError(),
7293 for (i = 0; i < ARRAY_SIZE(tests); i++)
7296 if (GetNTVersion() == _WIN32_WINNT_VISTA && i == 5) // Skip tests[5] on Vista
7299 int found = 0xdeadbeef;
7300 res = pFindNLSStringEx(tests[i].locale, tests[i].flags, tests[i].src, -1,
7301 tests[i].value, -1, &found, NULL, NULL, 0);
7302 ok(res == tests[i].expected_ret,
7304 tests[i].expected_ret, res);
7305 ok(found == tests[i].expected_found,
7307 tests[i].expected_found, found);
7311static void test_FindStringOrdinal(void)
7313 static const WCHAR abc123aBcW[] = {'a', 'b', 'c', '1', '2', '3', 'a', 'B', 'c', 0};
7314 static const WCHAR abcW[] = {'a', 'b', 'c', 0};
7315 static const WCHAR aBcW[] = {'a', 'B', 'c', 0};
7316 static const WCHAR aaaW[] = {'a', 'a', 'a', 0};
7331 {1, abc123aBcW, ARRAY_SIZE(abc123aBcW) - 1, abcW, ARRAY_SIZE(abcW) - 1, FALSE, -1, ERROR_INVALID_FLAGS},
7332 {FIND_FROMSTART, NULL, ARRAY_SIZE(abc123aBcW) - 1, abcW, ARRAY_SIZE(abcW) - 1, FALSE, -1,
7333 ERROR_INVALID_PARAMETER},
7334 {FIND_FROMSTART, abc123aBcW, ARRAY_SIZE(abc123aBcW) - 1, NULL, ARRAY_SIZE(abcW) - 1, FALSE, -1,
7335 ERROR_INVALID_PARAMETER},
7336 {FIND_FROMSTART, abc123aBcW, ARRAY_SIZE(abc123aBcW) - 1, NULL, 0, FALSE, -1, ERROR_INVALID_PARAMETER},
7337 {FIND_FROMSTART, NULL, 0, abcW, ARRAY_SIZE(abcW) - 1, FALSE, -1, ERROR_INVALID_PARAMETER},
7338 {FIND_FROMSTART, NULL, 0, NULL, 0, FALSE, -1, ERROR_INVALID_PARAMETER},
7339 /* Case-insensitive */
7340 {FIND_FROMSTART, abc123aBcW, ARRAY_SIZE(abc123aBcW) - 1, abcW, ARRAY_SIZE(abcW) - 1, FALSE, 0, NO_ERROR},
7341 {FIND_FROMEND, abc123aBcW, ARRAY_SIZE(abc123aBcW) - 1, abcW, ARRAY_SIZE(abcW) - 1, FALSE, 0, NO_ERROR},
7342 {FIND_STARTSWITH, abc123aBcW, ARRAY_SIZE(abc123aBcW) - 1, abcW, ARRAY_SIZE(abcW) - 1, FALSE, 0, NO_ERROR},
7343 {FIND_ENDSWITH, abc123aBcW, ARRAY_SIZE(abc123aBcW) - 1, abcW, ARRAY_SIZE(abcW) - 1, FALSE, -1, NO_ERROR},
7344 /* Case-sensitive */
7345 {FIND_FROMSTART, abc123aBcW, ARRAY_SIZE(abc123aBcW) - 1, aBcW, ARRAY_SIZE(aBcW) - 1, TRUE, 0, NO_ERROR},
7346 {FIND_FROMEND, abc123aBcW, ARRAY_SIZE(abc123aBcW) - 1, aBcW, ARRAY_SIZE(aBcW) - 1, TRUE, 6, NO_ERROR},
7347 {FIND_STARTSWITH, abc123aBcW, ARRAY_SIZE(abc123aBcW) - 1, aBcW, ARRAY_SIZE(aBcW) - 1, TRUE, 0, NO_ERROR},
7348 {FIND_ENDSWITH, abc123aBcW, ARRAY_SIZE(abc123aBcW) - 1, aBcW, ARRAY_SIZE(aBcW) - 1, TRUE, 6, NO_ERROR},
7350 {FIND_FROMSTART, abc123aBcW, ARRAY_SIZE(abc123aBcW) - 1, aaaW, ARRAY_SIZE(aaaW) - 1, FALSE, -1, NO_ERROR},
7351 {FIND_FROMSTART, abc123aBcW, -1, abcW, ARRAY_SIZE(abcW) - 1, FALSE, 0, NO_ERROR},
7352 {FIND_FROMSTART, abc123aBcW, ARRAY_SIZE(abc123aBcW) - 1, abcW, -1, FALSE, 0, NO_ERROR},
7353 {FIND_FROMSTART, abc123aBcW, 0, abcW, ARRAY_SIZE(abcW) - 1, FALSE, -1, NO_ERROR},
7354 {FIND_FROMSTART, abc123aBcW, ARRAY_SIZE(abc123aBcW) - 1, abcW, 0, FALSE, 0, NO_ERROR},
7355 {FIND_FROMSTART, abc123aBcW, 0, abcW, 0, FALSE, 0, NO_ERROR},
7361 if (!pFindStringOrdinal)
7367 for (i = 0; i < ARRAY_SIZE(tests); i++)
7369 SetLastError(0xdeadbeef);
7370 ret = pFindStringOrdinal(tests[i].flag, tests[i].src, tests[i].src_size, tests[i].val, tests[i].val_size,
7371 tests[i].ignore_case);
7372 err = GetLastError();
7373 ok(ret == tests[i].ret, "Item %
d expected %
d, got %
d\
n", i, tests[i].ret, ret);
7374 ok(err == tests[i].err, "Item %
d expected %#lx, got %#lx\
n", i, tests[i].err, err);
7378static void test_SetThreadUILanguage(void)
7382 if (!pGetThreadUILanguage)
7384 win_skip("GetThreadUILanguage isn
't implemented, skipping SetThreadUILanguage tests for version < Vista\n");
7385 return; /* BTW SetThreadUILanguage is present on winxp/2003 but doesn`t set the LANGID anyway when tested */
7388 res = pSetThreadUILanguage(0);
7389 ok(res == pGetThreadUILanguage(), "expected %d got %d\n", pGetThreadUILanguage(), res);
7391 res = pSetThreadUILanguage(MAKELANGID(LANG_DUTCH, SUBLANG_DUTCH_BELGIAN));
7392 ok(res == MAKELANGID(LANG_DUTCH, SUBLANG_DUTCH_BELGIAN),
7393 "expected %d got %d\n", MAKELANGID(LANG_DUTCH, SUBLANG_DUTCH_BELGIAN), res);
7395 res = pSetThreadUILanguage(0);
7396 todo_wine ok(res == MAKELANGID(LANG_DUTCH, SUBLANG_DUTCH_BELGIAN),
7397 "expected %d got %d\n", MAKELANGID(LANG_DUTCH, SUBLANG_DUTCH_BELGIAN), res);
7400/* read a Unicode string from NormalizationTest.txt format; helper for test_NormalizeString */
7401static int read_str( char *str, WCHAR res[32] )
7406 while (*str && pos < 31)
7408 unsigned int c = strtoul( str, &end, 16 );
7409 pos += put_utf16( res + pos, c );
7410 while (*end == ' ') end++;
7417static void test_NormalizeString(void)
7419 /* part 0: specific cases */
7420 /* LATIN CAPITAL LETTER D WITH DOT ABOVE */
7421 static const WCHAR part0_str1[] = {0x1e0a,0};
7422 static const WCHAR part0_nfd1[] = {0x0044,0x0307,0};
7424 /* LATIN CAPITAL LETTER D, COMBINING DOT BELOW, COMBINING DOT ABOVE */
7425 static const WCHAR part0_str2[] = {0x0044,0x0323,0x0307,0};
7426 static const WCHAR part0_nfc2[] = {0x1e0c,0x0307,0};
7428 /* LATIN CAPITAL LETTER D, COMBINING HORN, COMBINING DOT BELOW, COMBINING DOT ABOVE */
7429 static const WCHAR part0_str3[] = {0x0044,0x031b,0x0323,0x0307,0};
7430 static const WCHAR part0_nfc3[] = {0x1e0c,0x031b,0x0307,0};
7432 /* LATIN CAPITAL LETTER D, COMBINING HORN, COMBINING DOT BELOW, COMBINING DOT ABOVE */
7433 static const WCHAR part0_str4[] = {0x0044,0x031b,0x0323,0x0307,0};
7434 static const WCHAR part0_nfc4[] = {0x1e0c,0x031b,0x0307,0};
7437 * HEBREW ACCENT SEGOL, HEBREW POINT PATAH, HEBREW POINT DAGESH OR MAPIQ,
7438 * HEBREW ACCENT MERKHA, HEBREW POINT SHEVA, HEBREW PUNCTUATION PASEQ,
7439 * HEBREW MARK UPPER DOT, HEBREW ACCENT DEHI
7441 static const WCHAR part0_str5[] = {0x0592,0x05B7,0x05BC,0x05A5,0x05B0,0x05C0,0x05C4,0x05AD,0};
7442 static const WCHAR part0_nfc5[] = {0x05B0,0x05B7,0x05BC,0x05A5,0x0592,0x05C0,0x05AD,0x05C4,0};
7445 * HEBREW POINT QAMATS, HEBREW POINT HOLAM, HEBREW POINT HATAF SEGOL,
7446 * HEBREW ACCENT ETNAHTA, HEBREW PUNCTUATION SOF PASUQ, HEBREW POINT SHEVA,
7447 * HEBREW ACCENT ILUY, HEBREW ACCENT QARNEY PARA
7449 static const WCHAR part0_str6[] = {0x05B8,0x05B9,0x05B1,0x0591,0x05C3,0x05B0,0x05AC,0x059F,0};
7450 static const WCHAR part0_nfc6[] = {0x05B1,0x05B8,0x05B9,0x0591,0x05C3,0x05B0,0x05AC,0x059F,0};
7452 /* LATIN CAPITAL LETTER D WITH DOT BELOW */
7453 static const WCHAR part0_str8[] = {0x1E0C,0};
7454 static const WCHAR part0_nfd8[] = {0x0044,0x0323,0};
7456 /* LATIN CAPITAL LETTER D WITH DOT ABOVE, COMBINING DOT BELOW */
7457 static const WCHAR part0_str9[] = {0x1E0A,0x0323,0};
7458 static const WCHAR part0_nfc9[] = {0x1E0C,0x0307,0};
7459 static const WCHAR part0_nfd9[] = {0x0044,0x0323,0x0307,0};
7461 /* LATIN CAPITAL LETTER D WITH DOT BELOW, COMBINING DOT ABOVE */
7462 static const WCHAR part0_str10[] = {0x1E0C,0x0307,0};
7463 static const WCHAR part0_nfd10[] = {0x0044,0x0323,0x0307,0};
7465 /* LATIN CAPITAL LETTER E WITH MACRON AND GRAVE, COMBINING MACRON */
7466 static const WCHAR part0_str11[] = {0x1E14,0x0304,0};
7467 static const WCHAR part0_nfd11[] = {0x0045,0x0304,0x0300,0x0304,0};
7469 /* LATIN CAPITAL LETTER E WITH MACRON, COMBINING GRAVE ACCENT */
7470 static const WCHAR part0_str12[] = {0x0112,0x0300,0};
7471 static const WCHAR part0_nfc12[] = {0x1E14,0};
7472 static const WCHAR part0_nfd12[] = {0x0045,0x0304,0x0300,0};
7474 /* part 1: character by character */
7476 static const WCHAR part1_str1[] = {0x00a8,0};
7477 static const WCHAR part1_nfkc1[] = {0x0020,0x0308,0};
7479 /* VULGAR FRACTION ONE QUARTER */
7480 static const WCHAR part1_str2[] = {0x00bc,0};
7481 static const WCHAR part1_nfkc2[] = {0x0031,0x2044,0x0034,0};
7483 /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX */
7484 static const WCHAR part1_str3[] = {0x00ca,0};
7485 static const WCHAR part1_nfd3[] = {0x0045,0x0302,0};
7487 /* MODIFIER LETTER SMALL GAMMA */
7488 static const WCHAR part1_str4[] = {0x02e0,0};
7489 static const WCHAR part1_nfkc4[] = {0x0263,0};
7491 /* CYRILLIC CAPITAL LETTER IE WITH GRAVE */
7492 static const WCHAR part1_str5[] = {0x0400,0};
7493 static const WCHAR part1_nfd5[] = {0x0415,0x0300,0};
7495 /* CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT */
7496 static const WCHAR part1_str6[] = {0x0476,0};
7497 static const WCHAR part1_nfd6[] = {0x0474,0x030F,0};
7499 /* ARABIC LIGATURE HAH WITH JEEM INITIAL FORM */
7500 static const WCHAR part1_str7[] = {0xFCA9,0};
7501 static const WCHAR part1_nfkc7[] = {0x062D,0x062C,0};
7503 /* GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA */
7504 static const WCHAR part1_str8[] = {0x1F42,0};
7505 static const WCHAR part1_nfd8[] = {0x03BF,0x0313,0x0300,0};
7507 /* QUADRUPLE PRIME */
7508 static const WCHAR part1_str9[] = {0x2057,0};
7509 static const WCHAR part1_nfkc9[] = {0x2032,0x2032,0x2032,0x2032,0};
7511 /* KATAKANA-HIRAGANA VOICED SOUND MARK */
7512 static const WCHAR part1_str10[] = {0x309B,0};
7513 static const WCHAR part1_nfkc10[] = {0x20,0x3099,0};
7516 static const WCHAR part1_str11[] = {0x212B,0};
7517 static const WCHAR part1_nfc11[] = {0xC5,0};
7518 static const WCHAR part1_nfd11[] = {'A',0x030A,0};
7520 static const WCHAR composite_src[] =
7522 0x008a, 0x008e, 0x009a, 0x009e, 0x009f, 0x00c0, 0x00c1, 0x00c2,
7523 0x00c3, 0x00c4, 0x00c5, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb,
7524 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x00d1, 0x00d2, 0x00d3, 0x00d4,
7525 0x00d5, 0x00d6, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd,
7526 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e7, 0x00e8,
7527 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x00f1,
7528 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f8, 0x00f9, 0x00fa,
7529 0x00fb, 0x00fc, 0x00fd, 0x00ff, 0x212b
7532 struct test_data_normal {
7534 const WCHAR *expected[4];
7536 static const struct test_data_normal test_arr[] =
7538 { part0_str1, { part0_str1, part0_nfd1, part0_str1, part0_nfd1 } },
7539 { part0_str2, { part0_nfc2, part0_str2, part0_nfc2, part0_str2 } },
7540 { part0_str3, { part0_nfc3, part0_str3, part0_nfc3, part0_str3 } },
7541 { part0_str4, { part0_nfc4, part0_str4, part0_nfc4, part0_str4 } },
7542 { part0_str5, { part0_nfc5, part0_nfc5, part0_nfc5, part0_nfc5 } },
7543 { part0_str6, { part0_nfc6, part0_nfc6, part0_nfc6, part0_nfc6 } },
7544 { part0_str8, { part0_str8, part0_nfd8, part0_str8, part0_nfd8 } },
7545 { part0_str9, { part0_nfc9, part0_nfd9, part0_nfc9, part0_nfd9 } },
7546 { part0_str10, { part0_str10, part0_nfd10, part0_str10, part0_nfd10 } },
7547 { part0_str11, { part0_str11, part0_nfd11, part0_str11, part0_nfd11 } },
7548 { part0_str12, { part0_nfc12, part0_nfd12, part0_nfc12, part0_nfd12 } },
7549 { part1_str1, { part1_str1, part1_str1, part1_nfkc1, part1_nfkc1 } },
7550 { part1_str2, { part1_str2, part1_str2, part1_nfkc2, part1_nfkc2 } },
7551 { part1_str3, { part1_str3, part1_nfd3, part1_str3, part1_nfd3 } },
7552 { part1_str4, { part1_str4, part1_str4, part1_nfkc4, part1_nfkc4 } },
7553 { part1_str5, { part1_str5, part1_nfd5, part1_str5, part1_nfd5 } },
7554 { part1_str6, { part1_str6, part1_nfd6, part1_str6, part1_nfd6 } },
7555 { part1_str7, { part1_str7, part1_str7, part1_nfkc7, part1_nfkc7 } },
7556 { part1_str8, { part1_str8, part1_nfd8, part1_str8, part1_nfd8 } },
7557 { part1_str9, { part1_str9, part1_str9, part1_nfkc9, part1_nfkc9 } },
7558 { part1_str10, { part1_str10, part1_str10, part1_nfkc10, part1_nfkc10 } },
7559 { part1_str11, { part1_nfc11, part1_nfd11, part1_nfc11, part1_nfd11 } },
7562 const struct test_data_normal *ptest = test_arr;
7563 const int norm_forms[] = { NormalizationC, NormalizationD, NormalizationKC, NormalizationKD };
7567 int dstlen, str_cmp, i, j;
7570 if (!pNormalizeString)
7572 win_skip("NormalizeString is not available.\n");
7575 if (!pRtlNormalizeString) win_skip("RtlNormalizeString is not available.\n");
7578 * For each string, first test passing -1 as srclen to NormalizeString,
7579 * thereby assuming a null-terminating string in src, and then test passing
7580 * explicitly the string length.
7581 * Do that for all 4 normalization forms.
7585 for (i = 0; i < 4; i++)
7587 SetLastError(0xdeadbeef);
7588 dstlen = pNormalizeString( norm_forms[i], ptest->str, -1, NULL, 0 );
7589 ok( dstlen > lstrlenW(ptest->str), "%s:%d: wrong len %d / %d\n",
7590 wine_dbgstr_w(ptest->str), i, dstlen, lstrlenW(ptest->str) );
7591 ok(GetLastError() == ERROR_SUCCESS, "%s:%d: got error %lu\n",
7592 wine_dbgstr_w(ptest->str), i, GetLastError());
7593 SetLastError(0xdeadbeef);
7594 dstlen = pNormalizeString( norm_forms[i], ptest->str, -1, dst, dstlen );
7595 ok(GetLastError() == ERROR_SUCCESS, "%s:%d: got error %lu\n",
7596 wine_dbgstr_w(ptest->str), i, GetLastError());
7597 ok(dstlen == lstrlenW( dst )+1, "%s:%d: Copied length differed: was %d, should be %d\n",
7598 wine_dbgstr_w(ptest->str), i, dstlen, lstrlenW( dst )+1);
7599 str_cmp = wcsncmp( ptest->expected[i], dst, dstlen+1 );
7600 ok( str_cmp == 0, "%s:%d: string incorrect got %s expect %s\n", wine_dbgstr_w(ptest->str), i,
7601 wine_dbgstr_w(dst), wine_dbgstr_w(ptest->expected[i]) );
7603 dstlen = pNormalizeString( norm_forms[i], ptest->str, lstrlenW(ptest->str), NULL, 0 );
7604 memset(dst, 0xcc, sizeof(dst));
7605 dstlen = pNormalizeString( norm_forms[i], ptest->str, lstrlenW(ptest->str), dst, dstlen );
7606 ok(dstlen == lstrlenW( ptest->expected[i] ), "%s:%d: Copied length differed: was %d, should be %d\n",
7607 wine_dbgstr_w(ptest->str), i, dstlen, lstrlenW( dst ));
7608 str_cmp = wcsncmp( ptest->expected[i], dst, dstlen );
7609 ok( str_cmp == 0, "%s:%d: string incorrect got %s expect %s\n", wine_dbgstr_w(ptest->str), i,
7610 wine_dbgstr_w(dst), wine_dbgstr_w(ptest->expected[i]) );
7612 if (pRtlNormalizeString)
7615 status = pRtlNormalizeString( norm_forms[i], ptest->str, lstrlenW(ptest->str), NULL, &dstlen );
7616 ok( !status, "%s:%d: failed %lx\n", wine_dbgstr_w(ptest->str), i, status );
7617 ok( dstlen > lstrlenW(ptest->str), "%s:%d: wrong len %d / %d\n",
7618 wine_dbgstr_w(ptest->str), i, dstlen, lstrlenW(ptest->str) );
7619 memset(dst, 0, sizeof(dst));
7620 status = pRtlNormalizeString( norm_forms[i], ptest->str, lstrlenW(ptest->str), dst, &dstlen );
7621 ok( !status, "%s:%d: failed %lx\n", wine_dbgstr_w(ptest->str), i, status );
7622 ok(dstlen == lstrlenW( dst ), "%s:%d: Copied length differed: was %d, should be %d\n",
7623 wine_dbgstr_w(ptest->str), i, dstlen, lstrlenW( dst ));
7624 str_cmp = wcsncmp( ptest->expected[i], dst, dstlen );
7625 ok( str_cmp == 0, "%s:%d: string incorrect got %s expect %s\n", wine_dbgstr_w(ptest->str), i,
7626 wine_dbgstr_w(dst), wine_dbgstr_w(ptest->expected[i]) );
7628 status = pRtlIsNormalizedString( norm_forms[i], ptest->str, -1, &ret );
7629 ok( !status, "%s:%d: failed %lx\n", wine_dbgstr_w(ptest->str), i, status );
7630 if (!wcscmp( ptest->str, dst ))
7631 ok( ret, "%s:%d: not normalized\n", wine_dbgstr_w(ptest->str), i );
7633 ok( !ret, "%s:%d: normalized (dst %s)\n", wine_dbgstr_w(ptest->str), i, wine_dbgstr_w(dst) );
7635 status = pRtlIsNormalizedString( norm_forms[i], dst, dstlen, &ret );
7636 ok( !status, "%s:%d: failed %lx\n", wine_dbgstr_w(ptest->str), i, status );
7637 ok( ret, "%s:%d: not normalized\n", wine_dbgstr_w(ptest->str), i );
7643 /* buffer overflows */
7645 SetLastError(0xdeadbeef);
7646 dstlen = pNormalizeString( NormalizationD, part0_str1, -1, dst, 1 );
7647 ok( dstlen <= 0, "wrong len %d\n", dstlen );
7648 ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got error %lu\n", GetLastError());
7650 SetLastError(0xdeadbeef);
7651 dstlen = pNormalizeString( NormalizationC, part0_str2, -1, dst, 1 );
7652 ok( dstlen <= 0, "wrong len %d\n", dstlen );
7653 ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got error %lu\n", GetLastError());
7655 SetLastError(0xdeadbeef);
7656 dstlen = pNormalizeString( NormalizationC, part0_str2, -1, NULL, 0 );
7657 ok( dstlen == 12, "wrong len %d\n", dstlen );
7658 ok(GetLastError() == ERROR_SUCCESS, "got error %lu\n", GetLastError());
7660 SetLastError(0xdeadbeef);
7661 dstlen = pNormalizeString( NormalizationC, part0_str2, -1, dst, 3 );
7662 ok( dstlen == 3, "wrong len %d\n", dstlen );
7663 ok(GetLastError() == ERROR_SUCCESS, "got error %lu\n", GetLastError());
7665 SetLastError(0xdeadbeef);
7666 dstlen = pNormalizeString( NormalizationC, part0_str2, 0, NULL, 0 );
7667 ok( dstlen == 0, "wrong len %d\n", dstlen );
7668 ok(GetLastError() == ERROR_SUCCESS, "got error %lu\n", GetLastError());
7670 SetLastError(0xdeadbeef);
7671 dstlen = pNormalizeString( NormalizationC, part0_str2, 0, dst, 3 );
7672 ok( dstlen == 0, "wrong len %d\n", dstlen );
7673 ok(GetLastError() == ERROR_SUCCESS, "got error %lu\n", GetLastError());
7675 /* size estimations */
7677 memset( dst, 'A', sizeof(dst) );
7678 for (j = 1; j < ARRAY_SIZE(dst); j++)
7680 for (i = 0; i < 4; i++)
7682 int expect = (i < 2) ? j * 3 : j * 18;
7683 if (expect > 64) expect = max( 64, j + j / 8 );
7684 dstlen = pNormalizeString( norm_forms[i], dst, j, NULL, 0 );
7685 ok( dstlen == expect, "%d: %d -> wrong len %d\n", i, j, dstlen );
7686 if (pRtlNormalizeString)
7689 status = pRtlNormalizeString( norm_forms[i], dst, j, NULL, &dstlen );
7690 ok( !status, "%d: failed %lx\n", i, status );
7691 ok( dstlen == expect, "%d: %d -> wrong len %d\n", i, j, dstlen );
7695 for (i = 0; i < 4; i++)
7697 int srclen = ARRAY_SIZE( composite_src );
7698 int expect = max( 64, srclen + srclen / 8 );
7699 dstlen = pNormalizeString( norm_forms[i], composite_src, srclen, NULL, 0 );
7700 ok( dstlen == expect, "%d: wrong len %d\n", i, dstlen );
7701 dstlen = pNormalizeString( norm_forms[i], composite_src, srclen, dst, dstlen );
7702 if (i == 0 || i == 2)
7704 ok( dstlen == srclen, "%d: wrong len %d\n", i, dstlen );
7705 ok(GetLastError() == ERROR_SUCCESS, "got error %lu\n", GetLastError());
7709 ok( dstlen < -expect, "%d: wrong len %d\n", i, dstlen );
7710 ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got error %lu\n", GetLastError());
7712 if (pRtlNormalizeString)
7715 status = pRtlNormalizeString( norm_forms[i], composite_src, srclen, NULL, &dstlen );
7716 ok( !status, "%d: failed %lx\n", i, status );
7717 ok( dstlen == expect, "%d: wrong len %d\n", i, dstlen );
7718 status = pRtlNormalizeString( norm_forms[i], composite_src, srclen, dst, &dstlen );
7719 if (i == 0 || i == 2)
7721 ok( !status, "%d: failed %lx\n", i, status );
7722 ok( dstlen == srclen, "%d: wrong len %d\n", i, dstlen );
7726 ok( status == STATUS_BUFFER_TOO_SMALL, "%d: failed %lx\n", i, status );
7727 ok( dstlen > expect, "%d: wrong len %d\n", i, dstlen );
7732 /* invalid parameters */
7734 for (i = 0; i < 32; i++)
7736 SetLastError(0xdeadbeef);
7737 dstlen = pNormalizeString( i, L"ABC", -1, NULL, 0 );
7740 case NormalizationC:
7741 case NormalizationD:
7742 case NormalizationKC:
7743 case NormalizationKD:
7745 ok( dstlen > 0, "%d: wrong len %d\n", i, dstlen );
7746 ok( GetLastError() == ERROR_SUCCESS, "%d: got error %lu\n", i, GetLastError());
7749 ok( dstlen <= 0, "%d: wrong len %d\n", i, dstlen );
7750 ok( GetLastError() == ERROR_INVALID_PARAMETER, "%d: got error %lu\n", i, GetLastError());
7753 if (pRtlNormalizeString)
7756 status = pRtlNormalizeString( i, L"ABC", -1, NULL, &dstlen );
7760 ok( status == STATUS_INVALID_PARAMETER, "%d: failed %lx\n", i, status );
7762 case NormalizationC:
7763 case NormalizationD:
7764 case NormalizationKC:
7765 case NormalizationKD:
7767 ok( status == STATUS_SUCCESS, "%d: failed %lx\n", i, status );
7770 ok( status == STATUS_OBJECT_NAME_NOT_FOUND, "%d: failed %lx\n", i, status );
7776 /* invalid sequences */
7778 for (i = 0; i < 4; i++)
7780 dstlen = pNormalizeString( norm_forms[i], L"AB\xd800Z", -1, NULL, 0 );
7781 ok( dstlen == (i < 2 ? 15 : 64), "%d: wrong len %d\n", i, dstlen );
7782 SetLastError( 0xdeadbeef );
7783 dstlen = pNormalizeString( norm_forms[i], L"AB\xd800Z", -1, dst, ARRAY_SIZE(dst) );
7784 ok( dstlen == -3, "%d: wrong len %d\n", i, dstlen );
7785 ok( GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "%d: wrong error %ld\n", i, GetLastError() );
7786 dstlen = pNormalizeString( norm_forms[i], L"ABCD\xdc12Z", -1, NULL, 0 );
7787 ok( dstlen == (i < 2 ? 21 : 64), "%d: wrong len %d\n", i, dstlen );
7788 SetLastError( 0xdeadbeef );
7789 dstlen = pNormalizeString( norm_forms[i], L"ABCD\xdc12Z", -1, dst, ARRAY_SIZE(dst) );
7790 ok( dstlen == -4, "%d: wrong len %d\n", i, dstlen );
7791 ok( GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "%d: wrong error %ld\n", i, GetLastError() );
7792 SetLastError( 0xdeadbeef );
7793 dstlen = pNormalizeString( norm_forms[i], L"ABCD\xdc12Z", -1, dst, 2 );
7795 ok( dstlen == (i < 2 ? -18 : -74), "%d: wrong len %d\n", i, dstlen );
7796 todo_wine_if (i == 0 || i == 2)
7797 ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "%d: wrong error %ld\n", i, GetLastError() );
7798 if (pRtlNormalizeString)
7801 status = pRtlNormalizeString( norm_forms[i], L"AB\xd800Z", -1, NULL, &dstlen );
7802 ok( !status, "%d: failed %lx\n", i, status );
7803 ok( dstlen == (i < 2 ? 15 : 64), "%d: wrong len %d\n", i, dstlen );
7804 dstlen = ARRAY_SIZE(dst);
7805 status = pRtlNormalizeString( norm_forms[i], L"AB\xd800Z", -1, dst, &dstlen );
7806 ok( status == STATUS_NO_UNICODE_TRANSLATION, "%d: failed %lx\n", i, status );
7807 ok( dstlen == 3, "%d: wrong len %d\n", i, dstlen );
7809 status = pRtlNormalizeString( norm_forms[i], L"AB\xd800Z", -1, dst, &dstlen );
7810 todo_wine_if( i == 0 || i == 2)
7811 ok( status == STATUS_BUFFER_TOO_SMALL, "%d: failed %lx\n", i, status );
7812 todo_wine_if( i != 3)
7813 ok( dstlen == (i < 2 ? 14 : 73), "%d: wrong len %d\n", i, dstlen );
7815 status = pRtlNormalizeString( norm_forms[i], L"AB\xd800Z", -1, dst, &dstlen );
7816 ok( status == STATUS_NO_UNICODE_TRANSLATION, "%d: failed %lx\n", i, status );
7817 ok( dstlen == 3, "%d: wrong len %d\n", i, dstlen );
7821 /* optionally run the full test file from Unicode.org
7822 * available at http://www.unicode.org/Public/UCD/latest/ucd/NormalizationTest.txt
7824 if ((f = fopen( "NormalizationTest.txt", "r" )))
7826 char *p, buffer[1024];
7827 WCHAR str[3], srcW[32], dstW[32], resW[4][32];
7828 int line = 0, part = 0, ch;
7829 char tested[0x110000 / 8];
7831 while (fgets( buffer, sizeof(buffer), f ))
7834 if ((p = strchr( buffer, '#
' ))) *p = 0;
7835 if (!strncmp( buffer, "@Part", 5 ))
7837 part = atoi( buffer + 5 );
7840 if (!(p = strtok( buffer, ";" ))) continue;
7841 read_str( p, srcW );
7842 for (i = 0; i < 4; i++)
7844 p = strtok( NULL, ";" );
7845 read_str( p, &resW[i][0] );
7850 if (ch >= 0xd800 && ch <= 0xdbff)
7851 ch = 0x10000 + ((srcW[0] & 0x3ff) << 10) + (srcW[1] & 0x3ff);
7852 tested[ch / 8] |= 1 << (ch % 8);
7854 for (i = 0; i < 4; i++)
7856 memset( dstW, 0xcc, sizeof(dstW) );
7857 dstlen = pNormalizeString( norm_forms[i], srcW, -1, dstW, ARRAY_SIZE(dstW) );
7858 ok( !wcscmp( dstW, resW[i] ),
7859 "line %u form %u: wrong result %s for %s expected %s\n", line, i,
7860 wine_dbgstr_w( dstW ), wine_dbgstr_w( srcW ), wine_dbgstr_w( resW[i] ));
7863 status = pRtlIsNormalizedString( norm_forms[i], srcW, -1, &ret );
7864 ok( !status, "line %u form %u: RtlIsNormalizedString failed %lx\n", line, i, status );
7865 if (!wcscmp( srcW, dstW ))
7866 ok( ret, "line %u form %u: source not normalized %s\n", line, i, wine_dbgstr_w(srcW) );
7868 ok( !ret, "line %u form %u: source normalized %s\n", line, i, wine_dbgstr_w(srcW) );
7870 status = pRtlIsNormalizedString( norm_forms[i], dstW, -1, &ret );
7871 ok( !status, "line %u form %u: RtlIsNormalizedString failed %lx\n", line, i, status );
7872 ok( ret, "line %u form %u: dest not normalized %s\n", line, i, wine_dbgstr_w(dstW) );
7874 for (j = 0; j < 4; j++)
7876 int expect = i | (j & 2);
7877 memset( dstW, 0xcc, sizeof(dstW) );
7878 dstlen = pNormalizeString( norm_forms[i], resW[j], -1, dstW, ARRAY_SIZE(dstW) );
7879 ok( !wcscmp( dstW, resW[expect] ),
7880 "line %u form %u res %u: wrong result %s for %s expected %s\n", line, i, j,
7881 wine_dbgstr_w( dstW ), wine_dbgstr_w( resW[j] ), wine_dbgstr_w( resW[expect] ));
7887 /* test chars that are not in the @Part1 list */
7888 for (ch = 0; ch < 0x110000; ch++)
7890 if (tested[ch / 8] & (1 << (ch % 8))) continue;
7891 str[put_utf16( str, ch )] = 0;
7892 for (i = 0; i < 4; i++)
7894 memset( dstW, 0xcc, sizeof(dstW) );
7895 SetLastError( 0xdeadbeef );
7896 dstlen = pNormalizeString( norm_forms[i], str, -1, dstW, ARRAY_SIZE(dstW) );
7897 if ((ch >= 0xd800 && ch <= 0xdfff) ||
7898 (ch >= 0xfdd0 && ch <= 0xfdef) ||
7899 ((ch & 0xffff) >= 0xfffe))
7901 ok( dstlen <= 0, "char %04x form %u: wrong result %d %s expected error\n",
7902 ch, i, dstlen, wine_dbgstr_w( dstW ));
7903 ok( GetLastError() == ERROR_NO_UNICODE_TRANSLATION,
7904 "char %04x form %u: error %lu\n", str[0], i, GetLastError() );
7905 status = pRtlIsNormalizedString( norm_forms[i], str, -1, &ret );
7906 ok( status == STATUS_NO_UNICODE_TRANSLATION,
7907 "char %04x form %u: failed %lx\n", ch, i, status );
7911 ok( !wcscmp( dstW, str ),
7912 "char %04x form %u: wrong result %s expected unchanged\n",
7913 ch, i, wine_dbgstr_w( dstW ));
7915 status = pRtlIsNormalizedString( norm_forms[i], str, -1, &ret );
7916 ok( !status, "char %04x form %u: failed %lx\n", ch, i, status );
7917 ok( ret, "char %04x form %u: not normalized\n", ch, i );
7924static void test_SpecialCasing(void)
7928 WCHAR src[8], buffer[8];
7929 static const struct test {
7933 UINT exp; /* 0 if self */
7934 UINT exp_ling; /* 0 if exp */
7937 {L"de-DE", LCMAP_UPPERCASE, 0x00DF}, /* LATIN SMALL LETTER SHARP S */
7939 {L"en-US", LCMAP_UPPERCASE, 0xFB00}, /* LATIN SMALL LIGATURE FF */
7940 {L"en-US", LCMAP_UPPERCASE, 0xFB01}, /* LATIN SMALL LIGATURE FI */
7941 {L"en-US", LCMAP_UPPERCASE, 0xFB02}, /* LATIN SMALL LIGATURE FL */
7942 {L"en-US", LCMAP_UPPERCASE, 0xFB03}, /* LATIN SMALL LIGATURE FFI */
7943 {L"en-US", LCMAP_UPPERCASE, 0xFB04}, /* LATIN SMALL LIGATURE FFL */
7944 {L"en-US", LCMAP_UPPERCASE, 0xFB05}, /* LATIN SMALL LIGATURE LONG S T */
7945 {L"en-US", LCMAP_UPPERCASE, 0xFB06}, /* LATIN SMALL LIGATURE ST */
7947 {L"hy-AM", LCMAP_UPPERCASE, 0x0587}, /* ARMENIAN SMALL LIGATURE ECH YIWN */
7948 {L"hy-AM", LCMAP_UPPERCASE, 0xFB13}, /* ARMENIAN SMALL LIGATURE MEN NOW */
7949 {L"hy-AM", LCMAP_UPPERCASE, 0xFB14}, /* ARMENIAN SMALL LIGATURE MEN ECH */
7950 {L"hy-AM", LCMAP_UPPERCASE, 0xFB15}, /* ARMENIAN SMALL LIGATURE MEN INI */
7951 {L"hy-AM", LCMAP_UPPERCASE, 0xFB16}, /* ARMENIAN SMALL LIGATURE VEW NOW */
7952 {L"hy-AM", LCMAP_UPPERCASE, 0xFB17}, /* ARMENIAN SMALL LIGATURE MEN XEH */
7954 {L"en-US", LCMAP_UPPERCASE, 0x0149}, /* LATIN SMALL LETTER N PRECEDED BY APOSTROPHE */
7955 {L"el-GR", LCMAP_UPPERCASE, 0x0390,0,0,TRUE /*win7*/ }, /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */
7956 {L"el-GR", LCMAP_UPPERCASE, 0x03B0,0,0,TRUE /*win7*/ }, /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */
7957 {L"en-US", LCMAP_UPPERCASE, 0x01F0}, /* LATIN SMALL LETTER J WITH CARON */
7958 {L"en-US", LCMAP_UPPERCASE, 0x1E96}, /* LATIN SMALL LETTER H WITH LINE BELOW */
7959 {L"en-US", LCMAP_UPPERCASE, 0x1E97}, /* LATIN SMALL LETTER T WITH DIAERESIS */
7960 {L"en-US", LCMAP_UPPERCASE, 0x1E98}, /* LATIN SMALL LETTER W WITH RING ABOVE */
7961 {L"en-US", LCMAP_UPPERCASE, 0x1E99}, /* LATIN SMALL LETTER Y WITH RING ABOVE */
7962 {L"en-US", LCMAP_UPPERCASE, 0x1E9A}, /* LATIN SMALL LETTER A WITH RIGHT HALF RING */
7963 {L"el-GR", LCMAP_UPPERCASE, 0x1F50}, /* GREEK SMALL LETTER UPSILON WITH PSILI */
7964 {L"el-GR", LCMAP_UPPERCASE, 0x1F52}, /* GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA */
7965 {L"el-GR", LCMAP_UPPERCASE, 0x1F54}, /* GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA */
7966 {L"el-GR", LCMAP_UPPERCASE, 0x1F56}, /* GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI */
7967 {L"el-GR", LCMAP_UPPERCASE, 0x1FB6}, /* GREEK SMALL LETTER ALPHA WITH PERISPOMENI */
7968 {L"el-GR", LCMAP_UPPERCASE, 0x1FC6}, /* GREEK SMALL LETTER ETA WITH PERISPOMENI */
7969 {L"el-GR", LCMAP_UPPERCASE, 0x1FD2}, /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA */
7970 {L"el-GR", LCMAP_UPPERCASE, 0x1FD3}, /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA */
7971 {L"el-GR", LCMAP_UPPERCASE, 0x1FD6}, /* GREEK SMALL LETTER IOTA WITH PERISPOMENI */
7972 {L"el-GR", LCMAP_UPPERCASE, 0x1FD7}, /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI */
7973 {L"el-GR", LCMAP_UPPERCASE, 0x1FE2}, /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA */
7974 {L"el-GR", LCMAP_UPPERCASE, 0x1FE3}, /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA */
7975 {L"el-GR", LCMAP_UPPERCASE, 0x1FE4}, /* GREEK SMALL LETTER RHO WITH PSILI */
7976 {L"el-GR", LCMAP_UPPERCASE, 0x1FE6}, /* GREEK SMALL LETTER UPSILON WITH PERISPOMENI */
7977 {L"el-GR", LCMAP_UPPERCASE, 0x1FE7}, /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI */
7978 {L"el-GR", LCMAP_UPPERCASE, 0x1FF6}, /* GREEK SMALL LETTER OMEGA WITH PERISPOMENI */
7980 {L"el-GR", LCMAP_UPPERCASE, 0x1F80,0x1F88}, /* GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI */
7981 {L"el-GR", LCMAP_UPPERCASE, 0x1F81,0x1F89}, /* GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI */
7982 {L"el-GR", LCMAP_UPPERCASE, 0x1F82,0x1F8A}, /* GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI */
7983 {L"el-GR", LCMAP_UPPERCASE, 0x1F83,0x1F8B}, /* GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI */
7984 {L"el-GR", LCMAP_UPPERCASE, 0x1F84,0x1F8C}, /* GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI */
7985 {L"el-GR", LCMAP_UPPERCASE, 0x1F85,0x1F8D}, /* GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI */
7986 {L"el-GR", LCMAP_UPPERCASE, 0x1F86,0x1F8E}, /* GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI */
7987 {L"el-GR", LCMAP_UPPERCASE, 0x1F87,0x1F8F}, /* GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI */
7989 {L"el-GR", LCMAP_LOWERCASE, 0x1F88,0x1F80}, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI */
7990 {L"el-GR", LCMAP_LOWERCASE, 0x1F89,0x1F81}, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI */
7991 {L"el-GR", LCMAP_LOWERCASE, 0x1F8A,0x1F82}, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI */
7992 {L"el-GR", LCMAP_LOWERCASE, 0x1F8B,0x1F83}, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI */
7993 {L"el-GR", LCMAP_LOWERCASE, 0x1F8C,0x1F84}, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI */
7994 {L"el-GR", LCMAP_LOWERCASE, 0x1F8D,0x1F85}, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI */
7995 {L"el-GR", LCMAP_LOWERCASE, 0x1F8E,0x1F86}, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */
7996 {L"el-GR", LCMAP_LOWERCASE, 0x1F8F,0x1F87}, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */
7998 {L"el-GR", LCMAP_UPPERCASE, 0x1F90,0x1F98}, /* GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI */
7999 {L"el-GR", LCMAP_UPPERCASE, 0x1F91,0x1F99}, /* GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI */
8000 {L"el-GR", LCMAP_UPPERCASE, 0x1F92,0x1F9A}, /* GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI */
8001 {L"el-GR", LCMAP_UPPERCASE, 0x1F93,0x1F9B}, /* GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI */
8002 {L"el-GR", LCMAP_UPPERCASE, 0x1F94,0x1F9C}, /* GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI */
8003 {L"el-GR", LCMAP_UPPERCASE, 0x1F95,0x1F9D}, /* GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI */
8004 {L"el-GR", LCMAP_UPPERCASE, 0x1F96,0x1F9E}, /* GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI */
8005 {L"el-GR", LCMAP_UPPERCASE, 0x1F97,0x1F9F}, /* GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI */
8007 {L"el-GR", LCMAP_LOWERCASE, 0x1FA8,0x1FA0}, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI */
8008 {L"el-GR", LCMAP_LOWERCASE, 0x1FA9,0x1FA1}, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI */
8009 {L"el-GR", LCMAP_LOWERCASE, 0x1FAA,0x1FA2}, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI */
8010 {L"el-GR", LCMAP_LOWERCASE, 0x1FAB,0x1FA3}, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI */
8011 {L"el-GR", LCMAP_LOWERCASE, 0x1FAC,0x1FA4}, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI */
8012 {L"el-GR", LCMAP_LOWERCASE, 0x1FAD,0x1FA5}, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI */
8013 {L"el-GR", LCMAP_LOWERCASE, 0x1FAE,0x1FA6}, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */
8014 {L"el-GR", LCMAP_LOWERCASE, 0x1FAF,0x1FA7}, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */
8016 {L"el-GR", LCMAP_UPPERCASE, 0x1FB3,0x1FBC}, /* GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI */
8017 {L"el-GR", LCMAP_LOWERCASE, 0x1FBC,0x1FB3}, /* GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI */
8019 {L"el-GR", LCMAP_UPPERCASE, 0x1FC3,0x1FCC,0, TRUE /* Vista */}, /* GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI */
8020 {L"el-GR", LCMAP_LOWERCASE, 0x1FCC,0x1FC3,0, TRUE /* Vista */}, /* GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI */
8021 {L"el-GR", LCMAP_UPPERCASE, 0x1FF3,0x1FFC,0, TRUE /* Vista */}, /* GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI */
8022 {L"el-GR", LCMAP_LOWERCASE, 0x1FFC,0x1FF3,0, TRUE /* Vista */}, /* GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI */
8024 {L"el-GR", LCMAP_UPPERCASE, 0x1FC3,0x1FCC}, /* GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI */
8025 {L"el-GR", LCMAP_LOWERCASE, 0x1FCC,0x1FC3}, /* GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI */
8026 {L"el-GR", LCMAP_UPPERCASE, 0x1FF3,0x1FFC}, /* GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI */
8027 {L"el-GR", LCMAP_LOWERCASE, 0x1FFC,0x1FF3}, /* GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI */
8030 {L"el-GR", LCMAP_UPPERCASE, 0x1FB2}, /* GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI */
8031 {L"el-GR", LCMAP_UPPERCASE, 0x1FB4}, /* GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI */
8032 {L"el-GR", LCMAP_UPPERCASE, 0x1FC2}, /* GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI */
8033 {L"el-GR", LCMAP_UPPERCASE, 0x1FC4}, /* GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI */
8034 {L"el-GR", LCMAP_UPPERCASE, 0x1FF2}, /* GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI */
8035 {L"el-GR", LCMAP_UPPERCASE, 0x1FF4}, /* GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI */
8037 {L"el-GR", LCMAP_UPPERCASE, 0x1FB7}, /* GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI */
8038 {L"el-GR", LCMAP_UPPERCASE, 0x1FC7}, /* GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI */
8039 {L"el-GR", LCMAP_UPPERCASE, 0x1FF7}, /* GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI */
8041 {L"el-GR", LCMAP_LOWERCASE, 0x03A3,0x03C3}, /* GREEK CAPITAL LETTER SIGMA */
8043 {L"lt-LT", LCMAP_LOWERCASE, 'J
','j'}, /* LATIN CAPITAL LETTER J */
8044 {L"lt-LT", LCMAP_LOWERCASE, 0x012E,0x012F}, /* LATIN CAPITAL LETTER I WITH OGONEK */
8045 {L"lt-LT", LCMAP_LOWERCASE, 0x00CC,0x00EC}, /* LATIN CAPITAL LETTER I WITH GRAVE */
8046 {L"lt-LT", LCMAP_LOWERCASE, 0x00CD,0x00ED}, /* LATIN CAPITAL LETTER I WITH ACUTE */
8047 {L"lt-LT", LCMAP_LOWERCASE, 0x0128,0x0129}, /* LATIN CAPITAL LETTER I WITH TILDE */
8049 {L"en-US", LCMAP_UPPERCASE, 'i', 'I'}, /* LATIN SMALL LETTER I */
8050 {L"lt-LT", LCMAP_UPPERCASE, 'i', 'I'}, /* LATIN SMALL LETTER I */
8051 {L"tr-TR", LCMAP_UPPERCASE, 'i', 'I', 0x0130}, /* LATIN SMALL LETTER I */
8052 {L"TR-TR", LCMAP_UPPERCASE, 'i', 'I', 0x0130}, /* LATIN SMALL LETTER I */
8053 {L"az-Cyrl-az", LCMAP_UPPERCASE, 'i', 'I', 0x0130, TRUE /*win7*/}, /* LATIN SMALL LETTER I */
8054 {L"az-Latn-az", LCMAP_UPPERCASE, 'i', 'I', 0x0130}, /* LATIN SMALL LETTER I */
8056 {L"en-US", LCMAP_LOWERCASE, 'I', 'i'}, /* LATIN CAPITAL LETTER I */
8057 {L"lt-LT", LCMAP_LOWERCASE, 'I', 'i'}, /* LATIN CAPITAL LETTER I */
8058 {L"tr-TR", LCMAP_LOWERCASE, 'I', 'i', 0x0131}, /* LATIN CAPITAL LETTER I */
8059 {L"TR-TR", LCMAP_LOWERCASE, 'I', 'i', 0x0131}, /* LATIN CAPITAL LETTER I */
8060 {L"az-Cyrl-az", LCMAP_LOWERCASE, 'I', 'i', 0x0131, TRUE /*win7*/}, /* LATIN CAPITAL LETTER I */
8061 {L"az-Latn-az", LCMAP_LOWERCASE, 'I', 'i', 0x0131}, /* LATIN CAPITAL LETTER I */
8063 {L"en-US", LCMAP_LOWERCASE, 0x0130,0,'i'}, /* LATIN CAPITAL LETTER I WITH DOT ABOVE */
8064 {L"tr-TR", LCMAP_LOWERCASE, 0x0130,0,'i'}, /* LATIN CAPITAL LETTER I WITH DOT ABOVE */
8065 {L"TR-TR", LCMAP_LOWERCASE, 0x0130,0,'i'}, /* LATIN CAPITAL LETTER I WITH DOT ABOVE */
8066 {L"az-Cyrl-az", LCMAP_LOWERCASE, 0x0130,0,'i'}, /* LATIN CAPITAL LETTER I WITH DOT ABOVE */
8067 {L"az-Latn-az", LCMAP_LOWERCASE, 0x0130,0,'i'}, /* LATIN CAPITAL LETTER I WITH DOT ABOVE */
8069 {L"en-US", LCMAP_UPPERCASE, 0x0131,0,'I'}, /* LATIN SMALL LETTER DOTLESS I */
8070 {L"tr-TR", LCMAP_UPPERCASE, 0x0131,0,'I'}, /* LATIN SMALL LETTER DOTLESS I */
8071 {L"TR-TR", LCMAP_UPPERCASE, 0x0131,0,'I'}, /* LATIN SMALL LETTER DOTLESS I */
8072 {L"az-Cyrl-az", LCMAP_UPPERCASE, 0x0131,0,'I'}, /* LATIN SMALL LETTER DOTLESS I */
8073 {L"az-Latn-az", LCMAP_UPPERCASE, 0x0131,0,'I'}, /* LATIN SMALL LETTER DOTLESS I */
8075 {L"en-US", LCMAP_LOWERCASE, 0x10418,0x10440,0,TRUE /*win7*/}, /* DESERET CAPITAL LETTER GAY */
8076 {L"en-US", LCMAP_UPPERCASE, 0x10431,0x10409,0,TRUE /*win7*/}, /* DESERET SMALL LETTER SHORT AH */
8079 if (!pLCMapStringEx)
8081 win_skip("LCMapStringEx not available\n");
8085 for (i = 0; i < ARRAY_SIZE(tests); i++)
8087 memset(buffer, 0, sizeof(buffer));
8088 len = put_utf16( src, tests[i].ch );
8089 ret = pLCMapStringEx(tests[i].lang, tests[i].flags,
8090 src, len, buffer, ARRAY_SIZE(buffer), NULL, NULL, 0);
8091 len = get_utf16( buffer, ret, &val );
8092 ok(ret == len, "got %d for %04x for %s\n", ret, tests[i].ch, wine_dbgstr_w(tests[i].lang));
8093 exp = tests[i].exp ? tests[i].exp : tests[i].ch;
8094 ok(val == exp || broken(tests[i].broken),
8095 "expected %04x, got %04x for %04x for %s\n",
8096 exp, val, tests[i].ch, wine_dbgstr_w(tests[i].lang));
8098 memset(buffer, 0, sizeof(buffer));
8099 len = put_utf16( src, tests[i].ch );
8100 ret = pLCMapStringEx(tests[i].lang, tests[i].flags|LCMAP_LINGUISTIC_CASING,
8101 src, len, buffer, ARRAY_SIZE(buffer), NULL, NULL, 0);
8102 len = get_utf16( buffer, ret, &val );
8103 ok(ret == len, "got %d for %04x for %s\n", ret, tests[i].ch, wine_dbgstr_w(tests[i].lang));
8104 exp = tests[i].exp_ling ? tests[i].exp_ling : exp;
8105 ok(val == exp || broken(tests[i].broken),
8106 "expected %04x, got %04x for %04x for %s\n",
8107 exp, val, tests[i].ch, wine_dbgstr_w(tests[i].lang));
8111static void test_NLSVersion(void)
8113 static const GUID guid_null = { 0 };
8114 static const GUID guid_def = { 0x000000001, 0x57ee, 0x1e5c, {0x00,0xb4,0xd0,0x00,0x0b,0xb1,0xe1,0x1e}};
8115 static const GUID guid_fr = { 0x000000003, 0x57ee, 0x1e5c, {0x00,0xb4,0xd0,0x00,0x0b,0xb1,0xe1,0x1e}};
8116 static const GUID guid_ja = { 0x000000046, 0x57ee, 0x1e5c, {0x00,0xb4,0xd0,0x00,0x0b,0xb1,0xe1,0x1e}};
8118 NLSVERSIONINFOEX info;
8120 if (!pGetNLSVersion)
8122 win_skip( "GetNLSVersion not available\n" );
8126 SetLastError( 0xdeadbeef );
8127 memset( &info, 0xcc, sizeof(info) );
8128 info.dwNLSVersionInfoSize = offsetof( NLSVERSIONINFO, dwEffectiveId );
8129 ret = pGetNLSVersion( COMPARE_STRING, MAKELANGID( LANG_FRENCH, SUBLANG_FRENCH_CANADIAN ),
8130 (NLSVERSIONINFO *)&info );
8131 ok( ret, "GetNLSVersion failed err %lu\n", GetLastError() );
8133 SetLastError( 0xdeadbeef );
8134 memset( &info, 0xcc, sizeof(info) );
8135 info.dwNLSVersionInfoSize = sizeof(info);
8136 ret = pGetNLSVersion( COMPARE_STRING, MAKELANGID( LANG_FRENCH, SUBLANG_FRENCH_CANADIAN ),
8137 (NLSVERSIONINFO *)&info );
8138 ok( ret || GetLastError() == ERROR_INSUFFICIENT_BUFFER /* < Vista */,
8139 "GetNLSVersion failed err %lu\n", GetLastError() );
8142 ok( info.dwEffectiveId == MAKELANGID( LANG_FRENCH, SUBLANG_FRENCH_CANADIAN ),
8143 "wrong id %lx\n", info.dwEffectiveId );
8144 ok( IsEqualIID( &info.guidCustomVersion, &guid_fr ) ||
8145 broken( IsEqualIID( &info.guidCustomVersion, &guid_null )), /* <= win7 */
8146 "wrong guid %s\n", debugstr_guid(&info.guidCustomVersion) );
8149 SetLastError( 0xdeadbeef );
8150 info.dwNLSVersionInfoSize = 8;
8151 ret = pGetNLSVersion( COMPARE_STRING, LOCALE_USER_DEFAULT, (NLSVERSIONINFO *)&info );
8152 ok( !ret, "GetNLSVersion succeeded\n" );
8153 ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "wrong error %lu\n", GetLastError() );
8155 SetLastError( 0xdeadbeef );
8156 info.dwNLSVersionInfoSize = sizeof(info);
8157 ret = pGetNLSVersion( 2, LOCALE_USER_DEFAULT, (NLSVERSIONINFO *)&info );
8158 ok( !ret, "GetNLSVersion succeeded\n" );
8159 ok( GetLastError() == ERROR_INVALID_FLAGS ||
8160 broken( GetLastError() == ERROR_INSUFFICIENT_BUFFER ), /* win2003 */
8161 "wrong error %lu\n", GetLastError() );
8163 SetLastError( 0xdeadbeef );
8164 info.dwNLSVersionInfoSize = sizeof(info);
8165 ret = pGetNLSVersion( COMPARE_STRING, 0xdeadbeef, (NLSVERSIONINFO *)&info );
8166 ok( !ret, "GetNLSVersion succeeded\n" );
8167 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
8173 if (pGetNLSVersionEx)
8178 info.dwNLSVersionInfoSize =
sizeof(
info);
8182 "wrong id %lx\n",
info.dwEffectiveId );
8186 trace(
"version %08lx %08lx %08lx %s\n",
info.dwNLSVersion,
info.dwDefinedVersion,
info.dwEffectiveId,
8191 info.dwNLSVersionInfoSize =
sizeof(
info);
8193 ok( !
ret == !pIsValidLocaleName(
L"fr"),
"GetNLSVersionEx doesn't match IsValidLocaleName\n" );
8197 "wrong id %lx\n",
info.dwEffectiveId );
8204 info.dwNLSVersionInfoSize =
sizeof(
info) - 1;
8206 ok( !
ret,
"GetNLSVersionEx succeeded\n" );
8214 ok(
info.dwEffectiveId == 0xcccccccc,
"wrong id %lx\n",
info.dwEffectiveId );
8217 info.dwNLSVersionInfoSize =
sizeof(
info);
8218 ret = pGetNLSVersionEx( 2,
L"en-US", &
info );
8219 ok( !
ret,
"GetNLSVersionEx succeeded\n" );
8223 info.dwNLSVersionInfoSize =
sizeof(
info);
8225 ok( !
ret,
"GetNLSVersionEx succeeded\n" );
8230 info.dwNLSVersionInfoSize =
sizeof(
info);
8233 ok( !
ret == !pIsValidLocaleName(
L"zz-XX"),
"GetNLSVersionEx doesn't match IsValidLocaleName\n" );
8243 info.dwNLSVersionInfoSize =
sizeof(
info);
8255 else win_skip(
"GetNLSVersionEx not available\n" );
8257 if (pIsValidNLSVersion)
8259 info.dwNLSVersionInfoSize =
sizeof(
info);
8263 info.dwNLSVersionInfoSize =
sizeof(
info);
8275 info.dwNLSVersionInfoSize =
sizeof(
info);
8276 ret = pIsValidNLSVersion( 2,
L"en-US", &
info );
8277 ok( !
ret,
"IsValidNLSVersion succeeded\n" );
8281 info.dwNLSVersionInfoSize =
sizeof(
info);
8283 ok( !
ret,
"IsValidNLSVersion succeeded\n" );
8288 info.dwNLSVersionInfoSize =
sizeof(
info);
8290 ok( !
ret,
"IsValidNLSVersion succeeded\n" );
8293 info.dwNLSVersionInfoSize =
sizeof(
info);
8295 info.dwNLSVersion++;
8301 info.dwNLSVersion += 0x700;
8304 ok( !
ret,
"IsValidNLSVersion succeeded\n" );
8307 info.dwNLSVersion -= 2 * 0x700;
8310 ok( !
ret,
"IsValidNLSVersion succeeded\n" );
8313 info.dwNLSVersion += 0x700;
8314 info.dwDefinedVersion += 0x100;
8320 info.dwDefinedVersion -= 0x100;
8321 info.guidCustomVersion.Data1 = 0x123;
8324 ok( !
ret,
"IsValidNLSVersion succeeded\n" );
8327 info.guidCustomVersion = guid_null;
8333 else win_skip(
"IsValidNLSVersion not available\n" );
8335 if (pIsNLSDefinedString)
8338 info.dwNLSVersionInfoSize =
sizeof(
info);
8347 info.dwNLSVersionInfoSize =
sizeof(
info) + 1;
8349 ok( !
ret,
"IsNLSDefinedString succeeded\n" );
8366 ok( !
ret,
"IsNLSDefinedString succeeded\n" );
8395 else win_skip(
"IsNLSDefinedString not available\n" );
8406 if (!pNtInitializeNlsFiles || !pRtlGetLocaleFileMappingAddress)
8408 win_skip(
"locale.nls functions not supported\n" );
8411 size.QuadPart = 0xdeadbeef;
8417 "wrong offset %x / %I64x\n",
ptr[4],
size.QuadPart );
8419 ok(
ptr[0] == 8,
"wrong offset %u\n",
ptr[0] );
8420 ok(
ptr[3] == 0x5344534e,
"wrong magic %x\n",
ptr[3] );
8424 ok(
addr != addr2,
"got same address %p\n",
addr );
8431 size.QuadPart = 0xdeadbeef;
8436 "wrong offset %x / %I64x\n",
ptr[4],
size.QuadPart );
8438 ok(
ptr[0] == 8,
"wrong offset %u\n",
ptr[0] );
8439 ok(
ptr[3] == 0x5344534e,
"wrong magic %x\n",
ptr[3] );
8442 status = pRtlGetLocaleFileMappingAddress( &addr2, &
lcid, &
size );
8444 ok(
addr == addr2,
"got different address %p / %p\n",
addr, addr2 );
8458 if (!pSetUserGeoName || !pGetUserDefaultGeoName)
8460 win_skip(
"GetUserDefaultGeoName / SetUserGeoName is not available, skipping test.\n");
8475 if ((
ret = pGetUserDefaultGeoName(
NULL, 0)) == 1)
8486 win_skip(
"Geo names are not available, skipping test.\n");
8490 size =
sizeof(nation);
8493 size =
sizeof(region);
8498 ret = pGetUserDefaultGeoName(
NULL, 0);
8503 ret = pGetUserDefaultGeoName(
buf, 0);
8507 ret = pGetUserDefaultGeoName(
buf, 2);
8511 ret = pGetUserDefaultGeoName(
NULL, 1);
8515 ret = pGetUserDefaultGeoName(
NULL, name_size);
8519 ret = pGetUserDefaultGeoName(
buf, name_size);
8524 bret = pSetUserGeoName(
NULL);
8536 "Got unexpected bret %#x, GetLastError() %lu.\n", bret,
GetLastError());
8543 ok(geoid == 39070,
"Got unexpected geoid %lu.\n", geoid);
8554 "Got unexpected bret %#x, GetLastError() %lu.\n", bret,
GetLastError());
8560 ok(geoid == 11,
"Got unexpected geoid %lu.\n", geoid);
8566 "Got unexpected bret %#x, GetLastError() %lu.\n", bret,
GetLastError());
8572 ok(geoid == 11,
"Got unexpected geoid %lu.\n", geoid);
8580 ok(bret,
"Got unexpected bret %#x, GetLastError() %lu.\n", bret,
GetLastError());
8587 ok(bret,
"Got unexpected bret %#x, GetLastError() %lu.\n", bret,
GetLastError());
8594 ok(bret,
"Got unexpected bret %#x, GetLastError() %lu.\n", bret,
GetLastError());
8698 ok(
ret,
"EnumCalendarInfoA for user default locale failed: %lu\n",
GetLastError() );
8702 ok(
ret,
"EnumCalendarInfoA for user default locale failed: %lu\n",
GetLastError() );
8729 ok(
ret,
"EnumCalendarInfoW for user default locale failed: %lu\n",
GetLastError() );
8733 ok(
ret,
"EnumCalendarInfoW for user default locale failed: %lu\n",
GetLastError() );
8760 ok(
ret,
"EnumCalendarInfoExA for user default locale failed: %lu\n",
GetLastError() );
8764 ok(
ret,
"EnumCalendarInfoExA for user default locale failed: %lu\n",
GetLastError() );
8772 "EnumCalendarInfoExA for LCID %#06lx failed: %lu\n",
lcid,
GetLastError() );
8791 ok(
ret,
"EnumCalendarInfoExW for user default locale failed: %lu\n",
GetLastError() );
8795 ok(
ret,
"EnumCalendarInfoExW for user default locale failed: %lu\n",
GetLastError() );
8803 "EnumCalendarInfoExW for LCID %#06lx failed: %lu\n",
lcid,
GetLastError() );
8837 while (*
p ==
' ' || *
p ==
'\t')
p++;
8838 if (*
p ==
'#')
continue;
8840 while (*
p && *
p !=
';' && *
p !=
'-')
8843 if (
end ==
p)
break;
8851 while (*
p ==
' ' || *
p ==
'\t')
p++;
8854#if !defined(__REACTOS__) || DLL_EXPORT_VERSION >= 0x600
8872#if defined(__REACTOS__) && DLL_EXPORT_VERSION < 0x600
8873 skip(
"Cannot build test_EnumDateFormatsExEx() unless DLL_EXPORT_VERSION >= 0x600.\n");
8881 ok(!
ret,
"EnumDateFormatsExEx succeeded.\n");
8890 "EnumDateFormatsExEx failed, error %#lx.\n",
error);
8895 "EnumDateFormatsExEx failed, error %#lx.\n",
error);
NTSTATUS NTAPI NtUnmapViewOfSection(IN HANDLE ProcessHandle, IN PVOID BaseAddress)
BOOL WINAPI EnumSystemLocalesEx(LOCALE_ENUMPROCEX proc, DWORD flags, LPARAM lparam, LPVOID reserved)
INT WINAPI GetLocaleInfoEx(LPCWSTR locale, LCTYPE info, LPWSTR buffer, INT len)
FN_GetLocaleInfoEx * pGetLocaleInfoEx
int WINAPI LCIDToLocaleName(_In_ LCID Locale, _Out_writes_opt_(cchName) LPWSTR lpName, _In_ int cchName, _In_ DWORD dwFlags)
std::map< E_MODULE, HMODULE > mod
FN_RtlLocaleNameToLcid * pRtlLocaleNameToLcid
FN_RtlLcidToLocaleName * pRtlLcidToLocaleName
ios_base &_STLP_CALL dec(ios_base &__s)
#define RegCloseKey(hKey)
#define ERROR_INSUFFICIENT_BUFFER
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
static WCHAR available[MAX_STRING_RESOURCE_LEN]
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define GetCurrentProcess()
#define HeapFree(x, y, z)
#define MultiByteToWideChar
#define ERROR_INVALID_NAME
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
LCID WINAPI LocaleNameToLCID(_In_ LPCWSTR lpName, _In_ DWORD dwFlags)
GEOID WINAPI GetUserGeoID(GEOCLASS GeoClass)
#define LOCALE_NAME_USER_DEFAULT
LCID WINAPI GetThreadLocale(void)
BOOL WINAPI EnumSystemLocalesW(LOCALE_ENUMPROCW lpfnLocaleEnum, DWORD dwFlags)
LANGID WINAPI SetThreadUILanguage(LANGID langid)
INT WINAPI LCMapStringA(LCID lcid, DWORD flags, LPCSTR src, INT srclen, LPSTR dst, INT dstlen)
INT WINAPI ResolveLocaleName(LPCWSTR name, LPWSTR localename, INT len)
BOOL WINAPI IsValidLanguageGroup(LGRPID lgrpid, DWORD dwFlags)
INT WINAPI FoldStringA(DWORD dwFlags, LPCSTR src, INT srclen, LPSTR dst, INT dstlen)
INT WINAPI NormalizeString(NORM_FORM NormForm, LPCWSTR lpSrcString, INT cwSrcLength, LPWSTR lpDstString, INT cwDstLength)
INT WINAPI CompareStringA(LCID lcid, DWORD flags, LPCSTR str1, INT len1, LPCSTR str2, INT len2)
INT WINAPI IdnToUnicode(DWORD dwFlags, LPCWSTR lpASCIICharStr, INT cchASCIIChar, LPWSTR lpUnicodeCharStr, INT cchUnicodeChar)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
INT WINAPI CompareStringW(LCID lcid, DWORD flags, LPCWSTR str1, INT len1, LPCWSTR str2, INT len2)
BOOL WINAPI SetUserGeoID(GEOID GeoID)
LANGID WINAPI GetUserDefaultUILanguage(void)
BOOL WINAPI GetSystemPreferredUILanguages(DWORD flags, ULONG *count, WCHAR *buffer, ULONG *size)
BOOL WINAPI GetCPInfoExW(UINT codepage, DWORD dwFlags, LPCPINFOEXW cpinfo)
INT WINAPI GetLocaleInfoA(LCID lcid, LCTYPE lctype, LPSTR buffer, INT len)
BOOL WINAPI GetCPInfo(UINT codepage, LPCPINFO cpinfo)
INT WINAPI GetGeoInfoW(GEOID geoid, GEOTYPE geotype, LPWSTR data, int data_len, LANGID lang)
BOOL WINAPI IsValidLocaleName(LPCWSTR locale)
INT WINAPI IdnToAscii(DWORD dwFlags, LPCWSTR lpUnicodeCharStr, INT cchUnicodeChar, LPWSTR lpASCIICharStr, INT cchASCIIChar)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
BOOL WINAPI EnumSystemLocalesA(LOCALE_ENUMPROCA lpfnLocaleEnum, DWORD dwFlags)
INT WINAPI LCMapStringEx(LPCWSTR locale, DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst, INT dstlen, LPNLSVERSIONINFO version, LPVOID reserved, LPARAM handle)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
BOOL WINAPI GetStringTypeW(DWORD type, LPCWSTR src, INT count, LPWORD chartype)
BOOL WINAPI IsValidLocale(LCID lcid, DWORD flags)
INT WINAPI GetSystemDefaultLocaleName(LPWSTR localename, INT len)
INT WINAPI FoldStringW(DWORD dwFlags, LPCWSTR src, INT srclen, LPWSTR dst, INT dstlen)
BOOL WINAPI GetThreadPreferredUILanguages(DWORD flags, ULONG *count, WCHAR *buf, ULONG *size)
LCID WINAPI GetUserDefaultLCID(void)
INT WINAPI CompareStringEx(LPCWSTR locale, DWORD flags, LPCWSTR str1, INT len1, LPCWSTR str2, INT len2, LPNLSVERSIONINFO version, LPVOID reserved, LPARAM lParam)
LCID WINAPI GetSystemDefaultLCID(void)
BOOL WINAPI EnumUILanguagesA(UILANGUAGE_ENUMPROCA pUILangEnumProc, DWORD dwFlags, LONG_PTR lParam)
INT WINAPI LCMapStringW(LCID lcid, DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst, INT dstlen)
BOOL WINAPI EnumSystemGeoID(GEOCLASS geoclass, GEOID parent, GEO_ENUMPROC enumproc)
BOOL WINAPI GetCPInfoExA(UINT codepage, DWORD dwFlags, LPCPINFOEXA cpinfo)
BOOL WINAPI EnumLanguageGroupLocalesA(LANGGROUPLOCALE_ENUMPROCA pLangGrpLcEnumProc, LGRPID lgrpid, DWORD dwFlags, LONG_PTR lParam)
BOOL WINAPI EnumSystemLanguageGroupsA(LANGUAGEGROUP_ENUMPROCA pLangGrpEnumProc, DWORD dwFlags, LONG_PTR lParam)
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
BOOL WINAPI SetLocaleInfoA(LCID lcid, LCTYPE lctype, LPCSTR data)
INT WINAPI GetGeoInfoA(GEOID geoid, GEOTYPE geotype, LPSTR data, int data_len, LANGID lang)
LCID WINAPI ConvertDefaultLocale(LCID lcid)
BOOL WINAPI SetLocaleInfoW(LCID lcid, LCTYPE lctype, LPCWSTR data)
INT WINAPI IdnToNameprepUnicode(DWORD dwFlags, LPCWSTR lpUnicodeCharStr, INT cchUnicodeChar, LPWSTR lpNameprepCharStr, INT cchNameprepChar)
BOOL WINAPI DECLSPEC_HOTPATCH EnumDateFormatsExEx(DATEFMT_ENUMPROCEXEX proc, const WCHAR *locale, DWORD flags, LPARAM lparam)
BOOL WINAPI DECLSPEC_HOTPATCH IsNLSDefinedString(NLS_FUNCTION func, DWORD flags, NLSVERSIONINFO *info, const WCHAR *str, int len)
static int put_utf16(WCHAR *dst, int pos, int dstlen, unsigned int ch)
BOOL WINAPI DECLSPEC_HOTPATCH EnumCalendarInfoExW(CALINFO_ENUMPROCEXW proc, LCID lcid, CALID id, CALTYPE type)
INT WINAPI DECLSPEC_HOTPATCH GetGeoInfoEx(WCHAR *location, GEOTYPE type, WCHAR *data, int data_count)
int WINAPI GetNumberFormatEx(const WCHAR *name, DWORD flags, const WCHAR *value, const NUMBERFMTW *format, WCHAR *buffer, int len)
int WINAPI GetDateFormatEx(const WCHAR *name, DWORD flags, const SYSTEMTIME *systime, const WCHAR *format, WCHAR *buffer, int len, const WCHAR *calendar)
INT WINAPI GetUserDefaultGeoName(LPWSTR geo_name, int count)
INT WINAPI DECLSPEC_HOTPATCH FindStringOrdinal(DWORD flag, const WCHAR *src, INT src_size, const WCHAR *val, INT val_size, BOOL ignore_case)
BOOL WINAPI DECLSPEC_HOTPATCH GetNLSVersion(NLS_FUNCTION func, LCID lcid, NLSVERSIONINFO *info)
const NLS_LOCALE_DATA *WINAPI NlsValidateLocale(LCID *lcid, ULONG flags)
BOOL WINAPI DECLSPEC_HOTPATCH GetNLSVersionEx(NLS_FUNCTION func, const WCHAR *locale, NLSVERSIONINFOEX *info)
BOOL WINAPI DECLSPEC_HOTPATCH EnumCalendarInfoW(CALINFO_ENUMPROCW proc, LCID lcid, CALID id, CALTYPE type)
int WINAPI GetTimeFormatEx(const WCHAR *name, DWORD flags, const SYSTEMTIME *systime, const WCHAR *format, WCHAR *buffer, int len)
BOOL WINAPI SetUserGeoName(PWSTR geo_name)
INT WINAPI DECLSPEC_HOTPATCH CompareStringOrdinal(const WCHAR *str1, INT len1, const WCHAR *str2, INT len2, BOOL ignore_case)
INT WINAPI DECLSPEC_HOTPATCH FindNLSStringEx(const WCHAR *locale, DWORD flags, const WCHAR *src, int srclen, const WCHAR *value, int valuelen, int *found, NLSVERSIONINFO *version, void *reserved, LPARAM handle)
int WINAPI GetDateFormatW(LCID lcid, DWORD flags, const SYSTEMTIME *systime, const WCHAR *format, WCHAR *buffer, int len)
int WINAPI GetDateFormatA(LCID lcid, DWORD flags, const SYSTEMTIME *time, const char *format, char *buffer, int len)
DWORD WINAPI DECLSPEC_HOTPATCH IsValidNLSVersion(NLS_FUNCTION func, const WCHAR *locale, NLSVERSIONINFOEX *info)
int WINAPI GetTimeFormatA(LCID lcid, DWORD flags, const SYSTEMTIME *time, const char *format, char *buffer, int len)
BOOL WINAPI DECLSPEC_HOTPATCH EnumTimeFormatsW(TIMEFMT_ENUMPROCW proc, LCID lcid, DWORD flags)
LANGID WINAPI DECLSPEC_HOTPATCH GetThreadUILanguage(void)
int CDECL fclose(FILE *file)
int WINAPIV fprintf(FILE *file, const char *format,...)
char *CDECL fgets(char *s, int size, FILE *file)
FILE *CDECL fopen(const char *path, const char *mode)
_ACRTIMP int __cdecl swscanf(const wchar_t *, const wchar_t *,...)
_ACRTIMP __msvcrt_ulong __cdecl wcstoul(const wchar_t *, wchar_t **, int)
_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 wchar_t *__cdecl wcstok(wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl wcsncmp(const wchar_t *, const wchar_t *, size_t)
_ACRTIMP int __cdecl system(const char *)
_ACRTIMP void __cdecl qsort(void *, size_t, size_t, int(__cdecl *)(const void *, const void *))
_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 __msvcrt_ulong __cdecl strtoul(const char *, char **, int)
_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 strtok(char *, const char *)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
static const WCHAR month[12][4]
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLclampf GLclampf GLclampf alpha
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLsizei const GLchar *const * strings
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum const GLvoid * addr
GLuint64EXT GLuint GLuint GLenum GLenum GLuint GLuint GLenum GLuint GLuint key1
GLboolean GLboolean GLboolean GLboolean a
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
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 * u
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 GLint GLint j
static int is_utf8(const char *src)
static const WCHAR emptyW[]
NTSYSAPI NTSTATUS WINAPI RtlGetLocaleFileMappingAddress(void **, LCID *, LARGE_INTEGER *)
NTSYSAPI void WINAPI RtlInitCodePageTable(USHORT *, CPTABLEINFO *)
NTSYSAPI NTSTATUS WINAPI RtlLocaleNameToLcid(const WCHAR *, LCID *, ULONG)
NTSYSAPI NTSTATUS WINAPI RtlNormalizeString(ULONG, const WCHAR *, INT, WCHAR *, INT *)
NTSYSAPI BOOLEAN WINAPI RtlIsValidLocaleName(const WCHAR *, ULONG)
NTSYSAPI NTSTATUS WINAPI RtlGetThreadPreferredUILanguages(DWORD, ULONG *, WCHAR *, ULONG *)
NTSYSAPI NTSTATUS WINAPI RtlLcidToLocaleName(LCID, UNICODE_STRING *, ULONG, BOOLEAN)
NTSYSAPI NTSTATUS WINAPI RtlGetUserPreferredUILanguages(DWORD, ULONG, ULONG *, WCHAR *, ULONG *)
NTSYSAPI NTSTATUS WINAPI NtGetNlsSectionPtr(ULONG, ULONG, void *, void **, SIZE_T *)
NTSYSAPI NTSTATUS WINAPI RtlIsNormalizedString(ULONG, const WCHAR *, INT, BOOLEAN *)
NTSYSAPI NTSTATUS WINAPI NtInitializeNlsFiles(void **, LCID *, LARGE_INTEGER *)
NTSYSAPI NTSTATUS WINAPI RtlCustomCPToUnicodeN(CPTABLEINFO *, WCHAR *, DWORD, DWORD *, const char *, DWORD)
NTSYSAPI NTSTATUS WINAPI RtlGetSystemPreferredUILanguages(DWORD, ULONG, ULONG *, WCHAR *, ULONG *)
BOOL WINAPI GetUserPreferredUILanguages(DWORD dwFlags, PULONG pulNumLanguages, PZZWSTR pwszLanguagesBuffer, PULONG pcchLanguagesBuffer)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
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 memcpy(s1, s2, n)
static struct test_info tests[]
FN_LocaleNameToLCID * pLocaleNameToLCID
static void test_EnumDateFormatsExEx(void)
static LONG alternate_seen
static void test_FindStringOrdinal(void)
static BOOL is_idn_error(const WCHAR *str)
static int compare_string1(const void *e1, const void *e2)
static const SYSTEMTIME INT
static void *WINAPI * pNlsValidateLocale(LCID *, ULONG)
static void test_EnumSystemLanguageGroupsA(void)
static void test_SpecialCasing(void)
static void test_LCMapStringW(void)
static BOOL CALLBACK calinfoex_procA(LPSTR calinfo, LCID calid)
static void test_ConvertDefaultLocale(void)
static void test_IsValidLocaleName(void)
static const struct sorting_test_entry unicode_sorting_tests[]
#define expect_err(r, s, e)
static void test_CompareStringOrdinal(void)
static void test_sorting(void)
static const WCHAR title_case[]
static void expect_werr_(int line, int ret, const WCHAR *str, DWORD err, const char *err_name)
static BOOL CALLBACK EnumDateFormatsExEx_proc(LPWSTR date_format_string, CALID calendar_id, LPARAM lp)
#define CY_POS_LEFT_SPACE
static BOOL CALLBACK lgrplocale_procA(LGRPID lgrpid, LCID lcid, LPSTR lpszNum, LONG_PTR lParam)
static const WCHAR lower_case[]
static void test_GetTimeFormatA(void)
static BOOL CALLBACK enum_datetime_procW(WCHAR *fmt)
static BOOL CALLBACK test_geoid_enumproc2(GEOID geoid)
static void test_GetThreadPreferredUILanguages(void)
static void test_EnumSystemGeoID(void)
static UNICODE_STRING BYTE
static void test_IdnToUnicode(void)
#define expect_werr(r, s, e)
static BOOL CALLBACK test_EnumSystemLocalesW_callback(LPWSTR str)
static BOOL CALLBACK test_EnumSystemLocalesA_callback(LPSTR str)
static const WCHAR invalidW[]
static void dump_sortkeys(char *argv[])
static void test_EnumUILanguageA(void)
static void test_LCMapStringA(void)
static void test_Idn(void)
INT(* lcmapstring_wrapper)(DWORD, LPCWSTR, INT, LPWSTR, INT)
static void test_unicode_sorting(void)
static void test_CompareStringEx(void)
#define LCID_RES(src, res)
static BOOL CALLBACK enum_func(LPWSTR name, DWORD flags, LPARAM lparam)
static void test_GetCPInfo(void)
static void test_GetTimeFormatEx(void)
static ULONG WCHAR ULONG *static ULONG WCHAR ULONG *static ULONG WCHAR ULONG *static void InitFunctionPointers(void)
static void test_GetDateFormatW(void)
static void test_GetLocaleInfoW(void)
static void test_GetCurrencyFormatA(void)
static void test_EnumCalendarInfoExW(void)
static char date_fmt_buf[1024]
static const WCHAR localeW[]
static void test_EnumDateFormatsA(void)
static void test_GetDateFormatA(void)
static void test_GetUserPreferredUILanguages(void)
static const struct comparestringa_entry comparestringa_data[]
static void test_NLSVersion(void)
static const DWORD lcmap_invalid_flags[]
static const SYSTEMTIME LPWSTR
static void expect_wstr_(int line, int ret, const WCHAR *str, const WCHAR *expected)
static int geoidenum_count
static BOOL CALLBACK enum_datetime_procA(LPSTR fmt)
static void expect_str_(int line, int ret, const char *str, const char *expected)
static void test_invariant(void)
static const WCHAR upper_case[]
static void test_GetGeoInfo(void)
static void test_GetLocaleInfoEx(void)
static void test_geo_name(void)
static INT LCMapStringW_wrapper(DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst, INT dstlen)
static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *func_name)
static void test_GetNumberFormatEx(void)
static void test_IdnToAscii(void)
static void test_GetStringTypeW(void)
static BOOL CALLBACK langgrp_procA(LGRPID lgrpid, LPSTR lpszNum, LPSTR lpszName, DWORD dwFlags, LONG_PTR lParam)
static void test_EnumCalendarInfoA(void)
static void test_GetDateFormatEx(void)
static const LCID locales_with_optional_calendars[]
static BOOL CALLBACK luilocale_proc2A(LPSTR value, LONG_PTR lParam)
static void test_EnumLanguageGroupLocalesA(void)
static void test_SetThreadUILanguage(void)
static const struct comparestringex_test comparestringex_tests[]
static LPCWSTR lpStringSource
static const struct neutralsublang_name2_t neutralsublang_names2[]
static void test_IdnToNameprepUnicode(void)
static void test_LCMapStringEx(void)
static int compare_string2(const void *e1, const void *e2)
static BOOL CALLBACK calinfo_procW(LPWSTR calinfo)
static void test_EnumTimeFormatsA(void)
static const char *const strings_sorted[]
static void expect_err_(int line, int ret, const char *str, DWORD err, const char *err_name)
#define expect_wstr(r, s, e)
static void test_FindNLSStringEx(void)
static const WCHAR fooW[]
static void test_FoldStringA(void)
static INT LCMapStringEx_wrapper(DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst, INT dstlen)
static void test_SetLocaleInfo(void)
static void test_CompareStringW(void)
static void test_EnumSystemLocalesEx(void)
static WCHAR date_fmt_bufW[1024]
static const WCHAR symbols_stripped[]
static void test_EnumSystemLocalesA(void)
static void test_EnumTimeFormatsW(void)
static int get_utf16(const WCHAR *src, unsigned int srclen, unsigned int *ch)
static BOOL CALLBACK calinfoex_procW(LPWSTR calinfo, LCID calid)
static void test_EnumSystemLocalesW(void)
static void test_locale_nls(void)
static BOOL CALLBACK luilocale_proc1A(LPSTR value, LONG_PTR lParam)
static const struct neutralsublang_name_t neutralsublang_names[]
static void test_NormalizeString(void)
static void test_GetNumberFormatA(void)
#define TEST_LCIDLANG(a, b)
#define expect_str(r, s, e)
static void test_GetSystemPreferredUILanguages(void)
#define TEST_LCID(a, b, c)
static BOOL CALLBACK luilocale_proc3A(LPSTR value, LONG_PTR lParam)
static const struct invariant_entry invariant_list[]
static void test_CompareStringA(void)
static BOOL CALLBACK calinfo_procA(LPSTR calinfo)
static void test_GetLocaleInfoA(void)
static int compare_string3(const void *e1, const void *e2)
static void test_ResolveLocaleName(void)
static void test_EnumCalendarInfoExA(void)
#define CY_POS_RIGHT_SPACE
static void test_LocaleNameToLCID(void)
static void test_EnumCalendarInfoW(void)
static BOOL CALLBACK test_geoid_enumproc(GEOID geoid)
static void test_FoldStringW(void)
static DWORD LPDWORD LPCSTR DWORD srclen
static DWORD LPDWORD reslen
static const WCHAR dummyW[]
static const WCHAR dotW[]
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
WCHAR NTAPI RtlUpcaseUnicodeChar(_In_ WCHAR Source)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define LOCALE_NAME_MAX_LENGTH
#define SORT_JAPANESE_UNICODE
#define LOCALE_CUSTOM_UNSPECIFIED
#define LANG_SYSTEM_DEFAULT
#define LOCALE_USER_DEFAULT
#define SUBLANG_FULAH_SENEGAL
#define LOCALE_CUSTOM_DEFAULT
#define SORTIDFROMLCID(lcid)
#define SUBLANG_SERBIAN_SERBIA_CYRILLIC
#define LOCALE_SYSTEM_DEFAULT
#define SUBLANG_TIGRINYA_ERITREA
#define MAKELCID(lgid, srtid)
#define SORT_GERMAN_PHONE_BOOK
#define SUBLANG_SERBIAN_SERBIA_LATIN
#define LOCALE_CUSTOM_UI_DEFAULT
#define STATUS_NO_UNICODE_TRANSLATION
#define STATUS_INVALID_PARAMETER_2
#define STATUS_INVALID_PARAMETER_1
#define STATUS_INVALID_PARAMETER_3
#define IsEqualIID(riid1, riid2)
#define offsetof(TYPE, MEMBER)
#define SUBLANG_ARABIC_KUWAIT
#define SUBLANG_JAPANESE_JAPAN
#define SUBLANG_SERBIAN_LATIN
#define SUBLANG_TAMAZIGHT_ALGERIA_LATIN
#define SUBLANG_SERBIAN_CROATIA
#define LANG_CHINESE_SIMPLIFIED
#define SUBLANG_ARABIC_UAE
#define LANG_CHINESE_TRADITIONAL
#define SUBLANG_ENGLISH_UK
#define SUBLANG_ARABIC_SYRIA
#define SUBLANG_PORTUGUESE_BRAZILIAN
#define SUBLANG_ARABIC_SAUDI_ARABIA
#define SUBLANG_MALAY_MALAYSIA
#define SUBLANG_SINDHI_AFGHANISTAN
#define SUBLANG_ARABIC_IRAQ
#define LANGIDFROMLCID(l)
#define SUBLANG_CHINESE_TRADITIONAL
#define SUBLANG_CHINESE_SIMPLIFIED
#define SUBLANG_ARABIC_QATAR
#define SUBLANG_ARABIC_OMAN
#define SUBLANG_ARABIC_LEBANON
#define SUBLANG_ARABIC_LIBYA
#define SUBLANG_ARABIC_JORDAN
#define SUBLANG_URDU_PAKISTAN
#define SUBLANG_CHINESE_HONGKONG
#define SUBLANG_ARABIC_MOROCCO
#define SUBLANG_ARABIC_TUNISIA
#define SUBLANG_SPANISH_MODERN
#define SUBLANG_ARABIC_EGYPT
#define SUBLANG_ARABIC_YEMEN
#define SUBLANG_ARABIC_ALGERIA
#define SUBLANG_INUKTITUT_CANADA_LATIN
#define SUBLANG_ENGLISH_US
#define SUBLANG_ARABIC_BAHRAIN
#define SUBLANG_IRISH_IRELAND
#define SUBLANG_UZBEK_LATIN
#define SUBLANG_BENGALI_BANGLADESH
#define SUBLANG_AZERI_LATIN
#define LANG_SERBIAN_NEUTRAL
int winetest_get_mainargs(char ***pargv)
XML_HIDDEN void xmlParserErrors const char const xmlChar const xmlChar * str2
XML_HIDDEN void xmlParserErrors const char const xmlChar * str1
#define _WIN32_WINNT_VISTA
#define STATUS_BUFFER_TOO_SMALL
TCHAR str_buf[MAX_LOADSTRING]
BYTE LeadByte[MAX_LEADBYTES]
BYTE DefaultChar[MAX_DEFAULTCHAR]
BYTE DefaultChar[MAX_DEFAULTCHAR]
WCHAR CodePageName[MAX_PATH]
BYTE LeadByte[MAX_LEADBYTES]
#define LANG_USER_DEFAULT
#define STATUS_UNSUCCESSFUL
#define STATUS_OBJECT_NAME_NOT_FOUND
static struct WINE_WAVEMAP * oss
static const WCHAR lang[]
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
LPVOID NTAPI VirtualAlloc(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
BOOL NTAPI VirtualProtect(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flNewProtect, OUT PDWORD lpflOldProtect)
BOOL NTAPI VirtualFree(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD dwFreeType)
#define success(from, fromstr, to, tostr)
DWORD WINAPI GetLastError(void)
#define ERROR_INVALID_FLAGS
#define LOCALE_USE_CP_ACP
#define LOCALE_SABBREVMONTHNAME10
#define LOCALE_SMONTHNAME12
#define LOCALE_ICURRDIGITS
#define LOCALE_IDEFAULTCODEPAGE
#define LCID_ALTERNATE_SORTS
#define LOCALE_ALLOW_NEUTRAL_NAMES
#define LOCALE_SMONTHNAME5
#define LOCALE_SABBREVMONTHNAME9
BOOL(CALLBACK * LOCALE_ENUMPROCEX)(LPWSTR, DWORD, LPARAM)
BOOL(CALLBACK * LANGGROUPLOCALE_ENUMPROCA)(LGRPID, LCID, LPSTR, LONG_PTR)
enum _NORM_FORM NORM_FORM
#define LOCALE_SABBREVMONTHNAME11
#define LOCALE_SABBREVDAYNAME5
#define LOCALE_SABBREVDAYNAME2
#define LOCALE_INEGSEPBYSPACE
#define LOCALE_SABBREVMONTHNAME2
#define LOCALE_INEGSIGNPOSN
#define LOCALE_SMONTHNAME13
#define LOCALE_SMONTHNAME3
#define LOCALE_SSHORTTIME
#define LINGUISTIC_IGNORECASE
#define LCMAP_SIMPLIFIED_CHINESE
#define LOCALE_SMONTHNAME11
#define LOCALE_SMONTHNAME8
#define LCMAP_TRADITIONAL_CHINESE
#define IS_HIGH_SURROGATE(ch)
#define LOCALE_SMONTHNAME4
#define LOCALE_SNATIVECTRYNAME
#define LOCALE_SENGLANGUAGE
#define LOCALE_SABBREVMONTHNAME13
#define LOCALE_IFIRSTWEEKOFYEAR
#define LOCALE_SNATIVELANGNAME
#define LOCALE_SMONTHNAME7
#define NORM_IGNOREKANATYPE
#define NORM_LINGUISTIC_CASING
#define LOCALE_IINTLCURRDIGITS
#define LOCALE_SSHORTDATE
BOOL(CALLBACK * GEO_ENUMPROC)(GEOID)
#define NORM_IGNORENONSPACE
#define TIME_NOTIMEMARKER
#define TIME_NOMINUTESORSECONDS
#define LOCALE_IPOSSYMPRECEDES
#define LOCALE_SABBREVMONTHNAME4
#define LOCALE_SPOSITIVESIGN
#define NORM_IGNORESYMBOLS
#define LOCALE_IDEFAULTLANGUAGE
#define LOCALE_SABBREVDAYNAME4
#define LOCALE_SMONDECIMALSEP
#define LGRPID_WESTERN_EUROPE
#define LOCALE_SISO639LANGNAME
#define LINGUISTIC_IGNOREDIACRITIC
#define LOCALE_SMONTHNAME1
#define LOCALE_SABBREVMONTHNAME3
#define LOCALE_INEGSYMPRECEDES
BOOL(CALLBACK * LOCALE_ENUMPROCA)(LPSTR)
#define LOCALE_SMONTHOUSANDSEP
#define LOCALE_IPOSSIGNPOSN
#define LOCALE_SABBREVMONTHNAME1
#define LOCALE_NOUSEROVERRIDE
#define LOCALE_IOPTIONALCALENDAR
#define LOCALE_IDEFAULTANSICODEPAGE
#define LOCALE_SISO3166CTRYNAME
#define LOCALE_SABBREVDAYNAME6
#define LOCALE_SMONTHNAME2
#define LOCALE_STIMEFORMAT
#define IS_LOW_SURROGATE(ch)
BOOL(CALLBACK * LANGUAGEGROUP_ENUMPROCA)(LGRPID, LPSTR, LPSTR, DWORD, LONG_PTR)
#define LOCALE_SABBREVDAYNAME1
#define ENUM_ALL_CALENDARS
#define LOCALE_IFIRSTDAYOFWEEK
#define LOCALE_SABBREVMONTHNAME6
#define LOCALE_SMONTHNAME6
#define SORT_DIGITSASNUMBERS
#define LOCALE_SABBREVLANGNAME
#define LOCALE_SENGCOUNTRY
BOOL(CALLBACK * UILANGUAGE_ENUMPROCA)(LPSTR, LONG_PTR)
#define LOCALE_SABBREVCTRYNAME
#define LOCALE_INEGNUMBER
#define LOCALE_SNEGATIVESIGN
#define LOCALE_IDEFAULTCOUNTRY
#define TIME_FORCE24HOURFORMAT
#define LOCALE_SNATIVEDIGITS
#define LOCALE_SABBREVDAYNAME3
#define LOCALE_SABBREVMONTHNAME5
#define LOCALE_SABBREVMONTHNAME7
#define LOCALE_ICALENDARTYPE
#define LOCALE_SINTLSYMBOL
BOOL(CALLBACK * LOCALE_ENUMPROCW)(LPWSTR)
#define LOCALE_SABBREVMONTHNAME8
#define CSTR_GREATER_THAN
#define LOCALE_SMONGROUPING
#define LOCALE_SMONTHNAME10
#define LOCALE_SMONTHNAME9
#define LOCALE_IPOSSEPBYSPACE
#define LOCALE_SABBREVMONTHNAME12
#define LOCALE_IDEFAULTMACCODEPAGE
#define LOCALE_ITIMEMARKPOSN
#define LOCALE_RETURN_GENITIVE_NAMES
#define LOCALE_SABBREVDAYNAME7
#define HKEY_CURRENT_USER
static void set_name(msft_typelib_t *typelib)