31#define WIN32_NO_STATUS
112 ok(
hntdll != 0,
"LoadLibrary failed\n");
117 pRtlAppendUnicodeStringToString = (
void *)
GetProcAddress(
hntdll,
"RtlAppendUnicodeStringToString");
124 pRtlCreateUnicodeStringFromAsciiz = (
void *)
GetProcAddress(
hntdll,
"RtlCreateUnicodeStringFromAsciiz");
137 pRtlMultiAppendUnicodeStringBuffer = (
void *)
GetProcAddress(
hntdll,
"RtlMultiAppendUnicodeStringBuffer");
157 static const char teststring[] =
"Some Wild String";
161 str.MaximumLength = 0;
162 str.Buffer = (
void *)0xdeadbeef;
163 pRtlInitString(&
str, teststring);
164 ok(
str.Length ==
sizeof(teststring) -
sizeof(
char),
"Length uninitialized\n");
165 ok(
str.MaximumLength ==
sizeof(teststring),
"MaximumLength uninitialized\n");
166 ok(
str.Buffer == teststring,
"Buffer not equal to teststring\n");
167 ok(
strcmp(
str.Buffer,
"Some Wild String") == 0,
"Buffer written to\n");
169 ok(
str.Length == 0,
"Length uninitialized\n");
170 ok(
str.MaximumLength == 0,
"MaximumLength uninitialized\n");
171 ok(
str.Buffer ==
NULL,
"Buffer not equal to NULL\n");
178#define STRINGW {'S','o','m','e',' ','W','i','l','d',' ','S','t','r','i','n','g',0}
186 uni.
Buffer = (
void *)0xdeadbeef;
187 pRtlInitUnicodeString(&uni, teststring);
188 ok(uni.
Length ==
sizeof(teststring) -
sizeof(
WCHAR),
"Length uninitialized\n");
189 ok(uni.
MaximumLength ==
sizeof(teststring),
"MaximumLength uninitialized\n");
190 ok(uni.
Buffer == teststring,
"Buffer not equal to teststring\n");
192 pRtlInitUnicodeString(&uni,
NULL);
193 ok(uni.
Length == 0,
"Length uninitialized\n");
200#define TESTSTRING2_LEN 1000000
206 static const WCHAR teststring[] = {
'S',
'o',
'm',
'e',
' ',
'W',
'i',
'l',
'd',
' ',
'S',
't',
'r',
'i',
'n',
'g',0};
211 if (!pRtlInitUnicodeStringEx)
213 win_skip(
"RtlInitUnicodeStringEx is not available\n");
223 uni.
Buffer = (
void *) 0xdeadbeef;
224 result = pRtlInitUnicodeStringEx(&uni, teststring);
226 "pRtlInitUnicodeStringEx(&uni, 0) returns %lx, expected 0\n",
229 "pRtlInitUnicodeStringEx(&uni, 0) sets Length to %u, expected %u\n",
232 "pRtlInitUnicodeStringEx(&uni, 0) sets MaximumLength to %u, expected %u\n",
235 "pRtlInitUnicodeStringEx(&uni, 0) sets Buffer to %p, expected %p\n",
240 uni.
Buffer = (
void *) 0xdeadbeef;
241 pRtlInitUnicodeString(&uni, teststring);
243 "pRtlInitUnicodeString(&uni, 0) sets Length to %u, expected %u\n",
246 "pRtlInitUnicodeString(&uni, 0) sets MaximumLength to %u, expected %u\n",
249 "pRtlInitUnicodeString(&uni, 0) sets Buffer to %p, expected %p\n",
254 uni.
Buffer = (
void *) 0xdeadbeef;
255 result = pRtlInitUnicodeStringEx(&uni, teststring2);
257 "pRtlInitUnicodeStringEx(&uni, 0) returns %lx, expected %lx\n",
261 "pRtlInitUnicodeStringEx(&uni, 0) sets Length to %u, expected 12345 or 0\n",
265 "pRtlInitUnicodeStringEx(&uni, 0) sets MaximumLength to %u, expected 12345 or 0\n",
267 ok(uni.
Buffer == (
void *) 0xdeadbeef ||
268 uni.
Buffer == teststring2,
269 "pRtlInitUnicodeStringEx(&uni, 0) sets Buffer to %p, expected %x or %p\n",
270 uni.
Buffer, 0xdeadbeef, teststring2);
274 uni.
Buffer = (
void *) 0xdeadbeef;
275 pRtlInitUnicodeString(&uni, teststring2);
277 "pRtlInitUnicodeString(&uni, 0) sets Length to %u, expected %u\n",
280 "pRtlInitUnicodeString(&uni, 0) sets MaximumLength to %u, expected %u\n",
283 "pRtlInitUnicodeString(&uni, 0) sets Buffer to %p, expected %p\n",
286 "pRtlInitUnicodeString(&uni, 0) changes Buffer\n");
290 uni.
Buffer = (
void *) 0xdeadbeef;
291 result = pRtlInitUnicodeStringEx(&uni, 0);
293 "pRtlInitUnicodeStringEx(&uni, 0) returns %lx, expected 0\n",
296 "pRtlInitUnicodeStringEx(&uni, 0) sets Length to %u, expected %u\n",
299 "pRtlInitUnicodeStringEx(&uni, 0) sets MaximumLength to %u, expected %u\n",
302 "pRtlInitUnicodeStringEx(&uni, 0) sets Buffer to %p, expected %p\n",
307 uni.
Buffer = (
void *) 0xdeadbeef;
308 pRtlInitUnicodeString(&uni, 0);
310 "pRtlInitUnicodeString(&uni, 0) sets Length to %u, expected %u\n",
313 "pRtlInitUnicodeString(&uni, 0) sets MaximumLength to %u, expected %u\n",
316 "pRtlInitUnicodeString(&uni, 0) sets Buffer to %p, expected %p\n",
341 { 0, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 32, 32, 32,
"This is a string",
STATUS_SUCCESS},
342 { 0, 32, 32, 32,
"This is a string", 40, 42, 42,
"--------------------", 32, 32, 32,
"This is a string",
STATUS_SUCCESS},
343 { 0, 32, 30, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
344 { 0, 32, 34, 34,
"This is a string", 40, 42, 42,
NULL, 32, 32, 32,
"This is a string",
STATUS_SUCCESS},
345 { 0, 32, 32, 32,
"This is a string", 40, 42, 42,
NULL, 32, 32, 32,
"This is a string",
STATUS_SUCCESS},
346 { 0, 32, 30, 34,
"This is a string", 40, 42, 42,
NULL, 40, 42, 0,
NULL,
STATUS_INVALID_PARAMETER},
347 { 1, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 32, 34, 34,
"This is a string",
STATUS_SUCCESS},
348 { 1, 32, 32, 32,
"This is a string", 40, 42, 42,
"--------------------", 32, 34, 34,
"This is a string",
STATUS_SUCCESS},
349 { 1, 32, 30, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
350 { 1, 32, 34, 34,
"This is a string", 40, 42, 42,
NULL, 32, 34, 34,
"This is a string",
STATUS_SUCCESS},
351 { 1, 32, 32, 32,
"This is a string", 40, 42, 42,
NULL, 32, 34, 34,
"This is a string",
STATUS_SUCCESS},
352 { 1, 32, 30, 34,
"This is a string", 40, 42, 42,
NULL, 40, 42, 0,
NULL,
STATUS_INVALID_PARAMETER},
353 { 2, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
354 { 2, 32, 32, 32,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
355 { 2, 32, 30, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
356 { 2, 32, 34, 34,
"This is a string", 40, 42, 42,
NULL, 40, 42, 0,
NULL,
STATUS_INVALID_PARAMETER},
357 { 2, 32, 32, 32,
"This is a string", 40, 42, 42,
NULL, 40, 42, 0,
NULL,
STATUS_INVALID_PARAMETER},
358 { 2, 32, 30, 34,
"This is a string", 40, 42, 42,
NULL, 40, 42, 0,
NULL,
STATUS_INVALID_PARAMETER},
359 { 3, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 32, 34, 34,
"This is a string",
STATUS_SUCCESS},
360 { 3, 32, 32, 32,
"This is a string", 40, 42, 42,
"--------------------", 32, 34, 34,
"This is a string",
STATUS_SUCCESS},
361 { 3, 32, 30, 32,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
362 { 3, 32, 34, 34,
"This is a string", 40, 42, 42,
NULL, 32, 34, 34,
"This is a string",
STATUS_SUCCESS},
363 { 3, 32, 32, 32,
"This is a string", 40, 42, 42,
NULL, 32, 34, 34,
"This is a string",
STATUS_SUCCESS},
364 { 3, 32, 30, 32,
"This is a string", 40, 42, 42,
NULL, 40, 42, 0,
NULL,
STATUS_INVALID_PARAMETER},
365 { 4, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
366 { 5, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
367 { 6, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
368 { 7, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
369 { 8, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
370 { 9, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
371 {10, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
372 {11, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
373 {12, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
374 {13, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
375 {14, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
376 {15, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
377 {16, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
378 {-1, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
379 {-5, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
380 {-9, 32, 34, 34,
"This is a string", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
381 { 0, 0, 2, 2,
"", 40, 42, 42,
"--------------------", 0, 0, 0,
NULL,
STATUS_SUCCESS},
382 { 0, 0, 0, 0,
"", 40, 42, 42,
"--------------------", 0, 0, 0,
NULL,
STATUS_SUCCESS},
383 { 0, 0, 2, 2,
"", 40, 42, 42,
NULL, 0, 0, 0,
NULL,
STATUS_SUCCESS},
384 { 0, 0, 0, 0,
"", 40, 42, 42,
NULL, 0, 0, 0,
NULL,
STATUS_SUCCESS},
385 { 0, 0, 2, 2,
NULL, 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
386 { 0, 0, 0, 0,
NULL, 40, 42, 42,
"--------------------", 0, 0, 0,
NULL,
STATUS_SUCCESS},
387 { 0, 0, 2, 2,
NULL, 40, 42, 42,
NULL, 40, 42, 0,
NULL,
STATUS_INVALID_PARAMETER},
388 { 0, 0, 0, 0,
NULL, 40, 42, 42,
NULL, 0, 0, 0,
NULL,
STATUS_SUCCESS},
389 { 1, 0, 2, 2,
"", 40, 42, 42,
"--------------------", 0, 0, 0,
NULL,
STATUS_SUCCESS},
390 { 1, 0, 0, 0,
"", 40, 42, 42,
"--------------------", 0, 0, 0,
NULL,
STATUS_SUCCESS},
391 { 1, 0, 2, 2,
"", 40, 42, 42,
NULL, 0, 0, 0,
NULL,
STATUS_SUCCESS},
392 { 1, 0, 0, 0,
"", 40, 42, 42,
NULL, 0, 0, 0,
NULL,
STATUS_SUCCESS},
393 { 1, 0, 2, 2,
NULL, 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
394 { 1, 0, 0, 0,
NULL, 40, 42, 42,
"--------------------", 0, 0, 0,
NULL,
STATUS_SUCCESS},
395 { 1, 0, 2, 2,
NULL, 40, 42, 42,
NULL, 40, 42, 0,
NULL,
STATUS_INVALID_PARAMETER},
396 { 1, 0, 0, 0,
NULL, 40, 42, 42,
NULL, 0, 0, 0,
NULL,
STATUS_SUCCESS},
397 { 2, 0, 2, 2,
"", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
398 { 2, 0, 0, 0,
"", 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
399 { 2, 0, 2, 2,
"", 40, 42, 42,
NULL, 40, 42, 0,
NULL,
STATUS_INVALID_PARAMETER},
400 { 2, 0, 0, 0,
"", 40, 42, 42,
NULL, 40, 42, 0,
NULL,
STATUS_INVALID_PARAMETER},
401 { 2, 0, 2, 2,
NULL, 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
402 { 2, 0, 0, 0,
NULL, 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
403 { 2, 0, 2, 2,
NULL, 40, 42, 42,
NULL, 40, 42, 0,
NULL,
STATUS_INVALID_PARAMETER},
404 { 2, 0, 0, 0,
NULL, 40, 42, 42,
NULL, 40, 42, 0,
NULL,
STATUS_INVALID_PARAMETER},
405 { 3, 0, 2, 2,
"", 40, 42, 42,
"--------------------", 0, 2, 2,
"",
STATUS_SUCCESS},
406 { 3, 0, 0, 0,
"", 40, 42, 42,
"--------------------", 0, 2, 2,
"",
STATUS_SUCCESS},
407 { 3, 0, 2, 2,
"", 40, 42, 42,
NULL, 0, 2, 2,
"",
STATUS_SUCCESS},
408 { 3, 0, 0, 0,
"", 40, 42, 42,
NULL, 0, 2, 2,
"",
STATUS_SUCCESS},
409 { 3, 0, 2, 2,
NULL, 40, 42, 42,
"--------------------", 40, 42, 42,
"--------------------",
STATUS_INVALID_PARAMETER},
410 { 3, 0, 0, 0,
NULL, 40, 42, 42,
"--------------------", 0, 2, 2,
"",
STATUS_SUCCESS},
411 { 3, 0, 2, 2,
NULL, 40, 42, 42,
NULL, 40, 42, 0,
NULL,
STATUS_INVALID_PARAMETER},
412 { 3, 0, 0, 0,
NULL, 40, 42, 42,
NULL, 0, 2, 2,
"",
STATUS_SUCCESS},
419 WCHAR source_buf[257];
425 CHAR dest_ansi_buf[257];
428 unsigned int test_num;
430 if (!pRtlDuplicateUnicodeString)
432 win_skip(
"RtlDuplicateUnicodeString is not available\n");
443 source_str.
Buffer = source_buf;
453 dest_str.
Buffer = dest_buf;
467 result = pRtlDuplicateUnicodeString(
dupl_ustr[test_num].add_nul, &source_str, &dest_str);
468 dest_ansi_str.Length = dest_str.
Length /
sizeof(
WCHAR);
469 dest_ansi_str.MaximumLength = dest_ansi_str.Length + 1;
470 for (
pos = 0;
pos < dest_ansi_str.Length;
pos++) {
473 dest_ansi_buf[dest_ansi_str.Length] =
'\0';
474 dest_ansi_str.Buffer = dest_ansi_buf;
476 "(test %d): RtlDuplicateUnicodeString(%d, source, dest) has result %lx, expected %lx\n",
479 "(test %d): RtlDuplicateUnicodeString(%d, source, dest) destination has Length %d, expected %d\n",
482 "(test %d): RtlDuplicateUnicodeString(%d, source, dest) destination has MaximumLength %d, expected %d\n",
486 dest_str.
Buffer == dest_buf,
487 "(test %d): RtlDuplicateUnicodeString(%d, source, dest) destination buffer changed %p expected %p\n",
491 "(test %d): RtlDuplicateUnicodeString(%d, source, dest) has destination buffer unchanged %p\n",
496 "(test %d): RtlDuplicateUnicodeString(%d, source, dest) has destination \"%s\" expected \"%s\"\n",
501 "(test %d): RtlDuplicateUnicodeString(%d, source, dest) has destination %p expected %p\n",
510 static const char teststring[] =
"Some Wild String";
511 char deststring[] =
" ";
515 pRtlInitString(&
str, teststring);
516 pRtlInitString(&deststr, deststring);
517 pRtlCopyString(&deststr, &
str);
518 ok(
strncmp(
str.Buffer, deststring,
str.Length) == 0,
"String not copied\n");
526 int expected_upper_ch;
529 for (
ch = -1;
ch <= 1024;
ch++) {
530 upper_ch = pRtlUpperChar(
ch);
532 if (byte_ch >=
'a' && byte_ch <=
'z') {
533 expected_upper_ch = (
CHAR) (byte_ch -
'a' +
'A');
535 expected_upper_ch = (
CHAR) byte_ch;
537 ok(upper_ch == expected_upper_ch,
538 "RtlUpperChar('%c'[=0x%x]) has result '%c'[=0x%x], expected '%c'[=0x%x]\n",
539 ch,
ch, upper_ch, upper_ch, expected_upper_ch, expected_upper_ch);
550 char result_buf[257];
556 for (
i = 0;
i <= 255;
i++) {
558 if (
ch >=
'a' &&
ch <=
'z') {
559 upper_ch =
ch -
'a' +
'A';
564 result_buf[
i] =
'\0';
565 upper_buf[
i] = upper_ch;
568 result_buf[
i] =
'\0';
570 ascii_str.Length = 256;
571 ascii_str.MaximumLength = 256;
572 ascii_str.Buffer = ascii_buf;
573 result_str.Length = 256;
574 result_str.MaximumLength = 256;
575 result_str.Buffer = result_buf;
576 upper_str.Length = 256;
577 upper_str.MaximumLength = 256;
578 upper_str.Buffer = upper_buf;
580 pRtlUpperString(&result_str, &ascii_str);
581 ok(
memcmp(result_str.Buffer, upper_str.Buffer, 256) == 0,
582 "RtlUpperString does not work as expected\n");
591 WCHAR expected_upper_ch;
593 for (
i = 0;
i <= 255;
i++) {
595 upper_ch = pRtlUpcaseUnicodeChar(
ch);
596 if (
ch >=
'a' &&
ch <=
'z') {
597 expected_upper_ch =
ch -
'a' +
'A';
598 }
else if (
ch >= 0xe0 &&
ch <= 0xfe &&
ch != 0xf7) {
599 expected_upper_ch =
ch - 0x20;
600 }
else if (
ch == 0xff) {
601 expected_upper_ch = 0x178;
603 expected_upper_ch =
ch;
605 ok(upper_ch == expected_upper_ch,
606 "RtlUpcaseUnicodeChar('%c'[=0x%x]) has result '%c'[=0x%x], expected: '%c'[=0x%x]\n",
607 ch,
ch, upper_ch, upper_ch, expected_upper_ch, expected_upper_ch);
617 WCHAR ascii_buf[257];
618 WCHAR result_buf[257];
619 WCHAR upper_buf[257];
624 for (
i = 0;
i <= 255;
i++) {
626 if (
ch >=
'a' &&
ch <=
'z') {
627 upper_ch =
ch -
'a' +
'A';
628 }
else if (
ch >= 0xe0 &&
ch <= 0xfe &&
ch != 0xf7) {
629 upper_ch =
ch - 0x20;
630 }
else if (
ch == 0xff) {
636 result_buf[
i] =
'\0';
637 upper_buf[
i] = upper_ch;
640 result_buf[
i] =
'\0';
644 ascii_str.
Buffer = ascii_buf;
647 result_str.
Buffer = result_buf;
650 upper_str.
Buffer = upper_buf;
652 pRtlUpcaseUnicodeString(&result_str, &ascii_str, 0);
653 for (
i = 0;
i <= 255;
i++) {
655 "RtlUpcaseUnicodeString works wrong: '%c'[=0x%x] is converted to '%c'[=0x%x], expected: '%c'[=0x%x]\n",
662 for (
i = 0x100;
i < 0x1100;
i++)
665 for (
j = 0;
j < 256;
j++)
667 unsigned int ch = ((
i << 8) +
j) - 0x10000;
668 src[2 *
j] = 0xd800 | (
ch >> 10);
669 src[2 *
j + 1] = 0xdc00 | (
ch & 0x3ff);
675 pRtlUpcaseUnicodeString(&result_str, &upper_str, 0);
677 "string compare mismatch in %04x-%04x\n",
i << 8, (
i << 8) + 255 );
687 WCHAR source_buf[1025];
688 WCHAR result_buf[1025];
689 WCHAR lower_buf[1025];
694 for (
i = 0;
i < 1024;
i++) {
696 if (
ch >=
'A' &&
ch <=
'Z') {
697 lower_ch =
ch -
'A' +
'a';
698 }
else if (
ch >= 0xc0 &&
ch <= 0xde &&
ch != 0xd7) {
699 lower_ch =
ch + 0x20;
700 }
else if (
ch >= 0x391 &&
ch <= 0x3ab &&
ch != 0x3a2) {
701 lower_ch =
ch + 0x20;
704 case 0x178: lower_ch = 0xff;
break;
705 case 0x181: lower_ch = 0x253;
break;
706 case 0x186: lower_ch = 0x254;
break;
707 case 0x189: lower_ch = 0x256;
break;
708 case 0x18a: lower_ch = 0x257;
break;
709 case 0x18e: lower_ch = 0x1dd;
break;
710 case 0x18f: lower_ch = 0x259;
break;
711 case 0x190: lower_ch = 0x25b;
break;
712 case 0x193: lower_ch = 0x260;
break;
713 case 0x194: lower_ch = 0x263;
break;
714 case 0x196: lower_ch = 0x269;
break;
715 case 0x197: lower_ch = 0x268;
break;
716 case 0x19c: lower_ch = 0x26f;
break;
717 case 0x19d: lower_ch = 0x272;
break;
718 case 0x19f: lower_ch = 0x275;
break;
719 case 0x1a9: lower_ch = 0x283;
break;
720 case 0x1a6: lower_ch = 0x280;
break;
721 case 0x1ae: lower_ch = 0x288;
break;
722 case 0x1b1: lower_ch = 0x28a;
break;
723 case 0x1b2: lower_ch = 0x28b;
break;
724 case 0x1b7: lower_ch = 0x292;
break;
725 case 0x1c4: lower_ch = 0x1c6;
break;
726 case 0x1c7: lower_ch = 0x1c9;
break;
727 case 0x1ca: lower_ch = 0x1cc;
break;
728 case 0x1f1: lower_ch = 0x1f3;
break;
729 case 0x1f6: lower_ch = 0x195;
break;
730 case 0x1f7: lower_ch = 0x1bf;
break;
731 case 0x220: lower_ch = 0x19e;
break;
732 case 0x23a: lower_ch = 0x2c65;
break;
733 case 0x23d: lower_ch = 0x19a;
break;
734 case 0x23e: lower_ch = 0x2c66;
break;
735 case 0x243: lower_ch = 0x180;
break;
736 case 0x244: lower_ch = 0x289;
break;
737 case 0x245: lower_ch = 0x28c;
break;
738 case 0x37f: lower_ch = 0x3f3;
break;
739 case 0x386: lower_ch = 0x3ac;
break;
740 case 0x388: lower_ch = 0x3ad;
break;
741 case 0x389: lower_ch = 0x3ae;
break;
742 case 0x38a: lower_ch = 0x3af;
break;
743 case 0x38c: lower_ch = 0x3cc;
break;
744 case 0x38e: lower_ch = 0x3cd;
break;
745 case 0x38f: lower_ch = 0x3ce;
break;
746 case 0x3cf: lower_ch = 0x3d7;
break;
747 case 0x3f9: lower_ch = 0x3f2;
break;
748 case 0x3fd: lower_ch = 0x37b;
break;
749 case 0x3fe: lower_ch = 0x37c;
break;
750 case 0x3ff: lower_ch = 0x37d;
break;
751 default: lower_ch =
ch;
break;
755 result_buf[
i] =
'\0';
756 lower_buf[
i] = lower_ch;
758 source_buf[
i] =
'\0';
759 result_buf[
i] =
'\0';
763 source_str.
Buffer = source_buf;
766 result_str.
Buffer = result_buf;
769 lower_str.
Buffer = lower_buf;
771 pRtlDowncaseUnicodeString(&result_str, &source_str, 0);
772 for (
i = 0;
i <= 1024;
i++) {
775 "RtlDowncaseUnicodeString works wrong: '%c'[=0x%x] is converted to '%c'[=0x%x], expected: '%c'[=0x%x]\n",
802 { 10, 12, 12,
"------------", 0, 0, 0,
"",
TRUE, 0, 1, 1,
"",
STATUS_SUCCESS},
803 { 10, 12, 12,
"------------", 12, 12, 12,
"abcdef",
TRUE, 6, 7, 7,
"abcdef",
STATUS_SUCCESS},
804 { 0, 2, 12,
"------------", 12, 12, 12,
"abcdef",
TRUE, 6, 7, 7,
"abcdef",
STATUS_SUCCESS},
805 { 10, 12, 12,
NULL, 12, 12, 12,
"abcdef",
TRUE, 6, 7, 7,
"abcdef",
STATUS_SUCCESS},
806 { 0, 0, 12,
"------------", 12, 12, 12,
"abcdef",
FALSE, 6, 0, 0,
"",
STATUS_BUFFER_OVERFLOW, 1},
807 { 0, 1, 12,
"------------", 12, 12, 12,
"abcdef",
FALSE, 0, 1, 1,
"",
STATUS_BUFFER_OVERFLOW},
808 { 0, 2, 12,
"------------", 12, 12, 12,
"abcdef",
FALSE, 1, 2, 2,
"a",
STATUS_BUFFER_OVERFLOW},
809 { 0, 3, 12,
"------------", 12, 12, 12,
"abcdef",
FALSE, 2, 3, 3,
"ab",
STATUS_BUFFER_OVERFLOW},
810 { 0, 5, 12,
"------------", 12, 12, 12,
"abcdef",
FALSE, 4, 5, 5,
"abcd",
STATUS_BUFFER_OVERFLOW},
811 { 8, 5, 12,
"------------", 12, 12, 12,
"abcdef",
FALSE, 4, 5, 5,
"abcd",
STATUS_BUFFER_OVERFLOW},
812 { 8, 6, 12,
"------------", 12, 12, 12,
"abcdef",
FALSE, 5, 6, 6,
"abcde",
STATUS_BUFFER_OVERFLOW},
813 { 8, 7, 12,
"------------", 12, 12, 12,
"abcdef",
FALSE, 6, 7, 7,
"abcdef",
STATUS_SUCCESS},
814 { 8, 7, 12,
"------------", 0, 12, 12,
NULL,
FALSE, 0, 7, 0,
"",
STATUS_SUCCESS},
817 { 0, 0, 12,
NULL, 10, 10, 12,
NULL,
FALSE, 5, 0, 0,
NULL,
STATUS_BUFFER_OVERFLOW},
830 unsigned int test_num;
838 ansi_str.Buffer = ansi_buf;
840 ansi_str.Buffer =
NULL;
852 result = pRtlUnicodeStringToAnsiString(&ansi_str, &uni_str,
ustr2astr[test_num].doalloc);
854 "(test %d): RtlUnicodeStringToAnsiString(ansi, uni, %d) has result %lx, expected %lx\n",
858 "(test %d): RtlUnicodeStringToAnsiString(ansi, uni, %d) ansi has Length %d, expected %d\n",
861 "(test %d): RtlUnicodeStringToAnsiString(ansi, uni, %d) ansi has MaximumLength %d, expected %d\n",
864 "(test %d): RtlUnicodeStringToAnsiString(ansi, uni, %d) has ansi \"%s\" expected \"%s\"\n",
867 pRtlFreeAnsiString(&ansi_str);
886 { 5, 12, 15,
"TestS01234abcde",
"tring", 10, 12, 15,
"TestStringabcde",
STATUS_SUCCESS},
887 { 5, 11, 15,
"TestS01234abcde",
"tring", 10, 11, 15,
"TestStringabcde",
STATUS_SUCCESS},
888 { 5, 10, 15,
"TestS01234abcde",
"tring", 10, 10, 15,
"TestStringabcde",
STATUS_SUCCESS},
889 { 5, 9, 15,
"TestS01234abcde",
"tring", 5, 9, 15,
"TestS01234abcde",
STATUS_BUFFER_TOO_SMALL},
890 { 5, 0, 15,
"TestS01234abcde",
"tring", 5, 0, 15,
"TestS01234abcde",
STATUS_BUFFER_TOO_SMALL},
891 { 5, 14, 15,
"TestS01234abcde",
"tring", 10, 14, 15,
"TestStringabcde",
STATUS_SUCCESS},
892 { 5, 14, 15,
"TestS01234abcde",
NULL, 5, 14, 15,
"TestS01234abcde",
STATUS_SUCCESS},
893 { 5, 14, 15,
NULL,
NULL, 5, 14, 15,
NULL,
STATUS_SUCCESS},
894 { 5, 12, 15,
"Tst\0S01234abcde",
"tr\0i", 7, 12, 15,
"Tst\0Str234abcde",
STATUS_SUCCESS},
903 unsigned int test_num;
911 dest_str.Buffer = dest_buf;
913 dest_str.Buffer =
NULL;
917 "(test %d): RtlAppendAsciizToString(dest, src) has result %lx, expected %lx\n",
920 "(test %d): RtlAppendAsciizToString(dest, src) dest has Length %d, expected %d\n",
923 "(test %d): RtlAppendAsciizToString(dest, src) dest has MaximumLength %d, expected %d\n",
925 if (dest_str.Buffer == dest_buf) {
927 "(test %d): RtlAppendAsciizToString(dest, src) has dest \"%s\" expected \"%s\"\n",
928 test_num, dest_buf,
app_asc2str[test_num].res_buf);
931 "(test %d): RtlAppendAsciizToString(dest, src) dest has Buffer %p expected %p\n",
955 { 5, 12, 15,
"TestS01234abcde", 5, 5, 7,
"tringZY", 10, 12, 15,
"TestStringabcde",
STATUS_SUCCESS},
956 { 5, 11, 15,
"TestS01234abcde", 5, 5, 7,
"tringZY", 10, 11, 15,
"TestStringabcde",
STATUS_SUCCESS},
957 { 5, 10, 15,
"TestS01234abcde", 5, 5, 7,
"tringZY", 10, 10, 15,
"TestStringabcde",
STATUS_SUCCESS},
958 { 5, 9, 15,
"TestS01234abcde", 5, 5, 7,
"tringZY", 5, 9, 15,
"TestS01234abcde",
STATUS_BUFFER_TOO_SMALL},
959 { 5, 0, 15,
"TestS01234abcde", 0, 0, 7,
"tringZY", 5, 0, 15,
"TestS01234abcde",
STATUS_SUCCESS},
960 { 5, 14, 15,
"TestS01234abcde", 0, 0, 7,
"tringZY", 5, 14, 15,
"TestS01234abcde",
STATUS_SUCCESS},
961 { 5, 14, 15,
"TestS01234abcde", 0, 0, 7,
NULL, 5, 14, 15,
"TestS01234abcde",
STATUS_SUCCESS},
962 { 5, 14, 15,
NULL, 0, 0, 7,
NULL, 5, 14, 15,
NULL,
STATUS_SUCCESS},
963 { 5, 12, 15,
"Tst\0S01234abcde", 4, 4, 7,
"tr\0iZY", 9, 12, 15,
"Tst\0Str\0i4abcde",
STATUS_SUCCESS},
974 unsigned int test_num;
982 dest_str.Buffer = dest_buf;
984 dest_str.Buffer =
NULL;
991 src_str.Buffer = src_buf;
993 src_str.Buffer =
NULL;
995 result = pRtlAppendStringToString(&dest_str, &src_str);
997 "(test %d): RtlAppendStringToString(dest, src) has result %lx, expected %lx\n",
1000 "(test %d): RtlAppendStringToString(dest, src) dest has Length %d, expected %d\n",
1003 "(test %d): RtlAppendStringToString(dest, src) dest has MaximumLength %d, expected %d\n",
1005 if (dest_str.Buffer == dest_buf) {
1007 "(test %d): RtlAppendStringToString(dest, src) has dest \"%s\" expected \"%s\"\n",
1008 test_num, dest_buf,
app_str2str[test_num].res_buf);
1011 "(test %d): RtlAppendStringToString(dest, src) dest has Buffer %p expected %p\n",
1032 { 4, 12, 14,
"Fake0123abcdef",
"Ustr\0", 8, 12, 14,
"FakeUstr\0\0cdef",
STATUS_SUCCESS},
1033 { 4, 11, 14,
"Fake0123abcdef",
"Ustr\0", 8, 11, 14,
"FakeUstr\0\0cdef",
STATUS_SUCCESS},
1034 { 4, 10, 14,
"Fake0123abcdef",
"Ustr\0", 8, 10, 14,
"FakeUstr\0\0cdef",
STATUS_SUCCESS},
1038 { 4, 8, 14,
"Fake0123abcdef",
"Ustr\0", 8, 8, 14,
"FakeUstrabcdef",
STATUS_SUCCESS},
1039 { 4, 7, 14,
"Fake0123abcdef",
"Ustr\0", 4, 7, 14,
"Fake0123abcdef",
STATUS_BUFFER_TOO_SMALL},
1040 { 4, 0, 14,
"Fake0123abcdef",
"Ustr\0", 4, 0, 14,
"Fake0123abcdef",
STATUS_BUFFER_TOO_SMALL},
1041 { 4, 14, 14,
"Fake0123abcdef",
"Ustr\0", 8, 14, 14,
"FakeUstr\0\0cdef",
STATUS_SUCCESS},
1042 { 4, 14, 14,
"Fake0123abcdef",
NULL, 4, 14, 14,
"Fake0123abcdef",
STATUS_SUCCESS},
1043 { 4, 14, 14,
NULL,
NULL, 4, 14, 14,
NULL,
STATUS_SUCCESS},
1044 { 4, 14, 14,
"Fake0123abcdef",
"U\0stri\0", 10, 14, 14,
"FakeU\0stri\0\0ef",
STATUS_SUCCESS},
1045 { 6, 14, 16,
"Te\0\0stabcdefghij",
"St\0\0ri", 8, 14, 16,
"Te\0\0stSt\0\0efghij",
STATUS_SUCCESS},
1051 WCHAR dest_buf[257];
1054 unsigned int test_num;
1062 dest_str.
Buffer = dest_buf;
1068 "(test %d): RtlAppendUnicodeToString(dest, src) has result %lx, expected %lx\n",
1071 "(test %d): RtlAppendUnicodeToString(dest, src) dest has Length %d, expected %d\n",
1074 "(test %d): RtlAppendUnicodeToString(dest, src) dest has MaximumLength %d, expected %d\n",
1076 if (dest_str.
Buffer == dest_buf) {
1078 "(test %d): RtlAppendUnicodeToString(dest, src) has dest \"%s\" expected \"%s\"\n",
1079 test_num, (
char *) dest_buf,
app_uni2str[test_num].res_buf);
1082 "(test %d): RtlAppendUnicodeToString(dest, src) dest has Buffer %p expected %p\n",
1106 { 4, 12, 14,
"Fake0123abcdef", 4, 6, 8,
"UstrZYXW", 8, 12, 14,
"FakeUstr\0\0cdef",
STATUS_SUCCESS},
1107 { 4, 11, 14,
"Fake0123abcdef", 4, 6, 8,
"UstrZYXW", 8, 11, 14,
"FakeUstr\0\0cdef",
STATUS_SUCCESS},
1108 { 4, 10, 14,
"Fake0123abcdef", 4, 6, 8,
"UstrZYXW", 8, 10, 14,
"FakeUstr\0\0cdef",
STATUS_SUCCESS},
1112 { 4, 8, 14,
"Fake0123abcdef", 4, 6, 8,
"UstrZYXW", 8, 8, 14,
"FakeUstrabcdef",
STATUS_SUCCESS},
1113 { 4, 7, 14,
"Fake0123abcdef", 4, 6, 8,
"UstrZYXW", 4, 7, 14,
"Fake0123abcdef",
STATUS_BUFFER_TOO_SMALL},
1114 { 4, 0, 14,
"Fake0123abcdef", 0, 0, 8,
"UstrZYXW", 4, 0, 14,
"Fake0123abcdef",
STATUS_SUCCESS},
1115 { 4, 14, 14,
"Fake0123abcdef", 0, 0, 8,
"UstrZYXW", 4, 14, 14,
"Fake0123abcdef",
STATUS_SUCCESS},
1116 { 4, 14, 14,
"Fake0123abcdef", 0, 0, 8,
NULL, 4, 14, 14,
"Fake0123abcdef",
STATUS_SUCCESS},
1117 { 4, 14, 14,
NULL, 0, 0, 8,
NULL, 4, 14, 14,
NULL,
STATUS_SUCCESS},
1118 { 6, 14, 16,
"Te\0\0stabcdefghij", 6, 8, 8,
"St\0\0riZY", 12, 14, 16,
"Te\0\0stSt\0\0ri\0\0ij",
STATUS_SUCCESS},
1124 WCHAR dest_buf[257];
1129 unsigned int test_num;
1137 dest_str.
Buffer = dest_buf;
1146 src_str.
Buffer = src_buf;
1150 result = pRtlAppendUnicodeStringToString(&dest_str, &src_str);
1152 "(test %d): RtlAppendStringToString(dest, src) has result %lx, expected %lx\n",
1155 "(test %d): RtlAppendStringToString(dest, src) dest has Length %d, expected %d\n",
1158 "(test %d): RtlAppendStringToString(dest, src) dest has MaximumLength %d, expected %d\n",
1160 if (dest_str.
Buffer == dest_buf) {
1162 "(test %d): RtlAppendStringToString(dest, src) has dest \"%s\" expected \"%s\"\n",
1163 test_num, (
char *) dest_buf,
app_ustr2str[test_num].res_buf);
1166 "(test %d): RtlAppendStringToString(dest, src) dest has Buffer %p expected %p\n",
1233 WCHAR main_str_buf[257];
1234 WCHAR search_chars_buf[257];
1240 unsigned int test_num;
1242 if (!pRtlFindCharInUnicodeString)
1244 win_skip(
"RtlFindCharInUnicodeString is not available\n");
1251 main_str.MaximumLength = main_str.Length +
sizeof(
WCHAR);
1255 main_str.Buffer = main_str_buf;
1263 search_chars.MaximumLength = search_chars.Length +
sizeof(
WCHAR);
1264 for (
idx = 0;
idx < search_chars.Length /
sizeof(
WCHAR);
idx++) {
1267 search_chars.Buffer = search_chars_buf;
1276 "(test %d): RtlFindCharInUnicodeString(%d, %s, %s, [out]) has result %lx, expected %lx\n",
1281 "(test %d): RtlFindCharInUnicodeString(%d, %s, %s, [out]) assigns %d to pos, expected %d\n",
1414 unsigned int test_num;
1423 pRtlInitUnicodeString(&uni, wstr);
1427 "(test %d): RtlUnicodeStringToInteger(\"%s\", %d, [out]) has result %lx, expected: %lx (%lx)\n",
1433 "(test %d): RtlUnicodeStringToInteger(\"%s\", %d, [out]) assigns value %d, expected: %d\n",
1437 "(test %d): RtlUnicodeStringToInteger(\"%s\", %d, [out]) assigns value %d, expected 0 or deadbeef\n",
1443 pRtlInitUnicodeString(&uni, wstr);
1446 "call failed: RtlUnicodeStringToInteger(\"%s\", %d, NULL) has result %lx\n",
1448 result = pRtlUnicodeStringToInteger(&uni, 20,
NULL);
1450 "call failed: RtlUnicodeStringToInteger(\"%s\", 20, NULL) has result %lx\n",
1456 "call failed: RtlUnicodeStringToInteger(\"12345\", %d, [out]) has result %lx\n",
1459 "didn't return expected value (test a): expected: %d, got: %d\n",
1465 "call failed: RtlUnicodeStringToInteger(\"12\", %d, [out]) has result %lx\n",
1468 ok(
value == 12,
"didn't return expected value (test b): expected: %d, got: %d\n", 12,
value);
1473 "call failed: RtlUnicodeStringToInteger(\"1\", %d, [out]) has result %lx\n",
1476 "didn't return expected value (test c): expected: %d, got: %d\n",
1485 unsigned int test_num;
1496 "(test %d): call failed: RtlCharToInteger(\"%s\", %d, [out]) has result %lx, expected: %lx (%lx)\n",
1501 "(test %d): call failed: RtlCharToInteger(\"%s\", %d, [out]) assigns value %d, expected: %d\n",
1505 "(test %d): call failed: RtlCharToInteger(\"%s\", %d, [out]) assigns value %d, expected 0 or deadbeef\n",
1512 "call failed: RtlCharToInteger(\"%s\", %d, NULL) has result %lx\n",
1517 "call failed: RtlCharToInteger(\"%s\", 20, NULL) has result %lx\n",
1522#define STRI_BUFFER_LENGTH 35
1535 {10, 123, 3, 11,
"123\0-------------------------------",
STATUS_SUCCESS},
1537 { 0, 0x80000000U, 10, 11,
"2147483648\0------------------------",
STATUS_SUCCESS},
1538 { 0, -2147483647, 10, 11,
"2147483649\0------------------------",
STATUS_SUCCESS},
1539 { 0, -2, 10, 11,
"4294967294\0------------------------",
STATUS_SUCCESS},
1540 { 0, -1, 10, 11,
"4294967295\0------------------------",
STATUS_SUCCESS},
1541 { 0, 0, 1, 11,
"0\0---------------------------------",
STATUS_SUCCESS},
1542 { 0, 1, 1, 11,
"1\0---------------------------------",
STATUS_SUCCESS},
1543 { 0, 12, 2, 11,
"12\0--------------------------------",
STATUS_SUCCESS},
1544 { 0, 123, 3, 11,
"123\0-------------------------------",
STATUS_SUCCESS},
1545 { 0, 1234, 4, 11,
"1234\0------------------------------",
STATUS_SUCCESS},
1546 { 0, 12345, 5, 11,
"12345\0-----------------------------",
STATUS_SUCCESS},
1547 { 0, 123456, 6, 11,
"123456\0----------------------------",
STATUS_SUCCESS},
1548 { 0, 1234567, 7, 11,
"1234567\0---------------------------",
STATUS_SUCCESS},
1549 { 0, 12345678, 8, 11,
"12345678\0--------------------------",
STATUS_SUCCESS},
1550 { 0, 123456789, 9, 11,
"123456789\0-------------------------",
STATUS_SUCCESS},
1551 { 0, 2147483646, 10, 11,
"2147483646\0------------------------",
STATUS_SUCCESS},
1552 { 0, 2147483647, 10, 11,
"2147483647\0------------------------",
STATUS_SUCCESS},
1553 { 0, 2147483648U, 10, 11,
"2147483648\0------------------------",
STATUS_SUCCESS},
1554 { 0, 2147483649U, 10, 11,
"2147483649\0------------------------",
STATUS_SUCCESS},
1555 { 0, 4294967294U, 10, 11,
"4294967294\0------------------------",
STATUS_SUCCESS},
1556 { 0, 4294967295U, 10, 11,
"4294967295\0------------------------",
STATUS_SUCCESS},
1558 { 2, 0x80000000U, 32, 33,
"10000000000000000000000000000000\0--",
STATUS_SUCCESS},
1559 { 2, -2147483647, 32, 33,
"10000000000000000000000000000001\0--",
STATUS_SUCCESS},
1560 { 2, -2, 32, 33,
"11111111111111111111111111111110\0--",
STATUS_SUCCESS},
1561 { 2, -1, 32, 33,
"11111111111111111111111111111111\0--",
STATUS_SUCCESS},
1562 { 2, 0, 1, 33,
"0\0---------------------------------",
STATUS_SUCCESS},
1563 { 2, 1, 1, 33,
"1\0---------------------------------",
STATUS_SUCCESS},
1564 { 2, 10, 4, 33,
"1010\0------------------------------",
STATUS_SUCCESS},
1565 { 2, 100, 7, 33,
"1100100\0---------------------------",
STATUS_SUCCESS},
1566 { 2, 1000, 10, 33,
"1111101000\0------------------------",
STATUS_SUCCESS},
1567 { 2, 10000, 14, 33,
"10011100010000\0--------------------",
STATUS_SUCCESS},
1568 { 2, 32767, 15, 33,
"111111111111111\0-------------------",
STATUS_SUCCESS},
1571 { 2, 65536, 17, 33,
"10000000000000000\0-----------------",
STATUS_SUCCESS},
1572 { 2, 100000, 17, 33,
"11000011010100000\0-----------------",
STATUS_SUCCESS},
1573 { 2, 1000000, 20, 33,
"11110100001001000000\0--------------",
STATUS_SUCCESS},
1574 { 2, 10000000, 24, 33,
"100110001001011010000000\0----------",
STATUS_SUCCESS},
1575 { 2, 100000000, 27, 33,
"101111101011110000100000000\0-------",
STATUS_SUCCESS},
1576 { 2, 1000000000, 30, 33,
"111011100110101100101000000000\0----",
STATUS_SUCCESS},
1577 { 2, 1073741823, 30, 33,
"111111111111111111111111111111\0----",
STATUS_SUCCESS},
1578 { 2, 2147483646, 31, 33,
"1111111111111111111111111111110\0---",
STATUS_SUCCESS},
1579 { 2, 2147483647, 31, 33,
"1111111111111111111111111111111\0---",
STATUS_SUCCESS},
1580 { 2, 2147483648U, 32, 33,
"10000000000000000000000000000000\0--",
STATUS_SUCCESS},
1581 { 2, 2147483649U, 32, 33,
"10000000000000000000000000000001\0--",
STATUS_SUCCESS},
1582 { 2, 4294967294U, 32, 33,
"11111111111111111111111111111110\0--",
STATUS_SUCCESS},
1583 { 2, 4294967295U, 32, 33,
"11111111111111111111111111111111\0--",
STATUS_SUCCESS},
1585 { 8, 0x80000000U, 11, 12,
"20000000000\0-----------------------",
STATUS_SUCCESS},
1586 { 8, -2147483647, 11, 12,
"20000000001\0-----------------------",
STATUS_SUCCESS},
1587 { 8, -2, 11, 12,
"37777777776\0-----------------------",
STATUS_SUCCESS},
1588 { 8, -1, 11, 12,
"37777777777\0-----------------------",
STATUS_SUCCESS},
1589 { 8, 0, 1, 12,
"0\0---------------------------------",
STATUS_SUCCESS},
1590 { 8, 1, 1, 12,
"1\0---------------------------------",
STATUS_SUCCESS},
1591 { 8, 2147483646, 11, 12,
"17777777776\0-----------------------",
STATUS_SUCCESS},
1592 { 8, 2147483647, 11, 12,
"17777777777\0-----------------------",
STATUS_SUCCESS},
1593 { 8, 2147483648U, 11, 12,
"20000000000\0-----------------------",
STATUS_SUCCESS},
1594 { 8, 2147483649U, 11, 12,
"20000000001\0-----------------------",
STATUS_SUCCESS},
1595 { 8, 4294967294U, 11, 12,
"37777777776\0-----------------------",
STATUS_SUCCESS},
1596 { 8, 4294967295U, 11, 12,
"37777777777\0-----------------------",
STATUS_SUCCESS},
1598 {10, 0x80000000U, 10, 11,
"2147483648\0------------------------",
STATUS_SUCCESS},
1599 {10, -2147483647, 10, 11,
"2147483649\0------------------------",
STATUS_SUCCESS},
1600 {10, -2, 10, 11,
"4294967294\0------------------------",
STATUS_SUCCESS},
1601 {10, -1, 10, 11,
"4294967295\0------------------------",
STATUS_SUCCESS},
1602 {10, 0, 1, 11,
"0\0---------------------------------",
STATUS_SUCCESS},
1603 {10, 1, 1, 11,
"1\0---------------------------------",
STATUS_SUCCESS},
1604 {10, 2147483646, 10, 11,
"2147483646\0------------------------",
STATUS_SUCCESS},
1605 {10, 2147483647, 10, 11,
"2147483647\0------------------------",
STATUS_SUCCESS},
1606 {10, 2147483648U, 10, 11,
"2147483648\0------------------------",
STATUS_SUCCESS},
1607 {10, 2147483649U, 10, 11,
"2147483649\0------------------------",
STATUS_SUCCESS},
1608 {10, 4294967294U, 10, 11,
"4294967294\0------------------------",
STATUS_SUCCESS},
1609 {10, 4294967295U, 10, 11,
"4294967295\0------------------------",
STATUS_SUCCESS},
1611 {16, 0x80000000U, 8, 9,
"80000000\0--------------------------",
STATUS_SUCCESS},
1612 {16, -2147483647, 8, 9,
"80000001\0--------------------------",
STATUS_SUCCESS},
1613 {16, -2, 8, 9,
"FFFFFFFE\0--------------------------",
STATUS_SUCCESS},
1614 {16, -1, 8, 9,
"FFFFFFFF\0--------------------------",
STATUS_SUCCESS},
1615 {16, 0, 1, 9,
"0\0---------------------------------",
STATUS_SUCCESS},
1616 {16, 1, 1, 9,
"1\0---------------------------------",
STATUS_SUCCESS},
1617 {16, 2147483646, 8, 9,
"7FFFFFFE\0--------------------------",
STATUS_SUCCESS},
1618 {16, 2147483647, 8, 9,
"7FFFFFFF\0--------------------------",
STATUS_SUCCESS},
1619 {16, 2147483648U, 8, 9,
"80000000\0--------------------------",
STATUS_SUCCESS},
1620 {16, 2147483649U, 8, 9,
"80000001\0--------------------------",
STATUS_SUCCESS},
1621 {16, 4294967294U, 8, 9,
"FFFFFFFE\0--------------------------",
STATUS_SUCCESS},
1622 {16, 4294967295U, 8, 9,
"FFFFFFFF\0--------------------------",
STATUS_SUCCESS},
1626 { 2, 65536, 17, 18,
"10000000000000000\0-----------------",
STATUS_SUCCESS},
1627 { 2, 65536, 17, 17,
"10000000000000000------------------",
STATUS_SUCCESS},
1628 { 2, 131072, 18, 19,
"100000000000000000\0----------------",
STATUS_SUCCESS},
1629 { 2, 131072, 18, 18,
"100000000000000000-----------------",
STATUS_SUCCESS},
1630 {16, 0xffffffff, 8, 9,
"FFFFFFFF\0--------------------------",
STATUS_SUCCESS},
1631 {16, 0xffffffff, 8, 8,
"FFFFFFFF---------------------------",
STATUS_SUCCESS, 1},
1633 {16, 0xa, 1, 2,
"A\0---------------------------------",
STATUS_SUCCESS},
1634 {16, 0xa, 1, 1,
"A----------------------------------",
STATUS_SUCCESS, 1},
1646 STRING expected_ansi_str;
1657 expected_unicode_string.
Buffer = expected_str_Buffer;
1658 pRtlUnicodeStringToAnsiString(&expected_ansi_str, &expected_unicode_string, 1);
1661 str_Buffer[
pos] =
'-';
1663 unicode_string.
Length = 0;
1665 unicode_string.
Buffer = str_Buffer;
1668 pRtlUnicodeStringToAnsiString(&ansi_str, &unicode_string, 1);
1672 expected_str_Buffer[
pos] =
'-';
1679 if (expected_unicode_string.
Length > 32 && unicode_string.
Length == 0) {
1681 expected_unicode_string.
Length = 0;
1685 "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) has result %lx, expected: %lx\n",
1689 "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) string \"%s\" is not NULL terminated\n",
1694 "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) assigns string \"%s\", expected: \"%s\"\n",
1698 "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) string has Length %d, expected: %d\n",
1701 "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) string has MaximumLength %d, expected: %d\n",
1703 pRtlFreeAnsiString(&expected_ansi_str);
1704 pRtlFreeAnsiString(&ansi_str);
1726 "(test %d): RtlIntegerToChar(%lu, %d, %d, [out]) has result %lx, expected: %lx\n",
1729 "(test %d): RtlIntegerToChar(%lu, %d, %d, [out]) assigns string \"%s\", expected: \"%s\"\n",
1744 "(test a): RtlIntegerToChar(%lu, %d, %d, NULL) has result %lx, expected: %lx\n",
1749 "(test b): RtlIntegerToChar(%lu, %d, %d, NULL) has result %lx, expected: %lx\n",
1754 "(test c): RtlIntegerToChar(%lu, %d, %d, NULL) has result %lx, expected: %lx\n",
1759 "(test d): RtlIntegerToChar(%lu, %d, %d, NULL) has result %lx, expected: %lx\n",
1765 char ascii[] =
"A simple string";
1766 char false_positive[] = {0x41, 0x0a, 0x0d, 0x1d};
1767 WCHAR false_negative = 0x0d0a;
1768 WCHAR unicode[] = {
'A',
' ',
'U',
'n',
'i',
'c',
'o',
'd',
'e',
' ',
's',
't',
'r',
'i',
'n',
'g',0};
1769 WCHAR unicode_no_controls[] = {
'A',
'U',
'n',
'i',
'c',
'o',
'd',
'e',
's',
't',
'r',
'i',
'n',
'g',0};
1771 WCHAR mixed_controls[] = {
'\t',0x9000,0x0d00,
'\n',0};
1773 WCHAR *be_unicode_no_controls;
1778 if (!pRtlIsTextUnicode)
1780 win_skip(
"RtlIsTextUnicode is not available\n");
1784 ok(!pRtlIsTextUnicode(ascii,
sizeof(ascii),
NULL),
"ASCII text detected as Unicode\n");
1786 res = pRtlIsTextUnicode(unicode,
sizeof(unicode),
NULL);
1789 "Text should be Unicode\n");
1791 ok(!pRtlIsTextUnicode(unicode,
sizeof(unicode) - 1,
NULL),
"Text should be Unicode\n");
1794 ok(pRtlIsTextUnicode(unicode,
sizeof(unicode), &
flags),
"Text should not pass a Unicode\n");
1796 "Expected flags 0x6, obtained %x\n",
flags);
1799 ok(!pRtlIsTextUnicode(unicode,
sizeof(unicode), &
flags),
"Text should not pass reverse Unicode tests\n");
1800 ok(
flags == 0,
"Expected flags 0, obtained %x\n",
flags);
1803 ok(!pRtlIsTextUnicode(unicode,
sizeof(unicode) - 1, &
flags),
"Odd length test should have passed\n");
1807 be_unicode[0] = 0xfffe;
1810 be_unicode[
i + 1] = (unicode[
i] >> 8) | ((unicode[
i] & 0xff) << 8);
1812 ok(!pRtlIsTextUnicode(be_unicode,
sizeof(unicode) + 2,
NULL),
"Reverse endian should not be Unicode\n");
1813 ok(!pRtlIsTextUnicode(&be_unicode[1],
sizeof(unicode),
NULL),
"Reverse endian should not be Unicode\n");
1816 ok(!pRtlIsTextUnicode(&be_unicode[1],
sizeof(unicode), &
flags),
"Reverse endian should be Unicode\n");
1819 "Expected flags 0x70, obtained %x\n",
flags);
1822 ok(!pRtlIsTextUnicode(be_unicode,
sizeof(unicode) + 2, &
flags),
"Reverse endian should be Unicode\n");
1824 "Expected flags 0xc0, obtained %x\n",
flags);
1828 ok(be_unicode_no_controls !=
NULL,
"Expected HeapAlloc to succeed.\n");
1829 be_unicode_no_controls[0] = 0xfffe;
1831 be_unicode_no_controls[
i + 1] = (unicode_no_controls[
i] >> 8) | ((unicode_no_controls[
i] & 0xff) << 8);
1842 ok(!pRtlIsTextUnicode(unicode_no_controls,
sizeof(unicode_no_controls), &
flags),
"Test should not pass on Unicode string lacking control characters.\n");
1843 ok(
flags == 0,
"Expected flags 0x0, obtained %x\n",
flags);
1846 ok(!pRtlIsTextUnicode(be_unicode_no_controls,
sizeof(unicode_no_controls), &
flags),
"Test should not pass on byte-reversed Unicode string lacking control characters.\n");
1847 ok(
flags == 0,
"Expected flags 0x0, obtained %x\n",
flags);
1850 ok(pRtlIsTextUnicode(unicode,
sizeof(unicode), &
flags),
"Test should pass on Unicode string lacking control characters.\n");
1854 ok(!pRtlIsTextUnicode(be_unicode_no_controls,
sizeof(unicode_no_controls) + 2, &
flags),
1855 "Test should not pass with standard Unicode string.\n");
1856 ok(
flags == 0,
"Expected flags 0x0, obtained %x\n",
flags);
1859 ok(pRtlIsTextUnicode(mixed_controls,
sizeof(mixed_controls), &
flags),
"Test should pass on a string containing control characters.\n");
1864 ok(!pRtlIsTextUnicode(be_unicode_no_controls,
sizeof(unicode_no_controls), &
flags),
"Test should not pass on Unicode string lacking control characters.\n");
1865 ok(
flags == 0,
"Expected flags 0x0, obtained %x\n",
flags);
1868 ok(!pRtlIsTextUnicode(unicode_no_controls,
sizeof(unicode_no_controls), &
flags),
"Test should not pass on Unicode string lacking control characters.\n");
1869 ok(
flags == 0,
"Expected flags 0x0, obtained %x\n",
flags);
1872 ok(!pRtlIsTextUnicode(unicode,
sizeof(unicode), &
flags),
"Test should not pass on Unicode string lacking control characters.\n");
1873 ok(
flags == 0,
"Expected flags 0x0, obtained %x\n",
flags);
1876 ok(!pRtlIsTextUnicode(be_unicode,
sizeof(unicode) + 2, &
flags),
1877 "Test should pass with byte-reversed Unicode string containing control characters.\n");
1881 ok(!pRtlIsTextUnicode(mixed_controls,
sizeof(mixed_controls), &
flags),
"Test should pass on a string containing byte-reversed control characters.\n");
1886 ok(!pRtlIsTextUnicode(mixed_controls,
sizeof(mixed_controls), &
flags),
"Test should pass on string containing both byte-reversed and standard control characters.\n");
1890 todo_wine ok(pRtlIsTextUnicode(false_positive,
sizeof(false_positive), &
flags),
"Test should pass on false positive.\n");
1892 ok(!pRtlIsTextUnicode(&false_negative,
sizeof(false_negative),
NULL),
"Test should fail on 0x0d0a (MALAYALAM LETTER UU).\n");
1907 for (ch1 = 0; ch1 < 512; ch1++)
1909 for (ch2 = 0; ch2 < 1024; ch2++)
1912 ok(
res == (ch1 - ch2),
"wrong result %ld %04x %04x\n",
res, ch1, ch2 );
1914 ok(
res == (pRtlUpcaseUnicodeChar(ch1) - pRtlUpcaseUnicodeChar(ch2)),
1915 "wrong result %ld %04x %04x\n",
res, ch1, ch2 );
1916 if (pRtlCompareUnicodeStrings)
1918 res = pRtlCompareUnicodeStrings( &ch1, 1, &ch2, 1,
FALSE );
1919 ok(
res == (ch1 - ch2),
"wrong result %ld %04x %04x\n",
res, ch1, ch2 );
1920 res = pRtlCompareUnicodeStrings( &ch1, 1, &ch2, 1,
TRUE );
1921 ok(
res == (pRtlUpcaseUnicodeChar(ch1) - pRtlUpcaseUnicodeChar(ch2)),
1922 "wrong result %ld %04x %04x\n",
res, ch1, ch2 );
1928static const WCHAR szGuid[] = {
'{',
'0',
'1',
'0',
'2',
'0',
'3',
'0',
'4',
'-',
1929 '0',
'5',
'0',
'6',
'-' ,
'0',
'7',
'0',
'8',
'-',
'0',
'9',
'0',
'A',
'-',
1930 '0',
'B',
'0',
'C',
'0',
'D',
'0',
'E',
'0',
'F',
'0',
'A',
'}',
'\0' };
1931static const WCHAR szGuid2[] = {
'{',
'0',
'1',
'0',
'2',
'0',
'3',
'0',
'4',
'-',
1932 '0',
'5',
'0',
'6',
'-' ,
'0',
'7',
'0',
'8',
'-',
'0',
'9',
'0',
'A',
'-',
1933 '0',
'B',
'0',
'C',
'0',
'D',
'0',
'E',
'0',
'F',
'0',
'A',
']',
'\0' };
1934DEFINE_GUID(IID_Endianness, 0x01020304, 0x0506, 0x0708, 0x09, 0x0A, 0x0B,
1935 0x0C, 0x0D, 0x0E, 0x0F, 0x0A);
1943 if (!pRtlGUIDFromString)
1945 win_skip(
"RtlGUIDFromString is not available\n");
1953 ok(
ret == 0,
"expected ret=0, got 0x%0lx\n",
ret);
1960 ok(
ret,
"expected ret!=0\n");
1968 if (!pRtlStringFromGUID)
1970 win_skip(
"RtlStringFromGUID is not available\n");
1974 str.Length =
str.MaximumLength = 0;
1977 ret = pRtlStringFromGUID(&IID_Endianness, &
str);
1978 ok(
ret == 0,
"expected ret=0, got 0x%0lx\n",
ret);
1980 pRtlFreeUnicodeString(&
str);
1990 {
L"T",
FALSE, 0x00000054 },
1991 {
L"Test",
FALSE, 0x766bb952 },
1992 {
L"TeSt",
FALSE, 0x764bb172 },
1993 {
L"test",
FALSE, 0x4745d132 },
1994 {
L"test",
TRUE, 0x6689c132 },
1995 {
L"TEST",
TRUE, 0x6689c132 },
1996 {
L"TEST",
FALSE, 0x6689c132 },
1997 {
L"t\xe9st",
FALSE, 0x8845cfb6 },
1998 {
L"t\xe9st",
TRUE, 0xa789bfb6 },
1999 {
L"T\xc9ST",
TRUE, 0xa789bfb6 },
2000 {
L"T\xc9ST",
FALSE, 0xa789bfb6 },
2001 {
L"abcdef",
FALSE, 0x971318c3 },
2007 static const WCHAR strW[] = {
'T',
'e',
's',
't',0,
'1',0};
2013 if (!pRtlHashUnicodeString)
2015 win_skip(
"RtlHashUnicodeString is not available\n");
2022 pRtlInitUnicodeString(&
str,
strW);
2032 str.MaximumLength =
sizeof(
strW);
2035 ok(
hash == 0x32803083,
"got 0x%08lx\n",
hash);
2040 pRtlInitUnicodeString(&
str,
ptr->str);
2044 ok(
hash ==
ptr->hash,
"got wrong hash 0x%08lx, expected 0x%08lx, for %s, mode %d\n",
hash,
ptr->hash,
2061 { {
'-',0x7f,
'-',0x80,
'-',0xff,
'-',0x100,
'-',0 },
"-\x7F-\xC2\x80-\xC3\xBF-\xC4\x80-",
STATUS_SUCCESS },
2062 { {
'-',0x7ff,
'-',0x800,
'-',0 },
"-\xDF\xBF-\xE0\xA0\x80-",
STATUS_SUCCESS },
2063 { {
'-',0xd7ff,
'-',0xe000,
'-',0 },
"-\xED\x9F\xBF-\xEE\x80\x80-",
STATUS_SUCCESS },
2065 { {
'-',0xffff,
'-',0xd800,0xdc00,
'-',0 },
"-\xEF\xBF\xBF-\xF0\x90\x80\x80-",
STATUS_SUCCESS },
2067 { {
'-',0xd800,0xdfff,
'-',0xd801,0xdc00,
'-',0 },
"-\xF0\x90\x8F\xBF-\xF0\x90\x90\x80-",
STATUS_SUCCESS },
2069 { {
'-',0xdbff,0xdfff,
'-',0 },
"-\xF4\x8F\xBF\xBF-",
STATUS_SUCCESS },
2077 { {
'-',0xfeff,
'-',0xfffe,
'-',0 },
"-\xEF\xBB\xBF-\xEF\xBF\xBE-",
STATUS_SUCCESS },
2081 { { 0xfffd,
'-', 0xfffe,
'-', 0xffff,
'-',0 },
"\xEF\xBF\xBD-\xEF\xBF\xBE-\xEF\xBF\xBF-",
STATUS_SUCCESS },
2084 { {
'-',0x0107,0x0327,
'-',0 },
"-\xC4\x87\xCC\xA7-",
STATUS_SUCCESS },
2085 { {
'-',0x00e7,0x0301,
'-',0 },
"-\xC3\xA7\xCC\x81-",
STATUS_SUCCESS },
2086 { {
'-',0x0063,0x0327,0x0301,
'-',0 },
"-\x63\xCC\xA7\xCC\x81-",
STATUS_SUCCESS },
2087 { {
'-',0x0063,0x0301,0x0327,
'-',0 },
"-\x63\xCC\x81\xCC\xA7-",
STATUS_SUCCESS },
2097 unsigned char *
buf = (
unsigned char *)
buffer;
2100 if (buflen == (
ULONG)-1)
2102 bytes_out = 0x55555555;
2104 status = pRtlUnicodeToUTF8N(
2105 out_string ?
buffer :
NULL, buflen, &bytes_out,
2106 in_string, in_bytes);
2107 ok_(__FILE__,
line)(
status == expect_status,
"status 0x%lx, expected 0x%lx\n",
status, expect_status);
2108 ok_(__FILE__,
line)(bytes_out == out_bytes,
"bytes_out = %lu, expected %lu\n", bytes_out, out_bytes);
2111 for (
i = 0;
i < bytes_out;
i++)
2113 "buffer[%d] = 0x%x, expected 0x%x\n",
2114 i,
buf[
i], out_string[
i]);
2117 "buffer[%d] = 0x%x, expected 0x55\n",
2121#define utf8_expect(out_string, buflen, out_bytes, in_string, in_bytes, expect_status) \
2122 utf8_expect_(out_string, buflen, out_bytes, in_string, in_bytes, expect_status, __LINE__)
2128 ULONG bytes_out_array[2];
2129 void *
const invalid_pointer = (
void *)0x8;
2131 const WCHAR empty_string[] = { 0 };
2133 const WCHAR special_string[] = {
'X',0x80,0xd800,0 };
2134 const ULONG special_string_len[] = { 0, 1, 1, 3, 3, 3, 6, 7 };
2135 const unsigned char special_expected[] = {
'X',0xc2,0x80,0xef,0xbf,0xbd,0 };
2136 unsigned int input_len;
2138 unsigned int i,
ret;
2140 if (!pRtlUnicodeToUTF8N)
2142 win_skip(
"RtlUnicodeToUTF8N is not available\n");
2147 memset(bytes_out_array, 0x55,
sizeof(bytes_out_array));
2148 status = pRtlUnicodeToUTF8N(
NULL, 0, bytes_out_array, empty_string, 0);
2150 ok(bytes_out_array[0] == 0x00000000,
"Got 0x%lx\n", bytes_out_array[0]);
2151 ok(bytes_out_array[1] == 0x55555555,
"Got 0x%lx\n", bytes_out_array[1]);
2160 bytes_out = 0x55555555;
2163 ok(bytes_out == 0x55555555,
"bytes_out = 0x%lx\n", bytes_out);
2165 bytes_out = 0x55555555;
2166 status = pRtlUnicodeToUTF8N(
NULL, 0, &bytes_out, invalid_pointer, 0);
2168 ok(bytes_out == 0,
"bytes_out = 0x%lx\n", bytes_out);
2170 bytes_out = 0x55555555;
2171 status = pRtlUnicodeToUTF8N(
NULL, 0, &bytes_out, empty_string, 0);
2173 ok(bytes_out == 0,
"bytes_out = 0x%lx\n", bytes_out);
2175 bytes_out = 0x55555555;
2178 ok(bytes_out == 0,
"bytes_out = 0x%lx\n", bytes_out);
2180 bytes_out = 0x55555555;
2181 status = pRtlUnicodeToUTF8N(
NULL, 0, &bytes_out, empty_string, 1);
2183 ok(bytes_out == 0,
"bytes_out = 0x%lx\n", bytes_out);
2185 bytes_out = 0x55555555;
2186 status = pRtlUnicodeToUTF8N(invalid_pointer, 0, &bytes_out, empty_string, 1);
2188 ok(bytes_out == 0x55555555,
"bytes_out = 0x%lx\n", bytes_out);
2190 bytes_out = 0x55555555;
2191 status = pRtlUnicodeToUTF8N(invalid_pointer, 8, &bytes_out, empty_string, 1);
2193 ok(bytes_out == 0x55555555,
"bytes_out = 0x%lx\n", bytes_out);
2196#define length_expect(in_chars, out_bytes, expect_status) \
2197 utf8_expect_(NULL, 0, out_bytes, \
2198 special_string, in_chars * sizeof(WCHAR), \
2199 expect_status, __LINE__)
2208 for (
i = 0;
i <= 6;
i++)
2211 bytes_out = 0xdeadbeef;
2212 status = pRtlUnicodeToUTF8N(
buffer,
i, &bytes_out, special_string,
sizeof(special_string));
2214 ok(bytes_out == special_string_len[
i],
"%d: expected %lu, got %lu\n",
i, special_string_len[
i], bytes_out);
2215 ok(
memcmp(
buffer, special_expected, special_string_len[
i]) == 0,
"%d: bad conversion\n",
i);
2218 status = pRtlUnicodeToUTF8N(
buffer, 7, &bytes_out, special_string,
sizeof(special_string));
2220 ok(bytes_out == special_string_len[7],
"expected %lu, got %lu\n", special_string_len[7], bytes_out);
2221 ok(
memcmp(
buffer, special_expected, 7) == 0,
"bad conversion\n");
2224 for (input_len = 0; input_len <=
sizeof(
test_string); input_len++) {
2230 bytes_out = 0x55555555;
2232 status = pRtlUnicodeToUTF8N(
2235 if (input_len %
sizeof(
WCHAR) == 0) {
2237 "(len %u): status = 0x%lx\n", input_len,
status);
2238 ok(bytes_out == input_len /
sizeof(
WCHAR),
2239 "(len %u): bytes_out = 0x%lx\n", input_len, bytes_out);
2240 for (
i = 0;
i < bytes_out;
i++) {
2242 "(len %u): buffer[%d] = 0x%x, expected 0x%x\n",
2247 "(len %u): buffer[%d] = 0x%x\n", input_len,
i,
buffer[
i]);
2251 "(len %u): status = 0x%lx\n", input_len,
status);
2252 ok(bytes_out == 0x55555555,
2253 "(len %u): bytes_out = 0x%lx\n", input_len, bytes_out);
2256 "(len %u): buffer[%d] = 0x%x\n", input_len,
i,
buffer[
i]);
2263 bytes_out = 0x55555555;
2265 status = pRtlUnicodeToUTF8N(
2269 "(test %d): status is 0x%lx, expected 0x%lx\n",
2272 "(test %d): bytes_out is %lu, expected %u\n",
2275 "(test %d): got \"%.*s\", expected \"%s\"\n",
2278 "(test %d): behind string: 0x%x\n",
i,
buffer[bytes_out]);
2284 "(test %d): got \"%.*s\", expected \"%s\"\n",
2289 bytes_out = 0x55555555;
2291 status = pRtlUnicodeToUTF8N(
2295 "(test %d): status is 0x%lx, expected 0x%lx\n",
2298 "(test %d): bytes_out is %lu, expected %u\n",
2301 "(test %d): got \"%.*s\", expected \"%s\"\n",
2304 "(test %d): behind string: 0x%x\n",
i,
buffer[bytes_out]);
2309 "(test %d): got \"%.*s\", expected \"%s\"\n",
2318 ok(
ret == 0,
"(test %d): wrong len %u\n",
i,
ret );
2326 "(test %d): got \"%.*s\", expected \"%s\"\n",
2343 {
"-\x7F-\xC2\x80-\xC3\xBF-\xC4\x80-", {
'-',0x7f,
'-',0x80,
'-',0xff,
'-',0x100,
'-',0 },
STATUS_SUCCESS },
2344 {
"-\xDF\xBF-\xE0\xA0\x80-", {
'-',0x7ff,
'-',0x800,
'-',0 },
STATUS_SUCCESS },
2345 {
"-\xED\x9F\xBF-\xEE\x80\x80-", {
'-',0xd7ff,
'-',0xe000,
'-',0 },
STATUS_SUCCESS },
2347 {
"-\xEF\xBF\xBF-\xF0\x90\x80\x80-", {
'-',0xffff,
'-',0xd800,0xdc00,
'-',0 },
STATUS_SUCCESS },
2349 {
"-\xF0\x90\x8F\xBF-\xF0\x90\x90\x80-", {
'-',0xd800,0xdfff,
'-',0xd801,0xdc00,
'-',0 },
STATUS_SUCCESS },
2351 {
"-\xF4\x8F\xBF\xBF-", {
'-',0xdbff,0xdfff,
'-',0 },
STATUS_SUCCESS },
2354 {
"-\xED\xA0\x80-\xED\xAF\xBF-", {
'-',0xfffd,0xfffd,
'-',0xfffd,0xfffd,
'-',0 },
STATUS_SOME_NOT_MAPPED },
2356 {
"-\xED\xB0\x80-\xED\xBF\xBF-", {
'-',0xfffd,0xfffd,
'-',0xfffd,0xfffd,
'-',0 },
STATUS_SOME_NOT_MAPPED },
2369 {
"-\xFA\x80\x80\x80\x80-", {
'-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,
'-',0 },
STATUS_SOME_NOT_MAPPED },
2371 {
"-\xFB\xBF\xBF\xBF\xBF-", {
'-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,
'-',0 },
STATUS_SOME_NOT_MAPPED },
2373 {
"-\xFC\x84\x80\x80\x80\x80-", {
'-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,
'-',0 },
STATUS_SOME_NOT_MAPPED },
2375 {
"-\xFD\xBF\xBF\xBF\xBF\xBF-", {
'-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,
'-',0 },
STATUS_SOME_NOT_MAPPED },
2377 {
"-\xC0\xAD-\xC0\x80-\xC1\xBF-", {
'-',0xfffd,0xfffd,
'-',0xfffd,0xfffd,
'-',0xfffd,0xfffd,
'-',0 },
STATUS_SOME_NOT_MAPPED },
2378 {
"-\xE0\x80\xAD-\xE0\x80\x80-\xE0\x9F\xBF-", {
'-',0xfffd,0xfffd,
'-',0xfffd,0xfffd,
'-',0xfffd,0xfffd,
'-',0 },
STATUS_SOME_NOT_MAPPED },
2382 {
"-\xF8\x80\x80\x80\xAD-", {
'-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,
'-',0 },
STATUS_SOME_NOT_MAPPED },
2383 {
"-\xF8\x80\x80\x80\x80-", {
'-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,
'-',0 },
STATUS_SOME_NOT_MAPPED },
2384 {
"-\xF8\x87\xBF\xBF\xBF-", {
'-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,
'-',0 },
STATUS_SOME_NOT_MAPPED },
2385 {
"-\xFC\x80\x80\x80\x80\xAD-", {
'-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,
'-',0 },
STATUS_SOME_NOT_MAPPED },
2386 {
"-\xFC\x80\x80\x80\x80\x80-", {
'-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,
'-',0 },
STATUS_SOME_NOT_MAPPED },
2387 {
"-\xFC\x83\xBF\xBF\xBF\xBF-", {
'-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,
'-',0 },
STATUS_SOME_NOT_MAPPED },
2391 {
"\xFE\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF", { 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0 },
STATUS_SOME_NOT_MAPPED },
2392 {
"\xFF\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF", { 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0 },
STATUS_SOME_NOT_MAPPED },
2393 {
"\xFF\x80\x80\x80\x80\x80\x80\x80\x80", { 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0 },
STATUS_SOME_NOT_MAPPED },
2394 {
"\xFF\x40\x80\x80\x80\x80\x80\x80\x80", { 0xfffd,0x40,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0 },
STATUS_SOME_NOT_MAPPED },
2410 {
"-\xEF\xBB\xBF-\xEF\xBF\xBE-", {
'-',0xfeff,
'-',0xfffe,
'-',0 },
STATUS_SUCCESS },
2414 {
"\xEF\xBF\xBD-\xEF\xBF\xBE-\xEF\xBF\xBF-", { 0xfffd,
'-',0xfffe,
'-',0xffff,
'-',0 },
STATUS_SUCCESS },
2417 {
"-\xC4\x87\xCC\xA7-", {
'-',0x0107,0x0327,
'-',0 },
STATUS_SUCCESS },
2418 {
"-\xC3\xA7\xCC\x81-", {
'-',0x00e7,0x0301,
'-',0 },
STATUS_SUCCESS },
2419 {
"-\x63\xCC\xA7\xCC\x81-", {
'-',0x0063,0x0327,0x0301,
'-',0 },
STATUS_SUCCESS },
2420 {
"-\x63\xCC\x81\xCC\xA7-", {
'-',0x0063,0x0301,0x0327,
'-',0 },
STATUS_SUCCESS },
2424 const char *in_string,
ULONG in_chars,
2432 if (buflen == (
ULONG)-1)
2434 bytes_out = 0x55555555;
2436 status = pRtlUTF8ToUnicodeN(
2437 out_string ?
buffer :
NULL, buflen, &bytes_out,
2438 in_string, in_chars);
2440 ok_(__FILE__,
line)(bytes_out == out_chars *
sizeof(
WCHAR),
2441 "bytes_out = %lu, expected %lu\n", bytes_out, out_chars * (
ULONG)
sizeof(
WCHAR));
2444 for (
i = 0;
i < bytes_out /
sizeof(
WCHAR);
i++)
2446 "buffer[%d] = 0x%x, expected 0x%x\n",
2450 "buffer[%d] = 0x%x, expected 0x5555\n",
2454#define unicode_expect(out_string, buflen, out_chars, in_string, in_chars, expect_status) \
2455 unicode_expect_(out_string, buflen, out_chars, in_string, in_chars, expect_status, __LINE__)
2461 ULONG bytes_out_array[2];
2462 void *
const invalid_pointer = (
void *)0x8;
2464 const char empty_string[] =
"";
2466 const WCHAR test_stringW[] = {
'A',0,
'a',
'b',
'c',
'd',
'e',
'f',
'g',0 };
2467 const char special_string[] = {
'X',0xc2,0x80,0xF0,0x90,0x80,0x80,0 };
2468 const WCHAR special_expected[] = {
'X',0x80,0xd800,0xdc00,0 };
2469 unsigned int input_len;
2471 unsigned int i,
ret;
2473 if (!pRtlUTF8ToUnicodeN)
2475 win_skip(
"RtlUTF8ToUnicodeN is not available\n");
2480 memset(bytes_out_array, 0x55,
sizeof(bytes_out_array));
2481 status = pRtlUTF8ToUnicodeN(
NULL, 0, bytes_out_array, empty_string, 0);
2483 ok(bytes_out_array[0] == 0x00000000,
"Got 0x%lx\n", bytes_out_array[0]);
2484 ok(bytes_out_array[1] == 0x55555555,
"Got 0x%lx\n", bytes_out_array[1]);
2493 bytes_out = 0x55555555;
2496 ok(bytes_out == 0x55555555,
"bytes_out = 0x%lx\n", bytes_out);
2498 bytes_out = 0x55555555;
2499 status = pRtlUTF8ToUnicodeN(
NULL, 0, &bytes_out, invalid_pointer, 0);
2501 ok(bytes_out == 0,
"bytes_out = 0x%lx\n", bytes_out);
2503 bytes_out = 0x55555555;
2504 status = pRtlUTF8ToUnicodeN(
NULL, 0, &bytes_out, empty_string, 0);
2506 ok(bytes_out == 0,
"bytes_out = 0x%lx\n", bytes_out);
2508 bytes_out = 0x55555555;
2511 ok(bytes_out == 0,
"bytes_out = 0x%lx\n", bytes_out);
2513 bytes_out = 0x55555555;
2514 status = pRtlUTF8ToUnicodeN(
NULL, 0, &bytes_out, empty_string, 1);
2516 ok(bytes_out ==
sizeof(
WCHAR),
"bytes_out = 0x%lx\n", bytes_out);
2519#define length_expect(in_chars, out_chars, expect_status) \
2520 unicode_expect_(NULL, 0, out_chars, special_string, in_chars, \
2521 expect_status, __LINE__)
2535#define truncate_expect(buflen, out_chars, expect_status) \
2536 unicode_expect_(special_expected, buflen, out_chars, \
2537 special_string, sizeof(special_string), \
2538 expect_status, __LINE__)
2551#undef truncate_expect
2554 for (input_len = 0; input_len <=
sizeof(
test_string); input_len++) {
2566 bytes_out = 0x55555555;
2568 status = pRtlUTF8ToUnicodeN(
2572 "(test %d): status is 0x%lx, expected 0x%lx\n",
2575 "(test %d): bytes_out is %lu, expected %lu\n",
2578 "(test %d): got %s, expected %s\n",
2581 "(test %d): behind string: 0x%x\n",
i,
buffer[bytes_out /
sizeof(
WCHAR)]);
2587 "(test %d): got %s, expected %s\n",
2590 "(test %d): behind string: 0x%x\n",
i,
buffer[
ret]);
2593 bytes_out = 0x55555555;
2595 status = pRtlUTF8ToUnicodeN(
2599 "(test %d): status is 0x%lx, expected 0x%lx\n",
2602 "(test %d): bytes_out is %lu, expected %lu\n",
2605 "(test %d): got %s, expected %s\n",
2608 "(test %d): behind string: 0x%x\n",
i,
buffer[bytes_out /
sizeof(
WCHAR)]);
2614 "(test %d): got %s, expected %s\n",
2617 "(test %d): behind string: 0x%x\n",
i,
buffer[
ret]);
2625 ok(
ret == 0,
"(test %d): wrong len %u\n",
i,
ret );
2633 "(test %d): got %s, expected %s\n",
2636 "(test %d): behind string: 0x%x\n",
i,
buffer[
ret]);
2646 *retsize = 0xdeadbeef;
2698 ok(
FALSE,
"RtlFormatMessage is unimplemented!\n");
2712 testfmt(
L"%1!ls!%1!lS!%1!ws!%1!wS!",
L"foofoofoofoo", 0,
TRUE,
L"foo" );
2726 testfmt(
L"%1!*.*u!,%1!*.*u!",
L" 001, 0002", 0,
FALSE, 5, 3, 1, 4, 2 );
2727 testfmt(
L"%1!*.*u!,%3!*.*u!",
L" 001, 0002", 0,
FALSE, 5, 3, 1, 6, 4, 2 );
2731 testfmt(
L"abc%1!#.000000000000000000000000000x!",
L"abc0x22", 0,
FALSE, 34 );
2732 testfmt(
L"a\r\nb\rc\r\rd\r\r\ne",
L"a\r\nb\r\nc\r\n\r\nd\r\n\r\ne", 0,
FALSE,
NULL );
2735 testfmt(
L"%1!x! %2!#I64x! %3!#I64x! %4!x!",
L"dead 0x1111222233334444 0x5555666677778888 beef",
2736 0,
FALSE, 0xdead, 0x1111222233334444ull, 0x5555666677778888ull, 0xbeef );
2737 testfmt(
L"%3!#I64x! %4!#I64x! %3!x! %1!x!",
L"0x3 0x4 3 1", 0,
FALSE, 0xdead00000001ll, 2, 3ll, 4ll );
2739 testfmt(
L"%2!*.*I64x! %1!u! %4!u! %2!u!",
L" 00000000000000d 19 11 17", 0,
FALSE,
2740 19ull, 17ull, 15ull, 13ull, 11ull, 9ull );
2756 testfmt(
L"%1!#I64x! %2!x!",
L"0x567800001234 beef", 0,
FALSE, 0x1234, 0x5678, 0xbeef );
2757 testfmt(
L"%1!x! %2!#I64x! %3!#I64x! %4!x!",
L"dead 0x1111222233334444 0x5555666677778888 beef",
2758 0,
FALSE, 0xdead, 0x1111222233334444ull, 0x5555666677778888ull, 0xbeef );
2759 testfmt(
L"%3!#I64x! %4!#I64x! %3!x! %1!x!",
L"0x1111222233334444 0x5555666677778888 33334444 1",
2760 0,
FALSE, 1, 2, 3, 4, 0x33334444, 0x11112222, 0x77778888, 0x55556666, 0xbeef, 0xbee2 );
2761 testfmt(
L"%2!x! %1!I64x!",
L"5678 1234", 0,
FALSE, 0x1234, 0x5678, 0xbeef );
2762 testfmt(
L"%2!*.*I64x! %1!u! %4!u! %2!u!",
L" 000090000000b 19 7 15", 0,
FALSE,
2763 19, 17, 15, 13, 11, 9, 7 );
2776 else win_skip(
"I64 support broken\n" );
2779 testfmt(
L"%1!#llx!%2!#x!%1!#hx!",
L"0x1234560x789abc0x3456", 0,
FALSE, 0x123456, 0x789abc );
2786 testfmt(
L"%1%2%3",
L"testing\r\nabcdef\r\nfoobar\r\n", 4,
FALSE,
L"testing",
L"abcdef",
L"foobar");
2787 testfmt(
L"%1%2%3%4",
L"test\r\nabcd\r\nabcdef\r\n", 4,
FALSE,
L"test",
L"abcd",
L"abc",
L"def" );
2788 testfmt(
L"%1a\nb%2",
L"testing\r\na\r\nbfoo bar\r\n", 3,
FALSE,
L"testing",
L"foo bar" );
2789 testfmt(
L"a%tb%t%t%t%c%r%r%r%r%r%rdefg",
L"a\r\nb\r\n\r\n\r\nc\r\r\r\r\r\rdef\r\ng", 3,
FALSE );
2791 testfmt(
L"test abcdef %1 foobar",
L"tes\r\nt\r\nabc\r\ndef\r\n\r\nhello\r\nfoo\r\nbar\r\n", 3,
FALSE,
L"hello" );
2792 testfmt(
L"te st\nabc d\nfoo",
L"te st\r\nabc d\r\nfoo", 6,
FALSE );
2793 testfmt(
L"te st ab d\nfoo",
L"te st\r\n ab\r\n d foo", 7,
FALSE );
2794 testfmt(
L"te\tst\t\t\t\tab\t\t\td\nfoo",
L"te\tst\t\t\r\n\t\tab\t\t\t\r\nd foo", 7,
FALSE );
2795 testfmt(
L"te st\n\n\r\n\nab d\nfoo ",
L"te st\r\n ab\r\n d foo\r\n ", 7,
FALSE );
2796 testfmt(
L"te st\r\nabc d\n\nfoo\rbar",
L"te st abc d foo bar", 0xff,
FALSE );
2797 testfmt(
L"te st%r%nabc d%nfoo%rbar",
L"te st\r\r\nabc d\r\nfoo\rbar", 0xff,
FALSE );
2798 testfmt(
L"\01\02\03\04\a\a\a\a\b\b\b\b\t\t\t\t\v\v\v\v\f\f\f\f\r\r\r\r a",
2799 L"\01\02\r\n\03\04\r\n\a\a\r\n\a\a\r\n\b\b\r\n\b\b\r\n\t\t\r\n\t\t\r\n\v\v\r\n\v\v\r\n\f\f\r\n\f\f\r\n\r\n\r\n\r\n\r\na", 2,
FALSE );
2801 for (
i = 1;
i < 0xffff;
i++)
2846 ok(
size == 0xdeadbeef,
"wrong size %lu\n",
size );
2853 ok(
size == 0xdeadbeef,
"wrong size %lu\n",
size );
2860 ok(
size == 0xdeadbeef,
"wrong size %lu\n",
size );
2867 ok(
size == 0xdeadbeef,
"wrong size %lu\n",
size );
2873 ok(
size == 0xdeadbeef,
"wrong size %lu\n",
size );
2891 ok(
size == 0xdeadbeef,
"wrong size %lu\n",
size );
2897 ok(
size == 0xdeadbeef,
"wrong size %lu\n",
size );
2903 ok(
size == 0xdeadbeef,
"wrong size %lu\n",
size );
2909 ok(
size == 0xdeadbeef,
"wrong size %lu\n",
size );
2925 ok(
size == 0xdeadbeef,
"wrong size %lu\n",
size );
2936 ok(
size == 0xdeadbeef,
"wrong size %lu\n",
size );
2942 ok(
size == 0xdeadbeef,
"wrong size %lu\n",
size );
2951 if (pRtlInitAnsiString) {
#define GetProcAddress(x, y)
#define HeapFree(x, y, z)
#define WideCharToMultiByte
#define MultiByteToWideChar
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
_ACRTIMP int __cdecl strncmp(const char *, const char *, size_t)
UNICODE_STRING * PUNICODE_STRING
#define STATUS_ACCESS_VIOLATION
GLint GLint GLsizei width
GLenum GLuint GLenum GLsizei const GLchar * buf
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 const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define WC_ERR_INVALID_CHARS
#define MB_ERR_INVALID_CHARS
int WINAPI lstrlenA(LPCSTR lpString)
#define memcpy(s1, s2, n)
static void test_RtlIntegerToUnicodeString(void)
static va_list ULONG *static WCHAR * AtoW(const char *p)
static void test_RtlIntegerToChar(void)
#define truncate_expect(buflen, out_chars, expect_status)
static const ustr2astr_t ustr2astr[]
static void one_RtlIntegerToUnicodeString_test(int test_num, const int2str_t *int2str)
static const str2int_t str2int[]
static void test_RtlDowncaseUnicodeString(void)
static void test_RtlUnicodeStringToAnsiString(void)
static void test_RtlUpcaseUnicodeString(void)
static void test_RtlCopyString(void)
static void utf8_expect_(const unsigned char *out_string, ULONG buflen, ULONG out_bytes, const WCHAR *in_string, ULONG in_bytes, NTSTATUS expect_status, int line)
static void test_RtlUpcaseUnicodeChar(void)
static void test_RtlHashUnicodeString(void)
static void test_RtlAppendUnicodeStringToString(void)
static void testfmt_arg_eaten(const WCHAR *src,...)
static void test_RtlIsTextUnicode(void)
static const app_asc2str_t app_asc2str[]
static const struct hash_unicodestring_test hash_test[]
static const struct unicode_to_utf8_test unicode_to_utf8[]
static void test_RtlInitString(void)
static void test_RtlGUIDFromString(void)
static void test_RtlAppendStringToString(void)
static void test_RtlUpperString(void)
static void test_RtlUnicodeStringToInteger(void)
static void test_RtlDuplicateUnicodeString(void)
static const app_ustr2str_t app_ustr2str[]
#define utf8_expect(out_string, buflen, out_bytes, in_string, in_bytes, expect_status)
#define length_expect(in_chars, out_bytes, expect_status)
static const int2str_t int2str[]
static const STRING *static UNICODE_STRING *static GUID *static UNICODE_STRING *static INT
static void test_RtlAppendAsciizToString(void)
static void test_RtlUnicodeToUTF8N(void)
static void InitFunctionPtrs(void)
static const struct utf8_to_unicode_test utf8_to_unicode[]
static void test_RtlAppendUnicodeToString(void)
static void test_RtlInitUnicodeStringEx(void)
static const STRING *static const UNICODE_STRING *static LPCWSTR
#define STRI_BUFFER_LENGTH
static void test_RtlCompareUnicodeString(void)
static void test_RtlStringFromGUID(void)
static void unicode_expect_(const WCHAR *out_string, ULONG buflen, ULONG out_chars, const char *in_string, ULONG in_chars, NTSTATUS expect_status, int line)
static void test_RtlUpperChar(void)
static void test_RtlFindCharInUnicodeString(void)
static const WCHAR szGuid[]
static void WINAPIV testfmt(const WCHAR *src, const WCHAR *expect, ULONG width, BOOL ansi,...)
#define unicode_expect(out_string, buflen, out_chars, in_string, in_chars, expect_status)
static void test_RtlInitUnicodeString(void)
static const app_str2str_t app_str2str[]
static UNICODE_STRING *static LONG
static const WCHAR szGuid2[]
static const app_uni2str_t app_uni2str[]
static void one_RtlIntegerToChar_test(int test_num, const int2str_t *int2str)
static void test_RtlCharToInteger(void)
static void test_RtlUTF8ToUnicodeN(void)
static const dupl_ustr_t dupl_ustr[]
static const find_ch_in_ustr_t find_ch_in_ustr[]
static void test_RtlFormatMessage(void)
#define STATUS_INVALID_PARAMETER_4
#define STATUS_SOME_NOT_MAPPED
#define STATUS_INVALID_PARAMETER_5
#define STATUS_NAME_TOO_LONG
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
#define IsEqualGUID(rguid1, rguid2)
XML_HIDDEN void xmlParserErrors const char const xmlChar const xmlChar * str2
XML_HIDDEN void xmlParserErrors const char const xmlChar * str1
#define STATUS_BUFFER_TOO_SMALL
#define STATUS_BUFFER_OVERFLOW
const char * search_chars
const UNICODE_STRING * PCUNICODE_STRING
#define STATUS_INVALID_PARAMETER
_In_ WDFDMATRANSACTION _In_ size_t MaximumLength
static UINT WPARAM LPARAM BOOL ansi
DWORD WINAPI GetLastError(void)
#define HASH_STRING_ALGORITHM_INVALID
#define HASH_STRING_ALGORITHM_X65599
#define ERROR_NO_UNICODE_TRANSLATION
#define IS_TEXT_UNICODE_UNICODE_MASK
#define IS_TEXT_UNICODE_REVERSE_ASCII16
#define IS_TEXT_UNICODE_REVERSE_CONTROLS
#define IS_TEXT_UNICODE_REVERSE_MASK
#define IS_TEXT_UNICODE_CONTROLS
#define IS_TEXT_UNICODE_ODD_LENGTH
#define IS_TEXT_UNICODE_REVERSE_SIGNATURE
#define IS_TEXT_UNICODE_STATISTICS
#define IS_TEXT_UNICODE_REVERSE_STATISTICS