27#define ULL(a,b) (((ULONG64)(a) << 32) | (b))
63 ok(
r==4,
"failed: r=%ld\n",
r);
79 ok(
r==0,
"succeeded: r=%ld\n",
r);
88 "Expected the buffer to be unchanged\n");
89 ok(
r==0,
"succeeded: r=%ld\n",
r);
98 "Expected the buffer to be unchanged\n");
99 ok(
r==0,
"succeeded: r=%ld\n",
r);
108 "Expected the buffer to be unchanged\n");
109 ok(
r==0,
"succeeded: r=%ld\n",
r);
118 "Expected the buffer to be unchanged\n");
119 ok(
r==0,
"succeeded: r=%ld\n",
r);
125 ok(
r==4,
"failed: r=%ld\n",
r);
130 ok(
r==4,
"failed: r=%ld\n",
r);
135 ok(
r==4,
"failed: r=%ld\n",
r);
140 ok(
r==4,
"failed: r=%ld\n",
r);
145 ok(
r==4,
"failed: r=%ld\n",
r);
150 ok(
r==4,
"failed: r=%ld\n",
r);
155 ok(
r==4,
"failed: r=%ld\n",
r);
160 ok(
r==4,
"failed: r=%ld\n",
r);
165 ok(
r==4,
"failed: r=%ld\n",
r);
170 ok(
r==4,
"failed: r=%ld\n",
r);
175 ok(
r==4,
"failed: r=%ld\n",
r);
180 ok(
r==3,
"failed: r=%ld\n",
r);
185 ok(
r==4,
"failed: r=%ld\n",
r);
190 ok(
r==4,
"failed: r=%ld\n",
r);
195 ok(
r==4,
"failed: r=%ld\n",
r);
200 ok(
r==4,
"failed: r=%ld\n",
r);
205 ok(
r==4,
"failed: r=%ld\n",
r);
210 ok(
r==4,
"failed: r=%ld\n",
r);
215 ok(
r==4,
"failed: r=%ld\n",
r);
220 ok(
r==4,
"failed: r=%ld\n",
r);
225 ok(
r==8,
"failed: r=%ld\n",
r);
230 ok(
r==4,
"failed: r=%ld\n",
r);
235 ok(
r==4,
"failed: r=%ld\n",
r);
240 ok(
r==4,
"failed: r=%ld\n",
r);
245 ok(
r==4,
"failed: r=%ld\n",
r);
250 ok(
r==4,
"failed: r=%ld\n",
r);
255 ok(
r==4,
"failed: r=%ld\n",
r);
260 ok(
r==2,
"failed: r=%ld\n",
r);
265 ok(
r==4,
"failed: r=%ld\n",
r);
270 ok(
r==6,
"failed: r=%ld\n",
r);
276 ok(
r==3,
"failed: r=%ld\n",
r);
279 ok(
r==4,
"failed: r=%ld\n",
r);
282 ok(
r==4,
"failed: r=%ld\n",
r);
285 ok(
r==5,
"failed: r=%ld\n",
r);
289 ok(
r==11,
"failed: r=%ld\n",
r);
295 ok(
r==12,
"failed: r=%ld\n",
r);
302 ok(
r==13,
"failed: r=%ld\n",
r);
306 ok(
r==12,
"failed: r=%ld\n",
r);
315 ok(
r==3,
"failed: r=%ld\n",
r);
321 ok(
r==3,
"failed: r=%ld\n",
r);
327 ok(
r==1,
"failed: r=%ld\n",
r);
333 ok(
r==2,
"failed: r=%ld\n",
r);
340 static const char init_buf[] = {
'x',
'x',
'x',
'x',
'x',
'x'};
345 ok(
r==4,
"failed: r=%ld\n",
r);
359 ok(!
memcmp(
out, init_buf,
sizeof(init_buf)),
"Expected the buffer to be untouched\n");
360 ok(
r==0,
"succeeded: r=%ld\n",
r);
369 "Expected the buffer to be untouched\n");
370 ok(
r==0,
"succeeded: r=%ld\n",
r);
379 "Expected the buffer to be untouched\n");
380 ok(
r==0,
"succeeded: r=%ld\n",
r);
388 ok(!
memcmp(
out, init_buf,
sizeof(init_buf)),
"Expected the buffer to be untouched\n");
389 ok(
r==0,
"succeeded: r=%ld\n",
r);
396 ok(!
memcmp(
out, init_buf,
sizeof(init_buf)),
"Expected the buffer to be untouched\n");
397 ok(
r==0,
"succeeded: r=%ld\n",
r);
403 ok(
r==4,
"failed: r=%ld\n",
r);
408 ok(
r==4,
"failed: r=%ld\n",
r);
413 ok(
r==4,
"failed: r=%ld\n",
r);
418 ok(
r==4,
"failed: r=%ld\n",
r);
423 ok(
r==4,
"failed: r=%ld\n",
r);
428 ok(
r==4,
"failed: r=%ld\n",
r);
433 ok(
r==4,
"failed: r=%ld\n",
r);
438 ok(
r==4,
"failed: r=%ld\n",
r);
444 ok(
r==4,
"failed: r=%ld\n",
r);
450 ok(
r==4,
"failed: r=%ld\n",
r);
456 ok(
r==4,
"failed: r=%ld\n",
r);
462 ok(
r==4,
"failed: r=%ld\n",
r);
467 ok(
r==3,
"failed: r=%ld\n",
r);
472 ok(
r==4,
"failed: r=%ld\n",
r);
477 ok(
r==4,
"failed: r=%ld\n",
r);
482 ok(
r==4,
"failed: r=%ld\n",
r);
487 ok(
r==4,
"failed: r=%ld\n",
r);
492 ok(
r==4,
"failed: r=%ld\n",
r);
497 ok(
r==4,
"failed: r=%ld\n",
r);
502 ok(
r==4,
"failed: r=%ld\n",
r);
507 ok(
r==4,
"failed: r=%ld\n",
r);
512 ok(
r==7,
"failed: r=%ld\n",
r);
517 ok(
r==4,
"failed: r=%ld\n",
r);
522 ok(
r==4,
"failed: r=%ld\n",
r);
527 ok(
r==4,
"failed: r=%ld\n",
r);
532 ok(
r==4,
"failed: r=%ld\n",
r);
537 ok(
r==4,
"failed: r=%ld\n",
r);
542 ok(
r==4,
"failed: r=%ld\n",
r);
547 ok(
r==2,
"failed: r=%ld\n",
r);
552 ok(
r==4,
"failed: r=%ld\n",
r);
557 ok(
r==6,
"failed: r=%ld\n",
r);
562 0, 0,
out,
sizeof(
out),
"t" );
564 ok(
r==3,
"failed: r=%ld\n",
r);
566 0, 0,
out,
sizeof(
out), 4,
"t");
571 ok(
r==4,
"failed: r=%ld\n",
r);
573 0, 0,
out,
sizeof(
out), 3 );
575 ok(
r==4,
"failed: r=%ld\n",
r);
577 0, 0,
out,
sizeof(
out), 5, 3, 1 );
579 ok(
r==5,
"failed: r=%ld\n",
r);
581 0, 0,
out,
sizeof(
out), 5, 3, 1, 4, 2 );
583 ok(
r==11,
"failed: r=%ld\n",
r);
585 0, 0,
out,
sizeof(
out), 5, 3, 1, 6, 4, 2 );
590 "failed out=[%s]\n",
out);
591 ok(
r==12,
"failed: r=%ld\n",
r);
598 ok(
r==13,
"failed: r=%ld\n",
r);
602 ok(
r==12,
"failed: r=%ld\n",
r);
612 ok(
r==3,
"failed: r=%ld\n",
r);
618 ok(
r==3,
"failed: r=%ld\n",
r);
624 ok(
r==1,
"failed: r=%ld\n",
r);
630 ok(
r==2,
"failed: r=%ld\n",
r);
635 static const char init_buf[] = {
'x',
'x',
'x',
'x',
'x'};
642 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %ld\n",
ret);
643 ok(!
strcmp(
"test",
out),
"Expected output string \"test\", got %s\n",
out);
648 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %ld\n",
ret);
649 ok(!
strcmp(
"test",
out),
"Expected output string \"test\", got %s\n",
out);
653 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %ld\n",
ret);
654 ok(!
strcmp(
"test",
out),
"Expected output string \"test\", got %s\n",
out);
661 ok(
ret == 0,
"Expected FormatMessageA to return 0, got %ld\n",
ret);
662 ok(!
memcmp(
out, init_buf,
sizeof(init_buf)),
"Expected the output buffer to be untouched\n");
664 "Expected GetLastError() to return ERROR_NO_WORK_DONE, got %lu\n",
GetLastError());
669 ok(
ret == 17,
"Expected FormatMessageA to return 17, got %ld\n",
ret);
670 ok(!
strcmp(
"test%1%2!*.*s!%99",
out),
"Expected output string \"test%%1%%2!*.*s!%%99\", got %s\n",
out);
675 ok(
ret == 8,
"Expected FormatMessageA to return 8, got %ld\n",
ret);
676 ok(!
strcmp(
"%%% %.%!",
out),
"Expected output string \"%%%%%% %%.%%!\", got %s\n",
out);
680 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %ld\n",
ret);
681 ok(!
strcmp(
"\r\n\r\t",
out),
"Expected output string \"\\r\\n\\r\\t\", got %s\n",
out);
686 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %ld\n",
ret);
687 ok(!
strcmp(
"hi\r\n",
out),
"Expected output string \"hi\\r\\n\", got %s\n",
out);
691 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %ld\n",
ret);
692 ok(!
strcmp(
"hi\r\n",
out),
"Expected output string \"hi\\r\\n\", got %s\n",
out);
696 ok(
ret == 2,
"Expected FormatMessageA to return 2, got %ld\n",
ret);
697 ok(!
strcmp(
"\r\n",
out),
"Expected output string \"\\r\\n\", got %s\n",
out);
701 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %ld\n",
ret);
702 ok(!
strcmp(
"\r\n\r\n",
out),
"Expected output string \"\\r\\n\\r\\n\", got %s\n",
out);
707 ok(!
strcmp(
"hi ",
out),
"Expected output string \"hi \", got %s\n",
out);
708 ok(
ret == 3,
"Expected FormatMessageA to return 3, got %ld\n",
ret);
712 ok(
ret == 3,
"Expected FormatMessageA to return 3, got %ld\n",
ret);
713 ok(!
strcmp(
"hi ",
out),
"Expected output string \"hi \", got %s\n",
out);
717 ok(
ret == 1,
"Expected FormatMessageA to return 1, got %ld\n",
ret);
718 ok(!
strcmp(
" ",
out),
"Expected output string \" \", got %s\n",
out);
722 ok(
ret == 2,
"Expected FormatMessageA to return 2, got %ld\n",
ret);
723 ok(!
strcmp(
" ",
out),
"Expected output string \" \", got %s\n",
out);
733 ok(
ret == 4,
"Expected FormatMessageW to return 4, got %ld\n",
ret);
739 ok(
ret == 4,
"Expected FormatMessageW to return 4, got %ld\n",
ret);
744 ok(
ret == 4,
"Expected FormatMessageW to return 4, got %ld\n",
ret);
751 ok(
ret == 0,
"Expected FormatMessageW to return 0, got %ld\n",
ret);
754 "Expected GetLastError() to return ERROR_NO_WORK_DONE, got %lu\n",
GetLastError());
759 ok(
ret == 17,
"Expected FormatMessageW to return 17, got %ld\n",
ret);
765 ok(
ret == 8,
"Expected FormatMessageW to return 8, got %ld\n",
ret);
770 ok(
ret == 4,
"Expected FormatMessageW to return 4, got %ld\n",
ret);
776 ok(
ret == 4,
"Expected FormatMessageW to return 4, got %ld\n",
ret);
781 ok(
ret == 4,
"Expected FormatMessageW to return 4, got %ld\n",
ret);
786 ok(
ret == 2,
"Expected FormatMessageW to return 2, got %ld\n",
ret);
791 ok(
ret == 4,
"Expected FormatMessageW to return 4, got %ld\n",
ret);
798 ok(
ret == 3,
"Expected FormatMessageW to return 3, got %ld\n",
ret);
804 ok(
ret == 3,
"Expected FormatMessageW to return 3, got %ld\n",
ret);
809 ok(
ret == 1,
"Expected FormatMessageW to return 1, got %ld\n",
ret);
815 ok(
ret == 2,
"Expected FormatMessageW to return 2, got %ld\n",
ret);
827 "short long line", 0, 0,
out,
sizeof(
out),
NULL);
828 ok(
ret == 15,
"Expected FormatMessageW to return 15, got %ld\n",
ret);
833 "short long line", 0, 0,
out,
sizeof(
out),
NULL);
834 ok(
ret == 16,
"Expected FormatMessageW to return 16, got %ld\n",
ret);
839 "short long long line", 0, 0,
out,
sizeof(
out),
NULL);
840 ok(
ret == 21,
"Expected FormatMessageW to return 21, got %ld\n",
ret);
841 ok(!
strcmp(
"short long long\r\nline",
out),
"failed out=[%s]\n",
out);
845 "short long line", 0, 0,
out,
sizeof(
out),
NULL);
846 ok(
ret == 16,
"Expected FormatMessageW to return 16, got %ld\n",
ret);
851 "short long line", 0, 0,
out,
sizeof(
out),
NULL);
852 ok(
ret == 16,
"Expected FormatMessageW to return 16, got %ld\n",
ret);
856 "short long wordlongerthanaline", 0, 0,
out,
sizeof(
out),
NULL);
857 ok(
ret == 33,
"Expected FormatMessageW to return 33, got %ld\n",
ret);
858 ok(!
strcmp(
"short long\r\nwordlongerthanal\r\nine",
out),
"failed out=[%s]\n",
out);
862 "short long line", 0, 0,
out,
sizeof(
out),
NULL);
863 ok(
ret == 18,
"Expected FormatMessageW to return 18, got %ld\n",
ret);
867 "short long wordlongerthanaline", 0, 0,
out,
sizeof(
out),
NULL);
868 ok(
ret == 35,
"Expected FormatMessageW to return 35, got %ld\n",
ret);
869 ok(!
strcmp(
"short long\r\n\r\nwordlongerth\r\nanaline",
out),
"failed out=[%s]\n",
out);
874 ok(
ret == 13,
"Expected FormatMessageW to return 13, got %ld\n",
ret);
878 " shortlong line", 0, 0,
out,
sizeof(
out),
NULL);
879 ok(
ret == 17,
"Expected FormatMessageW to return 17, got %ld\n",
ret);
880 ok(!
strcmp(
"\r\nshortlong\r\nline",
out),
"failed out=[%s]\n",
out);
884 "l1%n shortlong line", 0, 0,
out,
sizeof(
out),
NULL);
885 ok(
ret == 21,
"Expected FormatMessageW to return 21, got %ld\n",
ret);
886 ok(!
strcmp(
"l1\r\n\r\nshortlong\r\nline",
out),
"failed out=[%s]\n",
out);
891 ok(
ret == 7,
"Expected FormatMessageW to return 7, got %ld\n",
ret);
897 ok(
ret == 10,
"Expected FormatMessageW to return 10, got %ld\n",
ret);
903 ok(
ret == 10,
"Expected FormatMessageW to return 10, got %ld\n",
ret);
908 "shortlongline", 0, 0,
out,
sizeof(
out),
NULL);
909 ok(
ret == 15,
"Expected FormatMessageW to return 15, got %ld\n",
ret);
914 "short long line", 0, 0,
out,
sizeof(
out),
NULL);
915 ok(
ret == 17,
"Expected FormatMessageW to return 17, got %ld\n",
ret);
916 ok(!
strcmp(
"short\r\nlong\r\nline",
out),
"failed out=[%s]\n",
out);
920 "short\nlong line", 0, 0,
out,
sizeof(
out),
NULL);
921 ok(
ret == 16,
"Expected FormatMessageW to return 16, got %ld\n",
ret);
927 ok(
ret == 12,
"Expected FormatMessageW to return 12, got %ld\n",
ret);
932 "short%nlong line", 0, 0,
out,
sizeof(
out),
NULL);
933 ok(
ret == 16,
"Expected FormatMessageW to return 16, got %ld\n",
ret);
937 "short%nlong line", 0, 0,
out,
sizeof(
out),
NULL);
938 ok(
ret == 17,
"Expected FormatMessageW to return 17, got %ld\n",
ret);
939 ok(!
strcmp(
"short\r\nlong\r\nline",
out),
"failed out=[%s]\n",
out);
943 "short%rlong line", 0, 0,
out,
sizeof(
out),
NULL);
944 ok(
ret == 15,
"Expected FormatMessageW to return 15, got %ld\n",
ret);
948 "short%rlong line", 0, 0,
out,
sizeof(
out),
NULL);
949 ok(
ret == 16,
"Expected FormatMessageW to return 16, got %ld\n",
ret);
954 "short%nlong line%1", 0, 0,
out,
sizeof(
out),
NULL);
955 ok(
ret == 19,
"Expected FormatMessageW to return 19, got %ld\n",
ret);
956 ok(!
strcmp(
"short\r\nlong\r\nline%1",
out),
"failed out=[%s]\n",
out);
961 for (
i=0;
i < 26;
i++)
968 ok(
ret == 272,
"Expected FormatMessageW to return 272, got %ld\n",
ret);
973 "short long\tline", 0, 0,
out,
sizeof(
out),
NULL);
974 ok(
ret == 16,
"Expected FormatMessageW to return 16, got %ld\n",
ret);
978 "short long-line", 0, 0,
out,
sizeof(
out),
NULL);
979 ok(
ret == 16,
"Expected FormatMessageW to return 16, got %ld\n",
ret);
983 "short long_line", 0, 0,
out,
sizeof(
out),
NULL);
984 ok(
ret == 16,
"Expected FormatMessageW to return 16, got %ld\n",
ret);
988 "short long.line", 0, 0,
out,
sizeof(
out),
NULL);
989 ok(
ret == 16,
"Expected FormatMessageW to return 16, got %ld\n",
ret);
993 "short long,line", 0, 0,
out,
sizeof(
out),
NULL);
994 ok(
ret == 16,
"Expected FormatMessageW to return 16, got %ld\n",
ret);
998 "short long!line", 0, 0,
out,
sizeof(
out),
NULL);
999 ok(
ret == 16,
"Expected FormatMessageW to return 16, got %ld\n",
ret);
1003 "short long?line", 0, 0,
out,
sizeof(
out),
NULL);
1004 ok(
ret == 16,
"Expected FormatMessageW to return 16, got %ld\n",
ret);
1019 "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %lu\n",
GetLastError());
1020 ok(
ret == 0,
"Expected FormatMessageW to return 0, got %lu\n",
ret);
1021 ok(
out[0] == 0,
"Expected null, got %ls\n",
out);
1024 ok(!!
arg,
"arg should not be NULL!\n");
1033 static const char init_buf[] = {
'x',
'x',
'x',
'x',
'x'};
1034 static const char expected_buf[] = {
'x',
'x',
'x',
'x',
'x'};
1039 memcpy(
out, init_buf,
sizeof(init_buf));
1041 ok(
ret == 0,
"Expected FormatMessageA to return 0, got %lu\n",
ret);
1043 "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %lu\n",
1045 ok(!
memcmp(expected_buf,
out,
sizeof(expected_buf)),
1046 "Expected the buffer to be untouched\n");
1049 memcpy(
out, init_buf,
sizeof(init_buf));
1051 ok(
ret == 0,
"Expected FormatMessageA to return 0, got %lu\n",
ret);
1053 "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %lu\n",
1055 ok(!
memcmp(expected_buf,
out,
sizeof(expected_buf)),
1056 "Expected the buffer to be untouched\n");
1059 memcpy(
out, init_buf,
sizeof(init_buf));
1061 ok(
ret == 0,
"Expected FormatMessageA to return 0, got %lu\n",
ret);
1063 "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %lu\n",
1065 ok(!
memcmp(expected_buf,
out,
sizeof(expected_buf)),
1066 "Expected the buffer to be untouched\n");
1073 for (
i = 0;
i <
size;
i++) tmp[
i] =
'A' +
i % 26;
1129 ok(
ret == 0,
"Expected FormatMessageA to return 0, got %lu\n",
ret);
1131 "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %lu\n",
1134 "Expected the buffer to be untouched\n");
1139 ok(
ret == 0,
"Expected FormatMessageA to return 0, got %lu\n",
ret);
1141 "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %lu\n",
1145 "Expected the buffer to be truncated\n");
1150 ok(
ret == 0,
"Expected FormatMessageA to return 0, got %lu\n",
ret);
1152 "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %lu\n",
1156 "Expected the buffer to be truncated\n");
1162 for (
i = 0;
i <
size;
i++) tmp[
i] =
'A' +
i % 26;
1192 ok(!
ret,
"FormatMessageA returned %lu\n",
ret);
1198 ok(!
ret,
"FormatMessageA returned %lu\n",
ret);
1210 ok(!
ret,
"FormatMessageA returned %lu\n",
ret);
1216 ok(!
ret,
"FormatMessageA returned %lu\n",
ret);
1222 ok(!
ret,
"FormatMessageA returned %lu\n",
ret);
1233 ok(!
ret,
"FormatMessageW returned %lu\n",
ret);
1239 ok(!
ret,
"FormatMessageW returned %lu\n",
ret);
1245 ok(!
ret,
"FormatMessageW returned %lu\n",
ret);
1251 ok(!
ret,
"FormatMessageW returned %lu\n",
ret);
1257 ok(!
ret,
"FormatMessageW returned %lu\n",
ret);
1263 ok(!
ret,
"FormatMessageW returned %lu\n",
ret);
1280 buf = (
char *)0xdeadbeef;
1282 "", 0, 0, (
char *)&
buf, 0,
NULL);
1283 ok(
ret == 0,
"Expected FormatMessageA to return 0, got %lu\n",
ret);
1284 ok(
buf ==
NULL,
"Expected output buffer pointer to be NULL\n");
1286 "Expected GetLastError() to return ERROR_NO_WORK_DONE, got %lu\n",
GetLastError());
1288 buf = (
char *)0xdeadbeef;
1290 "test", 0, 0, (
char *)&
buf, 0,
NULL);
1291 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %lu\n",
ret);
1293 "Expected output buffer pointer to be valid\n");
1294 if (
buf !=
NULL &&
buf != (
char *)0xdeadbeef)
1297 "Expected buffer to contain \"test\", got %s\n",
buf);
1301 buf = (
char *)0xdeadbeef;
1304 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %lu\n",
ret);
1306 "Expected output buffer pointer to be valid\n");
1307 if (
buf !=
NULL &&
buf != (
char *)0xdeadbeef)
1310 "Expected buffer to contain \"test\", got %s\n",
buf);
1314 buf = (
char *)0xdeadbeef;
1317 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %lu\n",
ret);
1319 "Expected output buffer pointer to be valid\n");
1320 if (
buf !=
NULL &&
buf != (
char *)0xdeadbeef)
1323 "Expected buffer to contain \"test\", got %s\n",
buf);
1327 buf = (
char *)0xdeadbeef;
1330 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %lu\n",
ret);
1332 "Expected output buffer pointer to be valid\n");
1333 if (
buf !=
NULL &&
buf != (
char *)0xdeadbeef)
1336 "Expected buffer to contain \"test\", got %s\n",
buf);
1340 buf = (
char *)0xdeadbeef;
1342 "test", 0, 0, (
char *)&
buf, 1024,
NULL);
1343 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %lu\n",
ret);
1345 "Expected output buffer pointer to be valid\n");
1346 if (
buf !=
NULL &&
buf != (
char *)0xdeadbeef)
1349 "Expected buffer to contain \"test\", got %s\n",
buf);
1377 ok(
ret == 0,
"Expected FormatMessageW to return 0, got %lu\n",
ret);
1378 ok(
buf ==
NULL,
"Expected output buffer pointer to be NULL\n");
1380 "Expected GetLastError() to return ERROR_NO_WORK_DONE, got %lu\n",
GetLastError());
1386 ok(
ret == 0,
"Expected FormatMessageW to return 0, got %lu\n",
ret);
1387 ok(
buf ==
NULL,
"Expected output buffer pointer to be NULL\n");
1389 "Expected GetLastError() to return ERROR_NO_WORK_DONE, got %lu\n",
GetLastError());
1394 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %lu\n",
ret);
1396 "Expected output buffer pointer to be valid\n");
1407 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %lu\n",
ret);
1409 "Expected output buffer pointer to be valid\n");
1420 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %lu\n",
ret);
1422 "Expected output buffer pointer to be valid\n");
1433 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %lu\n",
ret);
1435 "Expected output buffer pointer to be valid\n");
1446 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %lu\n",
ret);
1448 "Expected output buffer pointer to be valid\n");
1464 ok(
h != 0,
"GetModuleHandle failed\n");
1470 ok(
ret != 0,
"FormatMessageA returned 0\n");
1475 ok(
ret != 0,
"FormatMessageA returned 0\n");
1479 ok(
ret != 0,
"FormatMessageA returned 0\n");
1484 ok(
ret == 0,
"FormatMessageA returned non-zero\n");
1489 ok(
ret == 0,
"FormatMessageA returned non-zero\n");
1496 ok(
ret == 0,
"FormatMessageA returned %lu instead of 0\n",
ret);
1505 ok(
ret == 0,
"FormatMessageA returned %lu instead of 0\n",
ret);
1514 ok(
ret == 0,
"FormatMessageA returned %lu instead of 0\n",
ret);
1523 ok(
ret == 0,
"FormatMessageA returned %lu instead of 0\n",
ret);
1529 "last error %lu\n",
error);
1535 ok(
ret == 0,
"FormatMessageA returned %lu instead of 0\n",
ret);
1541 "last error %lu\n",
error);
1546 static const char init_buf[] = {
'x',
'x',
'x',
'x',
'x'};
1553 memcpy(
out, init_buf,
sizeof(init_buf));
1555 ok(
ret == 0,
"Expected FormatMessageA to return 0, got %lu\n",
ret);
1557 "Expected the output buffer to be untouched\n");
1559 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
1563 ptr = (
char *)0xdeadbeef;
1565 ok(
ret == 0,
"Expected FormatMessageA to return 0, got %lu\n",
ret);
1566 ok(
ptr ==
NULL,
"Expected output pointer to be initialized to NULL, got %p\n",
ptr);
1568 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
1572 memcpy(
out, init_buf,
sizeof(init_buf));
1574 ok(
ret == 0,
"Expected FormatMessageA to return 0, got %lu\n",
ret);
1576 "Expected the output buffer to be untouched\n");
1578 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
1582 memcpy(
out, init_buf,
sizeof(init_buf));
1584 ok(
ret == 0,
"Expected FormatMessageA to return 0, got %lu\n",
ret);
1586 "Expected the output buffer to be untouched\n");
1588 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
1592 memcpy(
out, init_buf,
sizeof(init_buf));
1594 ok(
ret == 0,
"Expected FormatMessageA to return 0, got %lu\n",
ret);
1596 "Expected the output buffer to be untouched\n");
1598 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
1605 memcpy(
out, init_buf,
sizeof(init_buf));
1608 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %lu\n",
ret);
1610 "Expected the output buffer to be untouched\n");
1612 memcpy(
out, init_buf,
sizeof(init_buf));
1615 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %lu\n",
ret);
1617 "Expected the output buffer to be untouched\n");
1619 memcpy(
out, init_buf,
sizeof(init_buf));
1622 ok(
ret == 4,
"Expected FormatMessageA to return 4, got %lu\n",
ret);
1624 "Expected the output buffer to be untouched\n");
1636 ok(
ret == 0,
"Expected FormatMessageW to return 0, got %lu\n",
ret);
1638 "Expected the output buffer to be untouched\n");
1640 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
1646 ok(
ret == 0,
"Expected FormatMessageW to return 0, got %lu\n",
ret);
1647 ok(
ptr ==
NULL,
"Expected output pointer to be initialized to NULL, got %p\n",
ptr);
1649 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
1655 ok(
ret == 0,
"Expected FormatMessageW to return 0, got %lu\n",
ret);
1657 "Expected the output buffer to be untouched\n");
1659 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
1665 ok(
ret == 0,
"Expected FormatMessageW to return 0, got %lu\n",
ret);
1667 "Expected the output buffer to be untouched\n");
1669 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
1675 ok(
ret == 0,
"Expected FormatMessageW to return 0, got %lu\n",
ret);
1677 "Expected the output buffer to be untouched\n");
1679 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
1689 ok(
ret == 4,
"Expected FormatMessageW to return 4, got %lu\n",
ret);
1691 "Expected the output buffer to be untouched\n");
1696 ok(
ret == 4,
"Expected FormatMessageW to return 4, got %lu\n",
ret);
1698 "Expected the output buffer to be untouched\n");
1703 ok(
ret == 4,
"Expected FormatMessageW to return 4, got %lu\n",
ret);
1705 "Expected the output buffer to be untouched\n");
1718 } unsigned_tests[] =
1721 { 1234567890,
"1234567890", 10},
1722 {
ULL(0xFFFFFFFF,0xFFFFFFFF),
"18446744073709551615", 20 },
1723 {
ULL(0x7FFFFFFF,0xFFFFFFFF),
"9223372036854775807", 19 },
1733 { 1234567890,
"1234567890", 10 },
1735 {
ULL(0xFFFFFFFF,0xFFFFFFFF),
"-1", 2},
1736 {
ULL(0x7FFFFFFF,0xFFFFFFFF),
"9223372036854775807", 19 },
1737 { -
ULL(0x7FFFFFFF,0xFFFFFFFF),
"-9223372036854775807", 20},
1748 ok(
r == unsigned_tests[
i].
len,
"[%d] failed: r=%ld\n",
i,
r);
1750 0, 0, outA,
sizeof(outA), unsigned_tests[
i].
number);
1751 ok(!
strcmp(outA, unsigned_tests[
i].
expected),
"[%d] failed, expected %s, got %s\n",
i,
1753 ok(
r == unsigned_tests[
i].
len,
"[%d] failed: r=%ld\n",
i,
r);
1763 ok(
r == signed_tests[
i].
len,
"[%d] failed: r=%ld\n",
i,
r);
1765 0, 0, outA,
sizeof(outA), signed_tests[
i].
number);
1768 ok(
r == signed_tests[
i].
len,
"[%d] failed: r=%ld\n",
i,
r);
1816 win_skip(
"FormatMessageW is not implemented\n");
unsigned long long UINT64
#define ERROR_NOT_ENOUGH_MEMORY
#define ERROR_INSUFFICIENT_BUFFER
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define HeapFree(x, y, z)
#define MultiByteToWideChar
static const WCHAR expW[]
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
int WINAPI lstrcmpW(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 *)
GLdouble GLdouble GLdouble r
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLenum GLenum GLenum GLenum outW
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
HLOCAL NTAPI LocalFree(HLOCAL hMem)
unsigned char size_t * outsize
#define memcpy(s1, s2, n)
static struct test_info tests[]
static unsigned int number
#define SUBLANG_ENGLISH_UK
#define SUBLANG_SYS_DEFAULT
#define SUBLANG_ENGLISH_US
#define LANG_USER_DEFAULT
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
DWORD WINAPI GetLastError(void)
#define FORMAT_MESSAGE_FROM_STRING
#define FORMAT_MESSAGE_MAX_WIDTH_MASK
#define FORMAT_MESSAGE_IGNORE_INSERTS
#define FORMAT_MESSAGE_FROM_SYSTEM
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
#define FORMAT_MESSAGE_ARGUMENT_ARRAY
#define FORMAT_MESSAGE_FROM_HMODULE
#define ERROR_MUI_FILE_NOT_FOUND
#define ERROR_NO_WORK_DONE
#define TRUST_E_NOSIGNATURE
#define ERROR_MUI_FILE_NOT_LOADED
#define DXGI_ERROR_INVALID_CALL
#define ERROR_RESOURCE_TYPE_NOT_FOUND
#define ERROR_RESOURCE_LANG_NOT_FOUND
#define ERROR_MR_MID_NOT_FOUND
#define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE