32#include <httprequest.h>
38DEFINE_GUID(
GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
41 {
'W',
'i',
'n',
'e',
' ',
'R',
'e',
'g',
'r',
'e',
's',
's',
'i',
'o',
'n',
' ',
'T',
'e',
's',
't',0};
42static const WCHAR test_winehq[] = {
't',
'e',
's',
't',
'.',
'w',
'i',
'n',
'e',
'h',
'q',
'.',
'o',
'r',
'g',0};
43static const WCHAR test_winehq_https[] = {
'h',
't',
't',
'p',
's',
':',
'/',
'/',
't',
'e',
's',
't',
'.',
'w',
'i',
'n',
'e',
'h',
'q',
'.',
'o',
'r',
'g',
':',
'4',
'4',
'3',0};
98 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
103 ok(!
ret,
"should fail to query option\n");
105 "expected ERROR_INSUFFICIENT_BUFFER, got %u\n",
GetLastError());
112 ok(!
ret,
"should fail to query option\n");
114 "expected ERROR_INSUFFICIENT_BUFFER, got %u\n",
GetLastError());
124 ok(
size ==
sizeof(
feature),
"WinHttpQueryOption should set the size: %u\n",
size);
126 "expected WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP, got %#x\n",
feature);
132 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
139 "expected ERROR_INSUFFICIENT_BUFFER, got %u\n",
GetLastError());
146 "expected ERROR_INSUFFICIENT_BUFFER, got %u\n",
GetLastError());
159 "expected WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS, got %#x\n",
feature);
164 ok(!
ret,
"should fail to set disable feature for a session\n");
166 "expected ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, got %u\n",
GetLastError());
170 ok(connection !=
NULL,
"WinHttpConnect failed to open a connection, error: %u\n",
GetLastError());
175 ok(!
ret,
"should fail to set disable feature for a connection\n");
177 "expected ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, got %u\n",
GetLastError());
184 skip(
"Network unreachable, skipping the test\n");
192 ok(!
ret,
"should fail to query disable feature for a request\n");
194 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
217 ok(!
ret,
"should fail to query disable feature for a request\n");
219 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
225 ok(!
ret,
"should fail to query enabled features for a request\n");
232 ok(!
ret,
"should fail to enable WINHTTP_ENABLE_SSL_REVOCATION with invalid parameters\n");
237 ok(!
ret,
"should fail to enable WINHTTP_ENABLE_SSL_REVOCATION with invalid parameters\n");
242 ok(
ret,
"failed to set feature\n");
249 ok(!
ret,
"should fail to enable WINHTTP_ENABLE_SSL_REVOCATION with invalid parameters\n");
264 ok(
ret,
"WinHttpCloseHandle failed on closing connection: %u\n",
GetLastError());
280 ok(
session !=
NULL,
"WinHttpOpen failed to open session.\n");
287 ok (connection ==
NULL,
"WinHttpConnect succeeded in opening connection to NULL server argument.\n");
294 ok(connection !=
NULL,
"WinHttpConnect failed to open a connection, error: %u.\n",
err);
303 skip(
"Network unreachable, skipping.\n");
306 ok(
request !=
NULL,
"WinHttpOpenrequest failed to open a request, error: %u.\n",
err);
314 skip(
"Connection failed, skipping.\n");
317 ok(
ret,
"WinHttpSendRequest failed: %u\n",
err);
323 ok(
ret,
"WinHttpCloseHandle failed on closing request, got %u.\n",
err);
328 ok(
ret ==
TRUE,
"WinHttpCloseHandle failed on closing connection, got %d.\n",
ret);
330 ok(
ret ==
TRUE,
"WinHttpCloseHandle failed on closing session, got %d.\n",
ret);
354 skip(
"connection failed, skipping\n");
368 {
'C',
'o',
'n',
't',
'e',
'n',
't',
'-',
'T',
'y',
'p',
'e',
':',
' ',
'a',
'p',
'p',
'l',
'i',
'c',
'a',
't',
'i',
'o',
'n',
369 '/',
'x',
'-',
'w',
'w',
'w',
'-',
'f',
'o',
'r',
'm',
'-',
'u',
'r',
'l',
'e',
'n',
'c',
'o',
'd',
'e',
'd',0};
370 static const WCHAR test_file[] = {
't',
'e',
's',
't',
's',
'/',
'p',
'o',
's',
't',
'.',
'p',
'h',
'p',0};
371 static const WCHAR postW[] = {
'P',
'O',
'S',
'T',0};
373 static const char test_post[] =
"mode => Test\0\n";
383 total_len = optional_len =
sizeof(
post_data);
388 ok(
session !=
NULL,
"WinHttpOpen failed to open session.\n");
391 ok(connection !=
NULL,
"WinHttpConnect failed to open a connection, error: %u.\n",
GetLastError());
397 skip(
"Network unreachable, skipping.\n");
425 skip(
"connection failed, skipping\n");
444 ok(bytes_rw == 1,
"WinHttpWriteData failed, wrote %u bytes instead of 1 byte.\n", bytes_rw);
449 ok(bytes_rw == -1,
"Expected bytes_rw to remain unchanged.\n");
471 ok(bytes_rw ==
sizeof(test_post) - 1,
"Read %u bytes\n", bytes_rw);
472 ok(!
memcmp(
buffer, test_post,
sizeof(test_post) - 1),
"Data read did not match.\n");
476 ok(
ret ==
TRUE,
"WinHttpCloseHandle failed on closing request, got %d.\n",
ret);
478 ok(
ret ==
TRUE,
"WinHttpCloseHandle failed on closing connection, got %d.\n",
ret);
480 ok(
ret ==
TRUE,
"WinHttpCloseHandle failed on closing session, got %d.\n",
ret);
487 static const WCHAR expected_string[] =
488 {
'M',
'o',
'n',
',',
' ',
'2',
'8',
' ',
'J',
'u',
'l',
' ',
'2',
'0',
'0',
'8',
' ',
489 '1',
'0',
':',
'0',
'5',
':',
'5',
'2',
' ',
'G',
'M',
'T',0};
496 ok(!
ret,
"WinHttpTimeFromSystemTime succeeded\n");
502 ok(!
ret,
"WinHttpTimeFromSystemTime succeeded\n");
508 ok(
ret,
"WinHttpTimeFromSystemTime failed: %u\n",
err);
510 ok(
memcmp(time_string, expected_string,
sizeof(expected_string)) == 0,
511 "Time string returned did not match expected time string.\n");
518 static const SYSTEMTIME expected_time = {2008, 7, 1, 28, 10, 5, 52, 0};
519 static const WCHAR time_string1[] =
520 {
'M',
'o',
'n',
',',
' ',
'2',
'8',
' ',
'J',
'u',
'l',
' ',
'2',
'0',
'0',
'8',
' ',
521 +
'1',
'0',
':',
'0',
'5',
':',
'5',
'2',
' ',
'G',
'M',
'T',
'\n',0};
522 static const WCHAR time_string2[] =
523 {
' ',
'm',
'o',
'n',
' ',
'2',
'8',
' ',
'j',
'u',
'l',
' ',
'2',
'0',
'0',
'8',
' ',
524 '1',
'0',
' ',
'0',
'5',
' ',
'5',
'2',
'\n',0};
530 ok(!
ret,
"WinHttpTimeToSystemTime succeeded\n");
536 ok(!
ret,
"WinHttpTimeToSystemTime succeeded\n");
542 ok(
ret,
"WinHttpTimeToSystemTime failed: %u\n",
err);
545 "Returned SYSTEMTIME structure did not match expected SYSTEMTIME structure.\n");
550 ok(
ret,
"WinHttpTimeToSystemTime failed: %u\n",
err);
553 "Returned SYSTEMTIME structure did not match expected SYSTEMTIME structure.\n");
564 static const WCHAR test_file[] = {
'/',
'p',
'o',
's',
't',
't',
'e',
's',
't',
'.',
'p',
'h',
'p',0};
565 static const WCHAR test_verb[] = {
'P',
'O',
'S',
'T',0};
566 static const WCHAR test_header_begin[] =
567 {
'P',
'O',
'S',
'T',
' ',
'/',
'p',
'o',
's',
't',
't',
'e',
's',
't',
'.',
'p',
'h',
'p',
' ',
'H',
'T',
'T',
'P',
'/',
'1'};
568 static const WCHAR full_path_test_header_begin[] =
569 {
'P',
'O',
'S',
'T',
' ',
'h',
't',
't',
'p',
':',
'/',
'/',
't',
'e',
's',
't',
'.',
'w',
'i',
'n',
'e',
'h',
'q',
'.',
'o',
'r',
'g',
':',
'8',
'0',
570 '/',
'p',
'o',
's',
't',
't',
'e',
's',
't',
'.',
'p',
'h',
'p',
' ',
'H',
'T',
'T',
'P',
'/',
'1'};
571 static const WCHAR test_header_end[] = {
'\r',
'\n',
'\r',
'\n',0};
572 static const WCHAR test_header_name[] = {
'W',
'a',
'r',
'n',
'i',
'n',
'g',0};
573 static const WCHAR test_header_name2[] = {
'n',
'a',
'm',
'e',0};
574 static const WCHAR test_header_name3[] = {
'a',0};
575 static const WCHAR test_header_range[] = {
'R',
'a',
'n',
'g',
'e',0};
576 static const WCHAR test_header_range_bytes[] = {
'R',
'a',
'n',
'g',
'e',
':',
' ',
'b',
'y',
't',
'e',
's',
'=',
'0',
'-',
'7',
'7',
'3',
'\r',
'\n',0};
577 static const WCHAR test_header_bytes[] = {
'b',
'y',
't',
'e',
's',
'=',
'0',
'-',
'7',
'7',
'3',0};
579 static const WCHAR test_flag_coalesce[] = {
't',
'e',
's',
't',
'2',
',',
' ',
't',
'e',
's',
't',
'4',0};
580 static const WCHAR test_flag_coalesce_reverse[] = {
't',
'e',
's',
't',
'3',
',',
' ',
't',
'e',
's',
't',
'4',0};
581 static const WCHAR test_flag_coalesce_comma[] =
582 {
't',
'e',
's',
't',
'2',
',',
' ',
't',
'e',
's',
't',
'4',
',',
' ',
't',
'e',
's',
't',
'5',0};
583 static const WCHAR test_flag_coalesce_comma_reverse[] =
584 {
't',
'e',
's',
't',
'3',
',',
' ',
't',
'e',
's',
't',
'4',
',',
' ',
't',
'e',
's',
't',
'5',0};
585 static const WCHAR test_flag_coalesce_semicolon[] =
586 {
't',
'e',
's',
't',
'2',
',',
' ',
't',
'e',
's',
't',
'4',
',',
' ',
't',
'e',
's',
't',
'5',
';',
' ',
't',
'e',
's',
't',
'6',0};
587 static const WCHAR test_flag_coalesce_semicolon_reverse[] =
588 {
't',
'e',
's',
't',
'3',
',',
' ',
't',
'e',
's',
't',
'4',
',',
' ',
't',
'e',
's',
't',
'5',
';',
' ',
't',
'e',
's',
't',
'6',0};
590 static const WCHAR field[] = {
'f',
'i',
'e',
'l',
'd',0};
591 static const WCHAR value[] = {
'v',
'a',
'l',
'u',
'e',
' ',0};
592 static const WCHAR value_nospace[] = {
'v',
'a',
'l',
'u',
'e',0};
595 static const WCHAR test_headers[][14] =
597 {
'W',
'a',
'r',
'n',
'i',
'n',
'g',
':',
't',
'e',
's',
't',
'1',0},
598 {
'W',
'a',
'r',
'n',
'i',
'n',
'g',
':',
't',
'e',
's',
't',
'2',0},
599 {
'W',
'a',
'r',
'n',
'i',
'n',
'g',
':',
't',
'e',
's',
't',
'3',0},
600 {
'W',
'a',
'r',
'n',
'i',
'n',
'g',
':',
't',
'e',
's',
't',
'4',0},
601 {
'W',
'a',
'r',
'n',
'i',
'n',
'g',
':',
't',
'e',
's',
't',
'5',0},
602 {
'W',
'a',
'r',
'n',
'i',
'n',
'g',
':',
't',
'e',
's',
't',
'6',0},
603 {
'W',
'a',
'r',
'n',
'i',
'n',
'g',
':',
't',
'e',
's',
't',
'7',0},
609 {
' ',
'e',
' ',
':',
'f',0},
610 {
'f',
'i',
'e',
'l',
'd',
':',
' ',
'v',
'a',
'l',
'u',
'e',
' ',0},
611 {
'n',
'a',
'm',
'e',
':',
' ',
'v',
'a',
'l',
'u',
'e',0},
612 {
'n',
'a',
'm',
'e',
':',0}
614 static const WCHAR test_indices[][6] =
616 {
't',
'e',
's',
't',
'1',0},
617 {
't',
'e',
's',
't',
'2',0},
618 {
't',
'e',
's',
't',
'3',0},
619 {
't',
'e',
's',
't',
'4',0}
624 ok(
session !=
NULL,
"WinHttpOpen failed to open session.\n");
627 ok(connection !=
NULL,
"WinHttpConnect failed to open a connection, error: %u.\n",
GetLastError());
633 skip(
"Network unreachable, skipping.\n");
642 ok(
ret ==
FALSE,
"WinHttpQueryHeaders unexpectedly succeeded, found 'Warning' header.\n");
646 ok(
ret,
"WinHttpAddRequestHeaders failed to add new header, got %d with error %u.\n",
ret,
err);
654 ok(
index == 1,
"WinHttpQueryHeaders failed: header index not incremented\n");
655 ok(
memcmp(
buffer, test_indices[0],
sizeof(test_indices[0])) == 0,
"WinHttpQueryHeaders failed: incorrect string returned\n");
656 ok(
len == 5*
sizeof(
WCHAR),
"WinHttpQueryHeaders failed: invalid length returned, expected 5, got %d\n",
len);
660 ok(
ret ==
FALSE,
"WinHttpQueryHeaders unexpectedly succeeded, second index should not exist.\n");
671 ok(
ret ==
FALSE,
"WinHttpQueryHeaders unexpectedly succeeded with a buffer that's too small.\n");
673 "WinHttpQueryHeaders failed, modified the buffer when it should not have.\n");
674 ok(
len == 6*
sizeof(
WCHAR),
"WinHttpQueryHeaders returned invalid length, expected 12, got %d\n",
len);
682 ok(
ret ==
FALSE,
"WinHttpQueryHeaders unexpectedly succeeded.\n");
684 ok(
len > 40,
"WinHttpQueryHeaders returned invalid length: expected greater than 40, got %d\n",
len);
685 ok(
index == 0,
"WinHttpQueryHeaders incorrectly incremented header index.\n");
693 ok(
ret ==
FALSE,
"WinHttpQueryHeaders unexpectedly succeeded.\n");
695 "WinHttpQueryHeaders set incorrect error: expected ERROR_INSUFFICENT_BUFFER, got %u\n",
GetLastError());
696 ok(
len > 40,
"WinHttpQueryHeaders returned invalid length: expected greater than 40, got %d\n",
len);
697 ok(
index == 0,
"WinHttpQueryHeaders incorrectly incremented header index.\n");
704 ok(
ret ==
FALSE,
"WinHttpQueryHeaders unexpectedly succeeded.\n");
706 "WinHttpQueryHeaders set incorrect error: expected ERROR_INSUFFICIENT_BUFFER, got %u\n",
GetLastError());
707 ok(
len > 40,
"WinHttpQueryHeaders returned invalid length: expected greater than 40, got %d\n",
len);
708 ok(
index == 0,
"WinHttpQueryHeaders failed: index was incremented.\n");
717 ok(
ret ==
TRUE,
"WinHttpQueryHeaders failed: got %d\n",
ret);
718 ok(
len +
sizeof(
WCHAR) <= oldlen,
"WinHttpQueryHeaders resulting length longer than advertized.\n");
721 ok(
memcmp(
buffer, test_header_begin,
sizeof(test_header_begin)) == 0 ||
722 memcmp(
buffer, full_path_test_header_begin,
sizeof(full_path_test_header_begin)) == 0,
723 "WinHttpQueryHeaders returned invalid beginning of header string.\n");
725 "WinHttpQueryHeaders returned invalid end of header string.\n");
726 ok(
index == 0,
"WinHttpQueryHeaders incremented header index.\n");
733 ok(
ret ==
FALSE,
"WinHttpQueryHeaders unexpectedly succeeded.\n");
735 "WinHttpQueryHeaders set incorrect error: expected ERROR_INSUFFICIENT_BUFFER, got %u\n",
GetLastError());
736 ok(
len > 40,
"WinHttpQueryHeaders returned invalid length: expected greater than 40, got %d\n",
len);
737 ok(
index == 0,
"WinHttpQueryHeaders failed: index was incremented.\n");
746 ok(
len +
sizeof(
WCHAR) <= oldlen,
"resulting length longer than advertized\n");
748 "no double NULL terminator\n");
749 ok(
memcmp(
buffer, test_header_begin,
sizeof(test_header_begin)) == 0 ||
750 memcmp(
buffer, full_path_test_header_begin,
sizeof(full_path_test_header_begin)) == 0,
751 "invalid beginning of header string.\n");
752 ok(
index == 0,
"header index was incremented\n");
756 ok(
ret ==
TRUE,
"WinHttpAddRequestHeaders failed to add duplicate header: %d\n",
ret);
763 ok(
index == 1,
"WinHttpQueryHeaders failed to increment index.\n");
764 ok(
memcmp(
buffer, test_indices[0],
sizeof(test_indices[0])) == 0,
"WinHttpQueryHeaders returned incorrect string.\n");
770 ok(
index == 2,
"WinHttpQueryHeaders failed to increment index.\n");
771 ok(
memcmp(
buffer, test_indices[1],
sizeof(test_indices[1])) == 0,
"WinHttpQueryHeaders returned incorrect string.\n");
774 ok(
ret ==
TRUE,
"WinHttpAddRequestHeaders failed to add duplicate header.\n");
781 ok(
index == 1,
"WinHttpQueryHeaders failed to increment index.\n");
783 ok(
memcmp(
buffer, test_indices[
reverse ? 2 : 1],
sizeof(test_indices[
reverse ? 2 : 1])) == 0,
"WinHttpQueryHeaders returned incorrect string.\n");
789 ok(
index == 2,
"WinHttpQueryHeaders failed to increment index.\n");
790 ok(
memcmp(
buffer, test_indices[
reverse ? 1 : 2],
sizeof(test_indices[
reverse ? 1 : 2])) == 0,
"WinHttpQueryHeaders returned incorrect string.\n");
794 ok(
ret ==
FALSE,
"WinHttpAddRequestHeaders incorrectly replaced existing header.\n");
801 ok(
index == 1,
"WinHttpQueryHeaders failed to increment index.\n");
802 ok(
memcmp(
buffer, test_indices[
reverse ? 2 : 1],
sizeof(test_indices[
reverse ? 2 : 1])) == 0,
"WinHttpQueryHeaders returned incorrect string.\n");
808 ok(
index == 2,
"WinHttpQueryHeaders failed to increment index.\n");
809 ok(
memcmp(
buffer, test_indices[
reverse ? 1 : 2],
sizeof(test_indices[
reverse ? 1 : 2])) == 0,
"WinHttpQueryHeaders returned incorrect string.\n");
814 ok(
ret ==
FALSE,
"WinHttpQueryHeaders succeeded unexpectedly, found third header.\n");
818 ok(
ret ==
TRUE,
"WinHttpAddRequestHeaders failed with flag WINHTTP_ADDREQ_FLAG_COALESCE.\n");
825 ok(
index == 1,
"WinHttpQueryHeaders failed to increment index.\n");
827 reverse ?
sizeof(test_flag_coalesce_reverse) :
sizeof(test_flag_coalesce)) == 0,
"WinHttpQueryHeaders returned incorrect string.\n");
833 ok(
index == 2,
"WinHttpQueryHeaders failed to increment index.\n");
834 ok(
memcmp(
buffer, test_indices[
reverse ? 1 : 2],
sizeof(test_indices[
reverse ? 1 : 2])) == 0,
"WinHttpQueryHeaders returned incorrect string.\n");
839 ok(
ret ==
FALSE,
"WinHttpQueryHeaders succeeded unexpectedly, found third header.\n");
843 ok(
ret ==
TRUE,
"WinHttpAddRequestHeaders failed with flag WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA.\n");
850 ok(
index == 1,
"WinHttpQueryHeaders failed to increment index.\n");
852 reverse ?
sizeof(test_flag_coalesce_comma_reverse) :
sizeof(test_flag_coalesce_comma)) == 0,
853 "WinHttpQueryHeaders returned incorrect string.\n");
859 ok(
index == 2,
"WinHttpQueryHeaders failed to increment index.\n");
860 ok(
memcmp(
buffer, test_indices[
reverse ? 1 : 2],
sizeof(test_indices[
reverse ? 1 : 2])) == 0,
"WinHttpQueryHeaders returned incorrect string.\n");
865 ok(
ret ==
FALSE,
"WinHttpQueryHeaders succeeded unexpectedly, found third header.\n");
870 ok(
ret ==
TRUE,
"WinHttpAddRequestHeaders failed with flag WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON.\n");
877 ok(
index == 1,
"WinHttpQueryHeaders failed to increment index.\n");
879 reverse ?
sizeof(test_flag_coalesce_semicolon_reverse) :
sizeof(test_flag_coalesce_semicolon)) == 0,
880 "WinHttpQueryHeaders returned incorrect string.\n");
886 ok(
index == 2,
"WinHttpQueryHeaders failed to increment index.\n");
887 ok(
memcmp(
buffer, test_indices[
reverse ? 1 : 2],
sizeof(test_indices[
reverse ? 1 : 2])) == 0,
"WinHttpQueryHeaders returned incorrect string.\n");
892 ok(
ret ==
FALSE,
"WinHttpQueryHeaders succeeded unexpectedly, found third header.\n");
896 ok(
ret ==
TRUE,
"WinHttpAddRequestHeaders failed with flag WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_REPLACE.\n");
903 ok(
index == 1,
"WinHttpQueryHeaders failed to increment index.\n");
904 ok(
memcmp(
buffer, test_indices[
reverse ? 3 : 2],
sizeof(test_indices[
reverse ? 3 : 2])) == 0,
"WinHttpQueryHeaders returned incorrect string.\n");
910 ok(
index == 2,
"WinHttpQueryHeaders failed to increment index.\n");
911 ok(
memcmp(
buffer, test_indices[
reverse ? 1 : 3],
sizeof(test_indices[
reverse ? 1 : 3])) == 0,
"WinHttpQueryHeaders returned incorrect string.\n");
916 ok(
ret ==
FALSE,
"WinHttpQueryHeaders succeeded unexpectedly, found third header.\n");
919 ok(!
ret,
"WinHttpAddRequestHeaders failed\n");
922 ok(
ret,
"WinHttpAddRequestHeaders failed\n");
933 ok(!
ret,
"WinHttpAddRequestHeaders failed\n");
936 ok(!
ret,
"WinHttpAddRequestHeaders failed\n");
939 ok(!
ret,
"WinHttpAddRequestHeaders failed\n");
942 ok(
ret,
"WinHttpAddRequestHeaders failed\n");
956 ok(!
ret,
"unexpected success\n");
968 ok(!
memcmp(
buffer, test_header_bytes,
sizeof(test_header_bytes)),
"incorrect string returned\n");
976 ok(!
ret,
"unexpected success\n");
981 ok(!
ret,
"unexpected success\n");
993 ok(!
memcmp(
buffer, value_nospace,
sizeof(value_nospace)),
"incorrect string\n");
1004 ok(!
ret,
"unexpected success\n");
1016 ok(!
memcmp(
buffer, value_nospace,
sizeof(value_nospace)),
"incorrect string\n");
1019 ok(
ret ==
TRUE,
"WinHttpCloseHandle failed on closing request, got %d.\n",
ret);
1022 ok(
ret ==
TRUE,
"WinHttpCloseHandle failed on closing connection, got %d.\n",
ret);
1024 ok(
ret ==
TRUE,
"WinHttpCloseHandle failed on closing session, got %d.\n",
ret);
1034 trace(
"WINHTTP_CALLBACK_STATUS_FLAG_SECURITY_CHANNEL_ERROR\n");
1037#define X(x) if (flags & x) trace("%s\n", #x);
1050 static const char data_start[] =
"<!DOCTYPE html PUBLIC";
1079 ok(!
ret,
"unexpected success\n");
1081 "setting client cert context returned %u\n",
err);
1087 skip(
"Connection failed, skipping.\n");
1118 ok(!
ret,
"success\n");
1122 ok(!
ret,
"success\n");
1144 skip(
"secure connection failed, skipping remaining secure tests\n");
1154 size =
sizeof(bitness);
1169 trace(
"dwKeySize %u\n",
info.dwKeySize);
1177 skip(
"connection error, skipping remaining secure tests\n");
1185 ok(available_size > 2014,
"available_size = %u\n", available_size);
1195 ok(!
ret,
"succeeded unexpectedly\n");
1206 if (read_size <= 32)
1209 ok(read_size >= available_size,
"read_size = %u, available_size = %u\n", read_size, available_size);
1243 skip(
"connection failed, skipping\n");
1266 skip(
"connection failed, skipping\n");
1278 ok(!
ret,
"succeeded unexpectedly\n");
1300 'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',
'\\',
1301 'M',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
'\\',
1302 'W',
'i',
'n',
'd',
'o',
'w',
's',
'\\',
1303 'C',
'u',
'r',
'r',
'e',
'n',
't',
'V',
'e',
'r',
's',
'i',
'o',
'n',
'\\',
1304 'I',
'n',
't',
'e',
'r',
'n',
'e',
't',
' ',
'S',
'e',
't',
't',
'i',
'n',
'g',
's',
'\\',
1305 'C',
'o',
'n',
'n',
'e',
'c',
't',
'i',
'o',
'n',
's',0 };
1307 'W',
'i',
'n',
'H',
't',
't',
'p',
'S',
'e',
't',
't',
'i',
'n',
'g',
's',0 };
1349 if (
sizeof(
void *) >
sizeof(
int) ||
wow64)
1360 static WCHAR wideString[] = { 0x226f, 0x575b, 0 };
1361 static WCHAR normalString[] = {
'f',
'o',
'o',0 };
1397 "expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
1401 info.dwAccessType = 0xdeadbeef;
1406 "expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
1414 "expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
1415 info.lpszProxyBypass = normalString;
1419 "expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
1422 info.lpszProxy = wideString;
1426 skip(
"couldn't set default proxy configuration: access denied\n");
1430 "expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
1432 info.lpszProxy = normalString;
1436 skip(
"couldn't set default proxy configuration: access denied\n");
1458 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1463 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1468 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1473 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1494 ok(
value == 0x0123,
"Expected 0x0123, got %u\n",
value);
1501 ok(
value == 0x4567,
"Expected 0x4567, got %u\n",
value);
1508 ok(
value == 0x89ab,
"Expected 0x89ab, got %u\n",
value);
1515 ok(
value == 0xcdef,
"Expected 0xcdef, got %u\n",
value);
1575 ok(
value == 0xbeefdead,
"Expected 0xbeefdead, got %u\n",
value);
1587 ok(
value == 0xbeefdead,
"Expected 0xbeefdead, got %u\n",
value);
1599 ok(
value == 0xbeefdead,
"Expected 0xbeefdead, got %u\n",
value);
1611 ok(
value == 0xbeefdead,
"Expected 0xbeefdead, got %u\n",
value);
1622 ok(
value == 0xbeefdead,
"Expected 0xbeefdead, got %u\n",
value);
1629 ok(
value == 0xbeefdead,
"Expected 0xbeefdead, got %u\n",
value);
1636 ok(
value == 0xbeefdead,
"Expected 0xbeefdead, got %u\n",
value);
1643 ok(
value == 0xbeefdead,
"Expected 0xbeefdead, got %u\n",
value);
1648 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1653 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1658 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1663 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1668 "expected ERROR_WINHTTP_INVALID_TYPE, got %u\n",
GetLastError());
1673 "expected ERROR_WINHTTP_INVALID_TYPE, got %u\n",
GetLastError());
1679 "expected ERROR_WINHTTP_INVALID_TYPE, got %u\n",
GetLastError());
1685 "expected ERROR_WINHTTP_INVALID_TYPE, got %u\n",
GetLastError());
1691 "expected ERROR_WINHTTP_INVALID_TYPE, got %u\n",
GetLastError());
1697 "expected ERROR_WINHTTP_INVALID_TYPE, got %u\n",
GetLastError());
1710 ok(
value == 0xdead,
"Expected 0xdead, got %u\n",
value);
1722 ok(
value == 0xdead,
"Expected 0xdead, got %u\n",
value);
1734 ok(
value == 0xdead,
"Expected 0xdead, got %u\n",
value);
1746 ok(
value == 0xdead,
"Expected 0xdead, got %u\n",
value);
1757 ok(
value == 0xdead,
"Expected 0xdead, got %u\n",
value);
1764 ok(
value == 0xdead,
"Expected 0xdead, got %u\n",
value);
1771 ok(
value == 0xdead,
"Expected 0xdead, got %u\n",
value);
1778 ok(
value == 0xdead,
"Expected 0xdead, got %u\n",
value);
1783 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1788 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1793 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1798 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1817 ok(
value == 0xcdef,
"Expected 0xcdef, got %u\n",
value);
1824 ok(
value == 0x89ab,
"Expected 0x89ab, got %u\n",
value);
1831 ok(
value == 0x4567,
"Expected 0x4567, got %u\n",
value);
1838 ok(
value == 0x0123,
"Expected 0x0123, got %u\n",
value);
1898 ok(
value == 0xbeefdead,
"Expected 0xbeefdead, got %u\n",
value);
1910 ok(
value == 0xbeefdead,
"Expected 0xbeefdead, got %u\n",
value);
1922 ok(
value == 0xbeefdead,
"Expected 0xbeefdead, got %u\n",
value);
1934 ok(
value == 0xbeefdead,
"Expected 0xbeefdead, got %u\n",
value);
1949 ok(
value == 0xdead,
"Expected 0xdead, got %u\n",
value);
1961 ok(
value == 0xdead,
"Expected 0xdead, got %u\n",
value);
1973 ok(
value == 0xdead,
"Expected 0xdead, got %u\n",
value);
1985 ok(
value == 0xdead,
"Expected 0xdead, got %u\n",
value);
1997 ok(
value == 0xbeefdead,
"Expected 0xbeefdead, got %u\n",
value);
2009 ok(
value == 0xbeefdead,
"Expected 0xbeefdead, got %u\n",
value);
2021 ok(
value == 0xbeefdead,
"Expected 0xbeefdead, got %u\n",
value);
2033 ok(
value == 0xbeefdead,
"Expected 0xbeefdead, got %u\n",
value);
2065 ok(!
ret,
"expected failure\n");
2106 static const WCHAR nxdomain[] =
2107 {
'n',
'x',
'd',
'o',
'm',
'a',
'i',
'n',
'.',
'w',
'i',
'n',
'e',
'h',
'q',
'.',
'o',
'r',
'g',0};
2131 skip(
"nxdomain returned success. Broken ISP redirects?\n");
2135 "expected ERROR_WINHTTP_NAME_NOT_RESOLVED got %u\n",
GetLastError());
2147 skip(
"Skipping host resolution tests, host resolution preformed by proxy\n");
2165 skip(
"connection failed, skipping\n");
2168 ok(
ret,
"failed to send request\n");
2178"<HEAD><TITLE>winhttp test page</TITLE></HEAD>\r\n"
2179"<BODY>The quick brown fox jumped over the lazy dog<P></BODY>\r\n"
2183"HTTP/1.1 200 OK\r\n"
2184"Server: winetest\r\n"
2188"HTTP/1.1 400 Bad Request\r\n"
2192"HTTP/1.1 200 OK\r\n"
2193"Set-Cookie: name = value \r\n"
2194"Set-Cookie: NAME = value \r\n"
2198"HTTP/1.1 200 OK\r\n"
2199"Set-Cookie: name2=value; Domain = localhost; Path=/cookie5;Expires=Wed, 13 Jan 2021 22:23:01 GMT; HttpOnly; \r\n"
2203"HTTP/1.1 204 No Content\r\n"
2204"Server: winetest\r\n"
2208"HTTP/1.1 304 Not Modified\r\n"
2212"HTTP/1.1 401 Unauthorized\r\n"
2213"Server: winetest\r\n"
2214"Connection: close\r\n"
2215"WWW-Authenticate: Basic realm=\"placebo\"\r\n"
2216"Content-Length: 12\r\n"
2217"Content-Type: text/plain\r\n"
2221"HTTP/1.1 200 OK\r\n"
2222"Server: winetest\r\n"
2223"Connection: close\r\n"
2224"Content-Length: 11\r\n"
2225"Content-Type: text/plain\r\n"
2229"HTTP/1.1 200 OK\r\n"
2230"Content-Length: 100\r\n"
2234"HTTP/1.1 401 Unauthorized\r\n"
2235"Server: winetest\r\n"
2236"WWW-Authenticate: Bearer\r\n"
2237"WWW-Authenticate: Basic realm=\"placebo\"\r\n"
2238"WWW-Authenticate: NTLM\r\n"
2239"Content-Length: 10\r\n"
2240"Content-Type: text/plain\r\n"
2244"HTTP/1.1 401 Unauthorized\r\n"
2245"Server: winetest\r\n"
2246"WWW-Authenticate: Basic realm=\"placebo\"\r\n"
2247"WWW-Authenticate: NTLM\r\n"
2248"Content-Length: 10240\r\n"
2249"Content-Type: text/plain\r\n"
2253"HTTP/1.1 302 Found\r\n"
2254"Content-Length: 0\r\n"
2256"WWW-Authenticate: Passport1.4\r\n"
2269#define BIG_BUFFER_LEN 0x2250
2274 int r,
c = -1,
i, on;
2279 int last_request = 0;
2311 if (
i < 4)
continue;
2324 if (
strstr(
buffer,
"Authorization: Basic dXNlcjpwd2Q="))
2332 if (
strstr(
buffer,
"Authorization: Basic dXNlcjpwd2Q="))
2386 for (
i = 0;
i < 10240;
i++)
send(
c,
"A", 1, 0);
2404 if (
strstr(
buffer,
"Cookie: name=value2; NAME=value; name=value\r\n") ||
2412 if (
strstr(
buffer,
"Cookie: NAME=value; name=value\r\n") ||
2425 static const char res[] =
"%0D%0A%1F%7F%3C%20%one?%1F%7F%20!%22%23$%&'()*+,-./:;%3C=%3E?@%5B%5C%5D"
2426 "%5E_%60%7B%7C%7D~%0D%0A ";
2427 static const char res2[] =
"%0D%0A%1F%7F%3C%20%25two?%1F%7F%20!%22%23$%25&'()*+,-./:;%3C=%3E?@%5B%5C%5D"
2428 "%5E_%60%7B%7C%7D~%0D%0A ";
2429 static const char res3[] =
"\x1f\x7f<%20%three?\x1f\x7f%20!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ";
2430 static const char res4[] =
"%0D%0A%1F%7F%3C%20%four?\x1f\x7f%20!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ";
2431 static const char res5[] =
"&text=one%C2%80%7F~";
2432 static const char res6[] =
"&text=two%C2%80\x7f~";
2433 static const char res7[] =
"&text=%E5%90%9B%E3%81%AE%E5%90%8D%E3%81%AF";
2457 }
while (!last_request);
2465 static const WCHAR test_header_end_clrf[] = {
'\r',
'\n',
'\r',
'\n',0};
2466 static const WCHAR test_header_end_raw[] = {0,0};
2469 WCHAR buffer2[0x100];
2522 ok(!
ret,
"unexpected success\n");
2524 ok(supported == 0xdeadbeef,
"got %x\n", supported);
2528 size =
sizeof(buffer2);
2529 memset(buffer2, 0,
sizeof(buffer2));
2532 ok(!
memcmp(buffer2 +
lstrlenW(buffer2) - 4, test_header_end_clrf,
sizeof(test_header_end_clrf)),
2533 "WinHttpQueryHeaders returned invalid end of header string\n");
2535 size =
sizeof(buffer2);
2536 memset(buffer2, 0,
sizeof(buffer2));
2539 ok(!
memcmp(buffer2 + (
size /
sizeof(
WCHAR)) - 1, test_header_end_raw,
sizeof(test_header_end_raw)),
2540 "WinHttpQueryHeaders returned invalid end of header string\n");
2541 ok(buffer2[(
size /
sizeof(
WCHAR)) - 2] != 0,
"returned string has too many NULL characters\n");
2557 static const WCHAR authW[] = {
'/',
'a',
'u',
't',
'h',0};
2558 static const WCHAR auth_with_credsW[] = {
'/',
'a',
'u',
't',
'h',
'_',
'w',
'i',
't',
'h',
'_',
'c',
'r',
'e',
'd',
's',0};
2559 static WCHAR userW[] = {
'u',
's',
'e',
'r',0};
2560 static WCHAR passW[] = {
'p',
'w',
'd',0};
2561 static WCHAR pass2W[] = {
'p',
'w',
'd',
'2',0};
2579 ok(!
ret,
"expected failure\n");
2585 ok(!
ret,
"expected failure\n");
2588 supported = 0xdeadbeef;
2592 ok(!
ret,
"expected failure\n");
2594 ok(supported == 0xdeadbeef,
"got %x\n", supported);
2596 supported =
first = 0xdeadbeef;
2600 ok(!
ret,
"expected failure\n");
2602 ok(supported == 0xdeadbeef,
"got %x\n", supported);
2609 ok(!
ret,
"expected failure\n");
2611 ok(supported == 0xdeadbeef,
"got %x\n", supported);
2619 ok(!
ret,
"expected failure\n");
2621 ok(supported == 0xdeadbeef,
"got %x\n", supported);
2643 ok(
size == 12,
"expected 12, got %u\n",
size);
2651 ok(
ret,
"failed to query authentication schemes %u\n",
error);
2660 ok(
ret,
"failed to set credentials %u\n",
error);
2672 ok(!
ret,
"expected failure\n");
2678 ok(!
ret,
"expected failure\n");
2684 ok(!
ret,
"expected failure\n");
2690 ok(!
ret,
"expected failure\n");
2714 ok(
size == 11,
"expected 11, got %u\n",
size);
2753 ok(
size == 11,
"expected 11, got %u\n",
size);
2834 static const WCHAR multiauthW[] = {
'/',
'm',
'u',
'l',
't',
'i',
'a',
'u',
't',
'h',0};
2835 static const WCHAR www_authenticateW[] =
2836 {
'W',
'W',
'W',
'-',
'A',
'u',
't',
'h',
'e',
'n',
't',
'i',
'c',
'a',
't',
'e',0};
2837 static const WCHAR getW[] = {
'G',
'E',
'T',0};
2854 ok(
ret,
"expected success\n");
2857 ok(
ret,
"expected success\n");
2861 ok(
ret,
"expected success\n");
2869 ok(
ret,
"expected success\n");
2889 static const WCHAR largeauthW[] = {
'/',
'l',
'a',
'r',
'g',
'e',
'a',
'u',
't',
'h',0};
2890 static const WCHAR getW[] = {
'G',
'E',
'T',0};
2891 static WCHAR userW[] = {
'u',
's',
'e',
'r',0};
2892 static WCHAR passW[] = {
'p',
'w',
'd',0};
2907 ok(
ret,
"expected success\n");
2910 ok(
ret,
"expected success\n");
2915 ok(
ret,
"expected success\n");
2919 ok(
ret,
"expected success\n");
2925 ok(
ret,
"expected success\n");
2930 ok(
ret,
"expected success\n");
2940 static const WCHAR no_headersW[] = {
'/',
'n',
'o',
'_',
'h',
'e',
'a',
'd',
'e',
'r',
's',0};
2965 ok(!
ret,
"expected failure\n");
2976 static const WCHAR no_contentW[] = {
'/',
'n',
'o',
'_',
'c',
'o',
'n',
't',
'e',
'n',
't',0};
2995 ok(!
ret,
"expected error\n");
2997 "expected ERROR_WINHTTP_INCORRECT_HANDLE_STATE, got 0x%08x\n",
GetLastError());
2999 "expected 12345, got %u\n",
size);
3003 ok(
ret,
"expected success\n");
3006 ok(
ret,
"expected success\n");
3012 ok(
ret,
"expected success\n");
3020 ok(!
ret,
"expected no content-length header\n");
3027 ok(
ret,
"expected success\n");
3034 ok(
ret,
"expected success\n");
3037 ok(!bytes_read,
"expected 0, got %u\n", bytes_read);
3041 ok(
ret,
"expected success\n");
3049 ok(!
ret,
"expected error\n");
3051 "expected ERROR_INVALID_HANDLE, got 0x%08x\n",
GetLastError());
3052 ok(
size == 12345,
"expected 12345, got %u\n",
size);
3060 static const WCHAR verbW[] = {
'H',
'E',
'A',
'D',0};
3061 static const WCHAR headW[] = {
'/',
'h',
'e',
'a',
'd',0};
3119 static const WCHAR pathW[] = {
'/',
'n',
'o',
't',
'_',
'm',
'o',
'd',
'i',
'f',
'i',
'e',
'd',0};
3120 static const WCHAR ifmodifiedW[] = {
'I',
'f',
'-',
'M',
'o',
'd',
'i',
'f',
'i',
'e',
'd',
'-',
'S',
'i',
'n',
'c',
'e',
':',
' '};
3121 static const WCHAR ifmodified2W[] = {
'I',
'f',
'-',
'M',
'o',
'd',
'i',
'f',
'i',
'e',
'd',
'-',
'S',
'i',
'n',
'c',
'e',0};
3128 memcpy(today, ifmodifiedW,
sizeof(ifmodifiedW));
3171 ok(
start <= 2000,
"Expected less than 2 seconds for the test, got %u ms\n",
start);
3176 static const WCHAR bad_headerW[] =
3177 {
'C',
'o',
'n',
't',
'e',
'n',
't',
'-',
'T',
'y',
'p',
'e',
':',
' ',
3178 't',
'e',
'x',
't',
'/',
'h',
't',
'm',
'l',
'\n',
'\r',0};
3179 static const WCHAR text_htmlW[] = {
't',
'e',
'x',
't',
'/',
'h',
't',
'm',
'l',0};
3180 static const WCHAR content_typeW[] = {
'C',
'o',
'n',
't',
'e',
'n',
't',
'-',
'T',
'y',
'p',
'e',0};
3214 static const WCHAR bigW[] = {
'b',
'i',
'g',0};
3216 DWORD total_len = 0;
3231 trace(
"waiting for response\n");
3235 trace(
"finished waiting for response\n");
3242 if (
ret)
ok(
len != 0xdeadbeef,
"WinHttpQueryDataAvailable return wrong length\n" );
3250 ok(
len == bytes_read,
"only got %u of %u available\n", bytes_read,
len );
3253 if (!bytes_read)
break;
3254 total_len += bytes_read;
3255 trace(
"read bytes %u, total_len: %u\n", bytes_read, total_len);
3268 static const WCHAR cookieW[] = {
'/',
'c',
'o',
'o',
'k',
'i',
'e',0};
3269 static const WCHAR cookie2W[] = {
'/',
'c',
'o',
'o',
'k',
'i',
'e',
'2',0};
3270 static const WCHAR cookie3W[] = {
'/',
'c',
'o',
'o',
'k',
'i',
'e',
'3',0};
3271 static const WCHAR cookie4W[] = {
'/',
'c',
'o',
'o',
'k',
'i',
'e',
'4',0};
3272 static const WCHAR cookie5W[] = {
'/',
'c',
'o',
'o',
'k',
'i',
'e',
'5',0};
3273 static const WCHAR cookieheaderW[] =
3274 {
'C',
'o',
'o',
'k',
'i',
'e',
':',
' ',
'n',
'a',
'm',
'e',
'=',
'v',
'a',
'l',
'u',
'e',
'2',
'\r',
'\n',0};
3420 "request failed unexpectedly %u\n",
status );
3453 static const WCHAR objW[] =
3454 {
'/',
'e',
's',
'c',
'a',
'p',
'e',
'\r',
'\n',0x1f,0x7f,
'<',
' ',
'%',
'o',
'n',
'e',
'?',0x1f,0x7f,
' ',
'!',
'"',
'#',
3455 '$',
'%',
'&',
'\'',
'(',
')',
'*',
'+',
',',
'-',
'.',
'/',
':',
';',
'<',
'=',
'>',
'?',
'@',
'[',
'\\',
']',
'^',
'_',
'`',
3456 '{',
'|',
'}',
'~',
'\r',
'\n',0};
3457 static const WCHAR obj2W[] =
3458 {
'/',
'e',
's',
'c',
'a',
'p',
'e',
'\r',
'\n',0x1f,0x7f,
'<',
' ',
'%',
't',
'w',
'o',
'?',0x1f,0x7f,
' ',
'!',
'"',
'#',
3459 '$',
'%',
'&',
'\'',
'(',
')',
'*',
'+',
',',
'-',
'.',
'/',
':',
';',
'<',
'=',
'>',
'?',
'@',
'[',
'\\',
']',
'^',
'_',
'`',
3460 '{',
'|',
'}',
'~',
'\r',
'\n',0};
3461 static const WCHAR obj3W[] =
3462 {
'/',
'e',
's',
'c',
'a',
'p',
'e',
'\r',
'\n',0x1f,0x7f,
'<',
' ',
'%',
't',
'h',
'r',
'e',
'e',
'?',0x1f,0x7f,
' ',
'!',
3463 '"',
'#',
'$',
'%',
'&',
'\'',
'(',
')',
'*',
'+',
',',
'-',
'.',
'/',
':',
';',
'<',
'=',
'>',
'?',
'@',
'[',
'\\',
']',
'^',
3464 '_',
'`',
'{',
'|',
'}',
'~',
'\r',
'\n',0};
3465 static const WCHAR obj4W[] =
3466 {
'/',
'e',
's',
'c',
'a',
'p',
'e',
'\r',
'\n',0x1f,0x7f,
'<',
' ',
'%',
'f',
'o',
'u',
'r',
'?',0x1f,0x7f,
' ',
'!',
'"',
3467 '#',
'$',
'%',
'&',
'\'',
'(',
')',
'*',
'+',
',',
'-',
'.',
'/',
':',
';',
'<',
'=',
'>',
'?',
'@',
'[',
'\\',
']',
'^',
'_',
3468 '`',
'{',
'|',
'}',
'~',
'\r',
'\n',0};
3469 static const WCHAR obj5W[] =
3470 {
'/',
'e',
's',
'c',
'a',
'p',
'e',
'&',
't',
'e',
'x',
't',
'=',
'o',
'n',
'e',0x80,0x7f,0x7e,0};
3471 static const WCHAR obj6W[] =
3472 {
'/',
'e',
's',
'c',
'a',
'p',
'e',
'&',
't',
'e',
'x',
't',
'=',
't',
'w',
'o',0x80,0x7f,0x7e,0};
3473 static const WCHAR obj7W[] =
3474 {
'/',
'e',
's',
'c',
'a',
'p',
'e',
'&',
't',
'e',
'x',
't',
'=',0x541b,0x306e,0x540d,0x306f,0};
3497 static const WCHAR basicW[] = {
'/',
'b',
'a',
's',
'i',
'c',0};
3499 WINHTTP_CONNECTION_INFO
info;
3518 win_skip(
"WINHTTP_OPTION_CONNECTION_INFO not supported\n" );
3521 ok( !
ret,
"unexpected success\n" );
3531 ok( !
ret,
"unexpected success\n" );
3557 {
'/',
'p',
'a',
's',
's',
'p',
'o',
'r',
't',0};
3558 static const WCHAR foundW[] =
3559 {
'F',
'o',
'u',
'n',
'd',0};
3560 static const WCHAR unauthorizedW[] =
3561 {
'U',
'n',
'a',
'u',
't',
'h',
'o',
'r',
'i',
'z',
'e',
'd',0};
3562 static const WCHAR headersW[] =
3563 {
'H',
'T',
'T',
'P',
'/',
'1',
'.',
'1',
' ',
'4',
'0',
'1',
' ',
'F',
'o',
'u',
'n',
'd',
'\r',
'\n',
3564 'C',
'o',
'n',
't',
'e',
'n',
't',
'-',
'L',
'e',
'n',
'g',
't',
'h',
':',
' ',
'0',
'\r',
'\n',
3565 'L',
'o',
'c',
'a',
't',
'i',
'o',
'n',
':',
' ',
'/',
'\r',
'\n',
3566 'W',
'W',
'W',
'-',
'A',
'u',
't',
'h',
'e',
'n',
't',
'i',
'c',
'a',
't',
'e',
':',
' ',
3567 'P',
'a',
's',
's',
'p',
'o',
'r',
't',
'1',
'.',
'4',
'\r',
'\n',
'\r',
'\n',0};
3593 win_skip(
"no support for Passport redirects\n");
3627 static WCHAR userW[] = {
'u',
's',
'e',
'r',0};
3628 static WCHAR passW[] = {
'p',
'a',
's',
's',0};
3629 static WCHAR proxy_userW[] = {
'p',
'r',
'o',
'x',
'y',
'u',
's',
'e',
'r',0};
3630 static WCHAR proxy_passW[] = {
'p',
'r',
'o',
'x',
'y',
'p',
'a',
's',
's',0};
3713 ok(!
ret,
"expected failure\n");
3719 ok(!
ret,
"expected failure\n");
3748 static const WCHAR data_start[] = {
'<',
'!',
'D',
'O',
'C',
'T',
'Y',
'P',
'E',
' ',
'h',
't',
'm',
'l',
' ',
'P',
'U',
'B',
'L',
'I',
'C'};
3749 static const WCHAR usernameW[] = {
'u',
's',
'e',
'r',
'n',
'a',
'm',
'e',0};
3750 static const WCHAR passwordW[] = {
'p',
'a',
's',
's',
'w',
'o',
'r',
'd',0};
3751 static const WCHAR url1W[] = {
'h',
't',
't',
'p',
':',
'/',
'/',
't',
'e',
's',
't',
'.',
'w',
'i',
'n',
'e',
'h',
'q',
'.',
'o',
'r',
'g',0};
3752 static const WCHAR url2W[] = {
't',
'e',
's',
't',
'.',
'w',
'i',
'n',
'e',
'h',
'q',
'.',
'o',
'r',
'g',0};
3753 static const WCHAR url3W[] = {
'h',
't',
't',
'p',
':',
'/',
'/',
't',
'e',
's',
't',
'.',
'w',
'i',
'n',
'e',
'h',
'q',
'.',
3754 'o',
'r',
'g',
'/',
't',
'e',
's',
't',
's',
'/',
'p',
'o',
's',
't',
'.',
'p',
'h',
'p',0};
3755 static const WCHAR method1W[] = {
'G',
'E',
'T',0};
3756 static const WCHAR method2W[] = {
'I',
'N',
'V',
'A',
'L',
'I',
'D',0};
3757 static const WCHAR method3W[] = {
'P',
'O',
'S',
'T',0};
3758 static const WCHAR proxy_serverW[] = {
'p',
'r',
'o',
'x',
'y',
's',
'e',
'r',
'v',
'e',
'r',0};
3759 static const WCHAR bypas_listW[] = {
'b',
'y',
'p',
'a',
's',
's',
'l',
'i',
's',
't',0};
3760 static const WCHAR connectionW[] = {
'C',
'o',
'n',
'n',
'e',
'c',
't',
'i',
'o',
'n',0};
3761 static const WCHAR dateW[] = {
'D',
'a',
't',
'e',0};
3762 static const WCHAR test_dataW[] = {
't',
'e',
's',
't',
'd',
'a',
't',
'a',128,0};
3763 static const WCHAR utf8W[] = {
'u',
't',
'f',
'-',
'8',0};
3764 static const WCHAR unauthW[] = {
'U',
'n',
'a',
'u',
't',
'h',
'o',
'r',
'i',
'z',
'e',
'd',0};
3766 IWinHttpRequest *req;
3784 hr =
CoCreateInstance( &CLSID_WinHttpRequest,
NULL, CLSCTX_INPROC_SERVER, &IID_IWinHttpRequest, (
void **)&req );
3791 V_BOOL( &async ) = VARIANT_FALSE;
3795 hr = IWinHttpRequest_Open( req,
method,
url, async );
3802 hr = IWinHttpRequest_Send( req,
data );
3805 if (
hr !=
S_OK)
goto done;
3821 hr = IWinHttpRequest_Abort( req );
3827 hr = IWinHttpRequest_Abort( req );
3830 IWinHttpRequest_Release( req );
3832 hr =
CoCreateInstance( &CLSID_WinHttpRequest,
NULL, CLSCTX_INPROC_SERVER, &IID_IWinHttpRequest, (
void **)&req );
3837 hr = IWinHttpRequest_Open( req,
method,
url, async );
3842 hr = IWinHttpRequest_Open( req,
method,
url, async );
3851 hr = IWinHttpRequest_Open( req,
method,
url, async );
3856 hr = IWinHttpRequest_get_Option( req, WinHttpRequestOption_URLCodePage, &
cp );
3863 hr = IWinHttpRequest_put_Option( req, WinHttpRequestOption_URLCodePage,
cp );
3868 hr = IWinHttpRequest_get_Option( req, WinHttpRequestOption_URLCodePage, &
cp );
3876 hr = IWinHttpRequest_put_Option( req, WinHttpRequestOption_URLCodePage,
cp );
3882 hr = IWinHttpRequest_get_Option( req, WinHttpRequestOption_URLCodePage, &
cp );
3887 hr = IWinHttpRequest_Abort( req );
3890 hr = IWinHttpRequest_Send( req,
empty );
3893 hr = IWinHttpRequest_Abort( req );
3896 IWinHttpRequest_Release( req );
3898 hr =
CoCreateInstance( &CLSID_WinHttpRequest,
NULL, CLSCTX_INPROC_SERVER, &IID_IWinHttpRequest, (
void **)&req );
3901 hr = IWinHttpRequest_get_ResponseText( req,
NULL );
3904 hr = IWinHttpRequest_get_ResponseText( req, &response );
3907 hr = IWinHttpRequest_get_Status( req,
NULL );
3910 hr = IWinHttpRequest_get_Status( req, &
status );
3913 hr = IWinHttpRequest_get_StatusText( req,
NULL );
3916 hr = IWinHttpRequest_get_StatusText( req, &status_text );
3919 hr = IWinHttpRequest_get_ResponseBody( req,
NULL );
3922 hr = IWinHttpRequest_SetTimeouts( req, 10000, 10000, 10000, 10000 );
3925 hr = IWinHttpRequest_SetCredentials( req,
NULL,
NULL, 0xdeadbeef );
3932 hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_DIRECT,
proxy_server, bypass_list );
3935 hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_PROXY,
proxy_server, bypass_list );
3938 hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_DIRECT,
proxy_server, bypass_list );
3941 hr = IWinHttpRequest_GetAllResponseHeaders( req,
NULL );
3944 hr = IWinHttpRequest_GetAllResponseHeaders( req, &
headers );
3947 hr = IWinHttpRequest_GetResponseHeader( req,
NULL,
NULL );
3951 hr = IWinHttpRequest_GetResponseHeader( req, connection,
NULL );
3954 hr = IWinHttpRequest_GetResponseHeader( req, connection, &
value );
3957 hr = IWinHttpRequest_SetRequestHeader( req,
NULL,
NULL );
3961 hr = IWinHttpRequest_SetRequestHeader( req,
date,
NULL );
3965 hr = IWinHttpRequest_SetRequestHeader( req,
date, today );
3968 hr = IWinHttpRequest_SetAutoLogonPolicy( req, 0xdeadbeef );
3971 hr = IWinHttpRequest_SetAutoLogonPolicy( req, AutoLogonPolicy_OnlyIfBypassProxy );
3978 hr = IWinHttpRequest_Open( req,
method,
url, async );
3981 hr = IWinHttpRequest_get_ResponseText( req,
NULL );
3984 hr = IWinHttpRequest_get_ResponseText( req, &response );
3987 hr = IWinHttpRequest_get_Status( req, &
status );
3990 hr = IWinHttpRequest_get_StatusText( req, &status_text );
3993 hr = IWinHttpRequest_get_ResponseBody( req,
NULL );
3996 hr = IWinHttpRequest_SetTimeouts( req, 10000, 10000, 10000, 10000 );
3999 hr = IWinHttpRequest_SetCredentials( req,
NULL,
NULL, 0xdeadbeef );
4003 hr = IWinHttpRequest_SetCredentials( req,
username,
NULL, 0xdeadbeef );
4007 hr = IWinHttpRequest_SetCredentials( req,
NULL,
password, 0xdeadbeef );
4013 hr = IWinHttpRequest_SetCredentials( req,
NULL,
password, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER );
4016 hr = IWinHttpRequest_SetCredentials( req,
username,
password, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER );
4023 hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_PROXY,
proxy_server, bypass_list );
4026 hr = IWinHttpRequest_SetProxy( req, 0xdeadbeef,
proxy_server, bypass_list );
4029 hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_DIRECT,
proxy_server, bypass_list );
4032 hr = IWinHttpRequest_GetAllResponseHeaders( req, &
headers );
4035 hr = IWinHttpRequest_GetResponseHeader( req, connection, &
value );
4038 hr = IWinHttpRequest_SetRequestHeader( req,
date, today );
4041 hr = IWinHttpRequest_SetRequestHeader( req,
date,
NULL );
4044 hr = IWinHttpRequest_SetAutoLogonPolicy( req, AutoLogonPolicy_OnlyIfBypassProxy );
4047 hr = IWinHttpRequest_Send( req,
empty );
4050 hr = IWinHttpRequest_Send( req,
empty );
4053 hr = IWinHttpRequest_get_ResponseText( req,
NULL );
4056 hr = IWinHttpRequest_get_ResponseText( req, &response );
4061 hr = IWinHttpRequest_get_Status( req,
NULL );
4065 hr = IWinHttpRequest_get_Status( req, &
status );
4069 hr = IWinHttpRequest_get_StatusText( req,
NULL );
4072 hr = IWinHttpRequest_get_StatusText( req, &status_text );
4077 hr = IWinHttpRequest_get_ResponseBody( req,
NULL );
4080 hr = IWinHttpRequest_SetCredentials( req,
username,
password, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER );
4083 hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_PROXY,
proxy_server, bypass_list );
4086 hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_DIRECT,
proxy_server, bypass_list );
4089 hr = IWinHttpRequest_GetAllResponseHeaders( req,
NULL );
4092 hr = IWinHttpRequest_GetAllResponseHeaders( req, &
headers );
4096 hr = IWinHttpRequest_GetResponseHeader( req,
NULL,
NULL );
4099 hr = IWinHttpRequest_GetResponseHeader( req, connection,
NULL );
4102 hr = IWinHttpRequest_GetResponseHeader( req, connection, &
value );
4106 hr = IWinHttpRequest_SetRequestHeader( req,
date, today );
4109 hr = IWinHttpRequest_SetAutoLogonPolicy( req, AutoLogonPolicy_OnlyIfBypassProxy );
4115 hr = IWinHttpRequest_WaitForResponse( req,
timeout, &succeeded );
4118 hr = IWinHttpRequest_get_Status( req, &
status );
4121 hr = IWinHttpRequest_get_StatusText( req, &status_text );
4125 hr = IWinHttpRequest_SetCredentials( req,
username,
password, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER );
4128 hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_PROXY,
proxy_server, bypass_list );
4131 hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_DIRECT,
proxy_server, bypass_list );
4134 hr = IWinHttpRequest_Send( req,
empty );
4137 hr = IWinHttpRequest_get_ResponseText( req,
NULL );
4140 hr = IWinHttpRequest_get_ResponseText( req, &response );
4144 hr = IWinHttpRequest_get_ResponseBody( req,
NULL );
4149 hr = IWinHttpRequest_get_ResponseBody( req, &
body );
4158 hr = IWinHttpRequest_get_ResponseStream( req, &
body );
4170 ok(
count != 0xdeadbeef,
"count not set\n" );
4171 ok(
buf[0],
"no data\n" );
4175 hr = IWinHttpRequest_get_ResponseStream( req, &body2 );
4180 hr = IUnknown_QueryInterface(
V_UNKNOWN( &body2 ), &IID_IStream, (
void **)&stream2 );
4183 IStream_Release( stream2 );
4191 hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_PROXY,
proxy_server, bypass_list );
4194 hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_DIRECT,
proxy_server, bypass_list );
4197 hr = IWinHttpRequest_GetAllResponseHeaders( req, &
headers );
4201 hr = IWinHttpRequest_GetResponseHeader( req, connection, &
value );
4205 hr = IWinHttpRequest_SetRequestHeader( req,
date, today );
4208 hr = IWinHttpRequest_SetAutoLogonPolicy( req, AutoLogonPolicy_OnlyIfBypassProxy );
4211 hr = IWinHttpRequest_Send( req,
empty );
4214 hr = IWinHttpRequest_Abort( req );
4217 hr = IWinHttpRequest_Abort( req );
4220 IWinHttpRequest_Release( req );
4230 ok(
count != 0xdeadbeef,
"count not set\n" );
4231 ok(
buf[0],
"no data\n" );
4232 IStream_Release(
stream );
4234 hr =
CoCreateInstance( &CLSID_WinHttpRequest,
NULL, CLSCTX_INPROC_SERVER, &IID_IWinHttpRequest, (
void **)&req );
4239 hr = IWinHttpRequest_Open( req,
method,
url, async );
4242 hr = IWinHttpRequest_Send( req,
empty );
4245 hr = IWinHttpRequest_WaitForResponse( req,
timeout, &succeeded );
4248 IWinHttpRequest_Release( req );
4260 hr =
CoCreateInstance( &CLSID_WinHttpRequest,
NULL, CLSCTX_INPROC_SERVER, &IID_IWinHttpRequest, (
void **)&req );
4266 V_BOOL( &async ) = VARIANT_FALSE;
4267 hr = IWinHttpRequest_Open( req,
method,
url, async );
4272 hr = IWinHttpRequest_Send( req,
empty );
4275 if (
hr !=
S_OK)
goto done;
4277 hr = IWinHttpRequest_get_ResponseText( req, &response );
4280 ok( !
memcmp(response, data_start,
sizeof(data_start)),
"got %s\n",
4287 IWinHttpRequest_Release( req );
4289 hr =
CoCreateInstance( &CLSID_WinHttpRequest,
NULL, CLSCTX_INPROC_SERVER, &IID_IWinHttpRequest, (
void **)&req );
4297 V_BOOL( &async ) = VARIANT_FALSE;
4298 hr = IWinHttpRequest_Open( req,
method,
url, async );
4303 hr = IWinHttpRequest_get_Status( req, &
status );
4308 hr = IWinHttpRequest_Send( req,
data );
4312 hr = IWinHttpRequest_get_ResponseText( req, &response );
4318 hr = IWinHttpRequest_get_Status( req, &
status );
4323 IWinHttpRequest_Release( req );
4349 static const WCHAR utf8W[] = {
'U',
'T',
'F',
'-',
'8',0};
4350 static const WCHAR regid[] = {
'W',
'i',
'n',
'H',
't',
't',
'p',
'.',
'W',
'i',
'n',
'H',
't',
't',
'p',
'R',
'e',
'q',
'u',
'e',
's',
't',
'.',
'5',
'.',
'1',0};
4351 WCHAR openW[] = {
'O',
'p',
'e',
'n',0};
4368 ok(
hr ==
S_OK,
"CLSIDFromProgID error %#x\n",
hr);
4504 V_I4(&
arg[0]) = WinHttpRequestOption_URLCodePage;
4551 V_I4(&
arg[0]) = AutoLogonPolicy_Never;
4557 IWinHttpRequest_Release(
request);
4571 ok( !
ret,
"expected failure\n" );
4578 ok( !
ret,
"expected failure\n" );
4584 ok( !
ret,
"expected failure\n" );
4625 memset( &cfg, 0,
sizeof(cfg) );
4630 ok( !
ret,
"expected failure\n" );
4636 ok(
ret,
"expected success\n" );
4650 static const WCHAR urlW[] = {
'h',
't',
't',
'p',
':',
'/',
'/',
'w',
'i',
'n',
'e',
'h',
'q',
'.',
'o',
'r',
'g',0};
4651 static const WCHAR wpadW[] = {
'h',
't',
't',
'p',
':',
'/',
'/',
'w',
'p',
'a',
'd',
'/',
'w',
'p',
'a',
'd',
'.',
'd',
'a',
't',0};
4664 ok( !
ret,
"expected failure\n" );
4673 ok( !
ret,
"expected failure\n" );
4679 ok( !
ret,
"expected failure\n" );
4685 ok( !
ret,
"expected failure\n" );
4691 ok( !
ret,
"expected failure\n" );
4700 ok( !
ret,
"expected failure\n" );
4704 options.dwAutoDetectFlags = 0;
4709 ok( !
ret,
"expected failure\n" );
4718 ok( !
ret,
"expected failure\n" );
4731 trace(
"Proxy.AccessType=%u\n",
info.dwAccessType);
4739 options.dwAutoDetectFlags = 0;
4740 options.lpszAutoConfigUrl = wpadW;
4746 trace(
"Proxy.AccessType=%u\n",
info.dwAccessType);
4757 static const WCHAR verb[] = {
'/',
't',
'e',
's',
't',
's',
'/',
'c',
'h',
'u',
'n',
'k',
'e',
'd',0};
4758 static const WCHAR chunked[] = {
'c',
'h',
'u',
'n',
'k',
'e',
'd',0};
4764 trace(
"starting chunked read test\n" );
4768 if (!ses)
goto done;
4772 if (!con)
goto done;
4776 if (!req)
goto done;
4782 skip(
"connection failed, skipping\n");
4786 if (!
ret)
goto done;
4790 if (!
ret)
goto done;
4795 ok(
ret,
"failed to get TRANSFER_ENCODING header (error %u)\n",
GetLastError() );
4806 trace(
"entering query loop\n" );
4812 if (
ret)
ok(
len != 0xdeadbeef,
"WinHttpQueryDataAvailable return wrong length\n" );
4813 trace(
"got %u available\n",
len );
4822 buf[bytes_read] = 0;
4823 trace(
"WinHttpReadData -> %d %u\n",
ret, bytes_read );
4824 ok(
len == bytes_read,
"only got %u of %u available\n", bytes_read,
len );
4825 ok(
buf[bytes_read - 1] ==
'\n',
"received partial line '%s'\n",
buf );
4828 if (!bytes_read)
break;
4842 static const WCHAR basicW[] = {
'/',
'b',
'a',
's',
'i',
'c',0};
4843 static const WCHAR quitW[] = {
'/',
'q',
'u',
'i',
't',0};
4895 skip(
"Skipping tests due to hang. See ROSTESTS-350\n");
char * strstr(char *String1, char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ULONG WSAAPI inet_addr(IN CONST CHAR FAR *cp)
static struct sockaddr_in sa
WINBASEAPI _Check_return_ _Out_ AppPolicyProcessTerminationMethod * policy
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
void dispatch(HANDLE hStopEvent)
struct protocol * protocols
#define RegCloseKey(hKey)
static const WCHAR proxy_server[]
#define ERROR_INSUFFICIENT_BUFFER
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
BOOL WINAPI CertFreeCertificateContext(PCCERT_CONTEXT pCertContext)
static const WCHAR empty[]
#define ERROR_INVALID_PARAMETER
#define GetCurrentProcess()
#define HeapFree(x, y, z)
#define ERROR_INVALID_HANDLE
#define MultiByteToWideChar
#define ERROR_ACCESS_DENIED
static const WCHAR version[]
static void cleanup(void)
static const WCHAR getW[]
static const WCHAR bigW[]
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
DWORD WINAPI GetTickCount(VOID)
VOID WINAPI GetSystemTime(OUT LPSYSTEMTIME lpSystemTime)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI DECLSPEC_HOTPATCH CLSIDFromProgID(LPCOLESTR progid, LPCLSID clsid)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
BOOL WINAPI WinHttpQueryOption(HINTERNET handle, DWORD option, LPVOID buffer, LPDWORD buflen)
BOOL WINAPI WinHttpGetDefaultProxyConfiguration(WINHTTP_PROXY_INFO *info)
HINTERNET WINAPI WinHttpOpen(LPCWSTR agent, DWORD access, LPCWSTR proxy, LPCWSTR bypass, DWORD flags)
BOOL WINAPI WinHttpGetIEProxyConfigForCurrentUser(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG *config)
HINTERNET WINAPI WinHttpConnect(HINTERNET hsession, LPCWSTR server, INTERNET_PORT port, DWORD reserved)
BOOL WINAPI WinHttpGetProxyForUrl(HINTERNET hsession, LPCWSTR url, WINHTTP_AUTOPROXY_OPTIONS *options, WINHTTP_PROXY_INFO *info)
BOOL WINAPI WinHttpTimeFromSystemTime(const SYSTEMTIME *time, LPWSTR string)
BOOL WINAPI WinHttpSetDefaultProxyConfiguration(WINHTTP_PROXY_INFO *info)
BOOL WINAPI WinHttpCloseHandle(HINTERNET handle)
BOOL WINAPI WinHttpSetTimeouts(HINTERNET handle, int resolve, int connect, int send, int receive)
HINTERNET WINAPI WinHttpOpenRequest(HINTERNET hconnect, LPCWSTR verb, LPCWSTR object, LPCWSTR version, LPCWSTR referrer, LPCWSTR *types, DWORD flags)
BOOL WINAPI WinHttpSetOption(HINTERNET handle, DWORD option, LPVOID buffer, DWORD buflen)
BOOL WINAPI WinHttpDetectAutoProxyConfigUrl(DWORD flags, LPWSTR *url)
BOOL WINAPI WinHttpTimeToSystemTime(LPCWSTR string, SYSTEMTIME *time)
WINHTTP_STATUS_CALLBACK WINAPI WinHttpSetStatusCallback(HINTERNET handle, WINHTTP_STATUS_CALLBACK callback, DWORD flags, DWORD_PTR reserved)
INT WSAAPI recv(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags)
INT WSAAPI send(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags)
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLenum const GLfloat * params
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLint GLboolean GLint GLenum access
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
static const WCHAR optionW[]
static const WCHAR headW[]
#define DISPID_HTTPREQUEST_SETAUTOLOGONPOLICY
#define DISPID_HTTPREQUEST_OPEN
#define DISPID_HTTPREQUEST_OPTION
static const WCHAR emptyW[]
#define memcpy(s1, s2, n)
#define sprintf(buf, format,...)
static const WCHAR url1W[]
static const WCHAR verbW[]
static IBackgroundCopyFile * test_file
static VARIANTARG static DISPID
INTERNETFEATURELIST feature
static const CHAR post_data[]
static const WCHAR text_htmlW[]
static const WCHAR utf8W[]
BSTR WINAPI SysAllocString(LPCOLESTR str)
UINT WINAPI SysStringLen(BSTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
#define DISPATCH_PROPERTYPUT
#define DISPATCH_PROPERTYGET
static BOOL check_buffer(parse_buffer *buf, ULONG size)
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
#define IsEqualIID(riid1, riid2)
BOOL WINAPI WinHttpWriteData(HINTERNET hrequest, LPCVOID buffer, DWORD to_write, LPDWORD written)
BOOL WINAPI WinHttpQueryHeaders(HINTERNET hrequest, DWORD level, LPCWSTR name, LPVOID buffer, LPDWORD buflen, LPDWORD index)
BOOL WINAPI WinHttpAddRequestHeaders(HINTERNET hrequest, LPCWSTR headers, DWORD len, DWORD flags)
BOOL WINAPI WinHttpReadData(HINTERNET hrequest, LPVOID buffer, DWORD to_read, LPDWORD read)
BOOL WINAPI WinHttpQueryDataAvailable(HINTERNET hrequest, LPDWORD available)
BOOL WINAPI WinHttpSendRequest(HINTERNET hrequest, LPCWSTR headers, DWORD headers_len, LPVOID optional, DWORD optional_len, DWORD total_len, DWORD_PTR context)
BOOL WINAPI WinHttpSetCredentials(HINTERNET hrequest, DWORD target, DWORD scheme, LPCWSTR username, LPCWSTR password, LPVOID params)
BOOL WINAPI WinHttpReceiveResponse(HINTERNET hrequest, LPVOID reserved)
BOOL WINAPI WinHttpQueryAuthSchemes(HINTERNET hrequest, LPDWORD supported, LPDWORD first, LPDWORD target)
static const WCHAR passportW[]
static const WCHAR basicW[]
static __inline const char * wine_dbgstr_guid(const GUID *id)
static int winetest_strcmpW(const WCHAR *str1, const WCHAR *str2)
static const void * body(MD5_CTX *ctx, const void *data, unsigned long size)
vector< Header * > headers
INT WSAAPI setsockopt(IN SOCKET s, IN INT level, IN INT optname, IN CONST CHAR FAR *optval, IN INT optlen)
INT WSAAPI listen(IN SOCKET s, IN INT backlog)
INT WSAAPI shutdown(IN SOCKET s, IN INT how)
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
SOCKET WSAAPI accept(IN SOCKET s, OUT LPSOCKADDR addr, OUT INT FAR *addrlen)
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
static void reverse(int *pidx, int cch)
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
void WINAPI VariantInit(VARIANTARG *pVarg)
DWORD WINAPI GetLastError(void)
#define DISP_E_PARAMNOTFOUND
#define ERROR_INVALID_OPERATION
#define DISP_E_UNKNOWNINTERFACE
#define DISP_E_MEMBERNOTFOUND
#define SEC_E_ILLEGAL_MESSAGE
#define HRESULT_FROM_WIN32(x)
#define DISP_E_TYPEMISMATCH
static void test_WinHttpSendRequest(void)
static const WCHAR WinHttpSettings[]
static const char auth_unseen[]
static void test_WinHttpDetectAutoProxyConfigUrl(void)
static void test_bad_header(int port)
static void test_IWinHttpRequest(int port)
static DWORD CALLBACK server_thread(LPVOID param)
static const char okmsg[]
static void test_multiple_reads(int port)
static const WCHAR test_winehq[]
static void test_no_content(int port)
static void test_no_headers(int port)
static void set_proxy(REGSAM access, BYTE *buf, DWORD len, DWORD type)
static void test_credentials(void)
static void test_cookies(int port)
static void CALLBACK cert_error(HINTERNET handle, DWORD_PTR ctx, DWORD status, LPVOID buf, DWORD len)
static void do_request(HINTERNET con, const WCHAR *obj, DWORD flags)
static void test_set_default_proxy_config(void)
static void test_WinHttpOpenRequest(void)
static const WCHAR test_winehq_https[]
static const char noauthmsg[]
static void test_resolve_timeout(void)
static const char hello_world[]
static void test_secure_connection(void)
static const char notokmsg[]
static const char page1[]
static void test_WinHttpGetIEProxyConfigForCurrentUser(void)
static void test_WinHttpAddHeaders(void)
static void test_basic_authentication(int port)
static void test_basic_request(int port, const WCHAR *verb, const WCHAR *path)
static void test_request_parameter_defaults(void)
static const char cookiemsg2[]
static const char headmsg[]
static void test_multi_authentication(int port)
static void test_IWinHttpRequest_Invoke(void)
static void test_empty_headers_param(void)
static const char unauthorized[]
static const char nocontentmsg[]
static void test_WinHttpTimeToSystemTime(void)
static void test_head_request(int port)
static const char passportauth[]
static WCHAR * a2w(const char *str)
static void test_not_modified(int port)
static const char largeauth[]
static const WCHAR Connections[]
static DWORD get_default_proxy_reg_value(BYTE *buf, DWORD len, DWORD *type)
static const char cookiemsg[]
static const WCHAR test_useragent[]
static void test_WinHttpQueryOption(void)
static const WCHAR localhostW[]
static void test_connection_info(int port)
static void test_request_path_escapes(int port)
static void test_WinHttpGetProxyForUrl(void)
static void test_passport_auth(int port)
static void test_chunked_read(void)
static void set_default_proxy_reg_value(BYTE *buf, DWORD len, DWORD type)
static void test_WinHttpTimeFromSystemTime(void)
static void test_large_data_authentication(int port)
static const char okauthmsg[]
static int strcmp_wa(const WCHAR *str1, const char *stra)
static BOOL proxy_active(void)
static const char notmodified[]
static void request_get_property(IWinHttpRequest *request, int property, VARIANT *ret)
static const char multiauth[]
static void test_timeouts(void)
#define WINHTTP_OPTION_PROXY_PASSWORD
#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_REV_FAILED
#define WINHTTP_OPTION_USERNAME
#define WINHTTP_QUERY_CONTENT_LENGTH
#define WINHTTP_AUTO_DETECT_TYPE_DHCP
#define WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH
#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_WRONG_USAGE
#define ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN
#define WINHTTP_OPTION_CONTEXT_VALUE
#define WINHTTP_FLAG_ESCAPE_DISABLE_QUERY
#define ERROR_WINHTTP_NAME_NOT_RESOLVED
#define SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE
#define WINHTTP_OPTION_SEND_TIMEOUT
#define WINHTTP_QUERY_VERSION
#define WINHTTP_OPTION_CONNECTION_INFO
#define HTTP_STATUS_NO_CONTENT
#define ERROR_WINHTTP_OPERATION_CANCELLED
#define WINHTTP_OPTION_SERVER_CERT_CONTEXT
#define HTTP_STATUS_BAD_REQUEST
#define WINHTTP_OPTION_SECURITY_FLAGS
#define WINHTTP_DEFAULT_ACCEPT_TYPES
#define ERROR_WINHTTP_CANNOT_CONNECT
#define WINHTTP_FLAG_BYPASS_PROXY_CACHE
#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_CN_INVALID
#define WINHTTP_AUTH_SCHEME_BASIC
#define ERROR_WINHTTP_INVALID_SERVER_RESPONSE
#define WINHTTP_AUTH_SCHEME_PASSPORT
#define WINHTTP_OPTION_PROXY_USERNAME
#define WINHTTP_OPTION_ENABLE_FEATURE
#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_REVOKED
#define WINHTTP_OPTION_PASSWORD
#define WINHTTP_NO_REQUEST_DATA
#define WINHTTP_NO_ADDITIONAL_HEADERS
#define WINHTTP_OPTION_RESOLVE_TIMEOUT
#define WINHTTP_OPTION_DISABLE_FEATURE
#define WINHTTP_OPTION_CLIENT_CERT_CONTEXT
#define WINHTTP_ADDREQ_FLAG_ADD_IF_NEW
#define WINHTTP_ENABLE_SSL_REVOCATION
#define WINHTTP_DISABLE_KEEP_ALIVE
#define WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CA
#define WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON
#define WINHTTP_AUTOPROXY_AUTO_DETECT
#define WINHTTP_QUERY_STATUS_CODE
#define WINHTTP_QUERY_FLAG_REQUEST_HEADERS
#define WINHTTP_ACCESS_TYPE_DEFAULT_PROXY
#define WINHTTP_ENABLE_PASSPORT_AUTH
#define WINHTTP_ACCESS_TYPE_NAMED_PROXY
#define ERROR_WINHTTP_SECURE_FAILURE
#define WINHTTP_NO_PROXY_NAME
#define WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP
#define WINHTTP_AUTH_SCHEME_NEGOTIATE
#define WINHTTP_AUTH_TARGET_SERVER
#define WINHTTP_QUERY_ORIG_URI
#define ERROR_WINHTTP_INCORRECT_HANDLE_STATE
#define ERROR_WINHTTP_INVALID_OPTION
#define WINHTTP_ADDREQ_FLAG_ADD
#define WINHTTP_OPTION_CONNECT_RETRIES
#define WINHTTP_AUTH_SCHEME_DIGEST
#define WINHTTP_QUERY_FLAG_NUMBER
#define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID
#define ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND
#define WINHTTP_AUTO_DETECT_TYPE_DNS_A
#define WINHTTP_OPTION_CONNECT_TIMEOUT
#define WINHTTP_QUERY_MAX
#define WINHTTP_OPTION_RECEIVE_TIMEOUT
#define WINHTTP_QUERY_CUSTOM
#define ERROR_WINHTTP_AUTODETECTION_FAILED
#define ERROR_WINHTTP_INCORRECT_HANDLE_TYPE
#define SECURITY_FLAG_SECURE
#define ERROR_WINHTTP_UNRECOGNIZED_SCHEME
#define WINHTTP_ACCESS_TYPE_NO_PROXY
#define WINHTTP_QUERY_STATUS_TEXT
#define ERROR_WINHTTP_CONNECTION_ERROR
#define WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CERT
#define WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT
#define WINHTTP_FLAG_ESCAPE_PERCENT
#define WINHTTP_NO_CLIENT_CERT_CONTEXT
#define WINHTTP_FLAG_ESCAPE_DISABLE
#define HTTP_STATUS_DENIED
#define HTTP_STATUS_CONTINUE
#define ERROR_WINHTTP_LOGIN_FAILURE
#define WINHTTP_ADDREQ_FLAG_REPLACE
#define ERROR_WINHTTP_HEADER_NOT_FOUND
#define ERROR_WINHTTP_TIMEOUT
#define WINHTTP_QUERY_TRANSFER_ENCODING
#define HTTP_STATUS_NOT_MODIFIED
#define WINHTTP_QUERY_RAW_HEADERS_CRLF
#define WINHTTP_FLAG_SECURE
#define WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT
#define WINHTTP_ADDREQ_FLAG_COALESCE
#define ERROR_WINHTTP_SHUTDOWN
#define INTERNET_DEFAULT_HTTP_PORT
#define WINHTTP_QUERY_REQUEST_METHOD
#define ERROR_WINHTTP_CANNOT_CALL_AFTER_SEND
#define WINHTTP_OPTION_REDIRECT_POLICY
#define WINHTTP_OPTION_SECURITY_KEY_BITNESS
#define WINHTTP_OPTION_SECURE_PROTOCOLS
#define WINHTTP_NO_REFERER
#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_DATE_INVALID
#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2
#define SECURITY_FLAG_STRENGTH_STRONG
#define WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS
#define WINHTTP_NO_PROXY_BYPASS
#define WINHTTP_AUTH_SCHEME_NTLM
#define SECURITY_FLAG_IGNORE_UNKNOWN_CA
#define WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA
#define WINHTTP_DISABLE_COOKIES
#define WINHTTP_CALLBACK_STATUS_SECURE_FAILURE
#define WINHTTP_AUTOPROXY_CONFIG_URL
#define WINHTTP_QUERY_RAW_HEADERS
#define SECURITY_FLAG_IGNORE_CERT_CN_INVALID
#define WINHTTP_TIME_FORMAT_BUFSIZE
static const WCHAR postW[]
#define HKEY_LOCAL_MACHINE