37#define _SECURITY_FLAG_CERT_REV_FAILED 0x00800000
38#define _SECURITY_FLAG_CERT_INVALID_CA 0x01000000
39#define _SECURITY_FLAG_CERT_INVALID_CN 0x02000000
40#define _SECURITY_FLAG_CERT_INVALID_DATE 0x04000000
42#define TEST_URL "http://test.winehq.org/tests/hello.html"
49#define SET_EXPECT2(status, num) \
52#define SET_EXPECT(status) \
53 SET_EXPECT2(status, 1)
55#define SET_OPTIONAL2(status, num) \
56 optional[status] = num
58#define SET_OPTIONAL(status) \
59 SET_OPTIONAL2(status, 1)
63#define SET_WINE_ALLOW2(status, num) \
64 wine_allow[status] = num
66#define SET_WINE_ALLOW(status) \
67 SET_WINE_ALLOW2(status, 1)
69#define CHECK_EXPECT(status) \
71 if (!expect[status] && !optional[status] && wine_allow[status]) \
73 todo_wine ok(expect[status], "unexpected status %d (%s)\n", status, \
74 status < MAX_INTERNET_STATUS && status_string[status] ? \
75 status_string[status] : "unknown"); \
76 wine_allow[status]--; \
80 ok(expect[status] || optional[status], "unexpected status %d (%s)\n", status, \
81 status < MAX_INTERNET_STATUS && status_string[status] ? \
82 status_string[status] : "unknown"); \
83 if (expect[status]) expect[status]--; \
84 else if(optional[status]) optional[status]--; \
91#define CLEAR_NOTIFIED(status) \
92 expect[status] = optional[status] = wine_allow[status] = notified[status] = 0;
94#define CHECK_NOTIFIED2(status, num) \
96 ok(notified[status] + optional[status] == (num), \
97 "expected status %d (%s) %d times, received %d times\n", \
98 status, status < MAX_INTERNET_STATUS && status_string[status] ? \
99 status_string[status] : "unknown", (num), notified[status]); \
100 CLEAR_NOTIFIED(status); \
103#define CHECK_NOTIFIED(status) \
104 CHECK_NOTIFIED2(status, 1)
106#define CHECK_NOT_NOTIFIED(status) \
107 CHECK_NOTIFIED2(status, 0)
109#define MAX_INTERNET_STATUS (INTERNET_STATUS_COOKIE_HISTORY+1)
118#define TESTF_REDIRECT 0x01
119#define TESTF_COMPRESSED 0x02
120#define TESTF_CHUNKED 0x04
135 "http://test.winehq.org/tests/data.php",
136 "http://test.winehq.org/tests/data.php",
143 "http://test.winehq.org/tests/redirect",
144 "http://test.winehq.org/tests/hello.html",
151 "http://test.winehq.org/tests/gzip.php",
152 "http://test.winehq.org/tests/gzip.php",
155 "Accept-Encoding: gzip, deflate",
159 "http://test.winehq.org/tests/post.php",
160 "http://test.winehq.org/tests/post.php",
163 "Content-Type: application/x-www-form-urlencoded",
186 if (pGetThreadUILanguage)
188 if (pGetUserDefaultUILanguage)
247#define test_status_code(a,b) _test_status_code(__LINE__,a,b, FALSE)
248#define test_status_code_todo(a,b) _test_status_code(__LINE__,a,b, TRUE)
252 char exbuf[12], bufa[10];
259 ok_(__FILE__,
line)(
res,
"[1] HttpQueryInfoA(HTTP_QUERY_STATUS_CODE|number) failed: %u\n",
GetLastError());
261 ok_(__FILE__,
line)(
code == excode,
"code = %d, expected %d\n",
code, excode);
268 ok_(__FILE__,
line)(
res,
"[2] HttpQueryInfoA(HTTP_QUERY_STATUS_CODE|number index) failed: %u\n",
GetLastError());
278 ok_(__FILE__,
line)(!
strcmp(bufa, exbuf),
"unexpected status code %s, expected %s\n", bufa, exbuf);
284 "[4] HttpQueryInfoA(HTTP_QUERY_STATUS_CODE) failed: %u\n",
GetLastError());
291 ok_(__FILE__,
line)(!
strcmp_wa(bufw, exbuf),
"unexpected status code %s, expected %s\n", bufa, exbuf);
297 "[6] HttpQueryInfoW(HTTP_QUERY_STATUS_CODE) failed: %u\n",
GetLastError());
304 ok(
size ==
sizeof(bufw),
"unexpected size %d\n",
size);
321#define test_request_flags(a,b) _test_request_flags(__LINE__,a,b,FALSE)
322#define test_request_flags_todo(a,b) _test_request_flags(__LINE__,a,b,TRUE)
331 ok_(__FILE__,
line)(
res,
"InternetQueryOptionW(INTERNET_OPTION_REQUEST_FLAGS) failed: %u\n",
GetLastError());
334 flags &= ~INTERNET_REQFLAG_CACHE_WRITE_DISABLED;
336 ok_(__FILE__,
line)(
flags == exflags,
"flags = %x, expected %x\n",
flags, exflags);
339#define test_request_url(a,b) _test_request_url(__LINE__,a,b)
349 ok_(__FILE__,
line)(!
strcmp(
buf, expected_url),
"unexpected URL %s, expected %s\n",
buf, expected_url);
352#define test_http_version(a) _test_http_version(__LINE__,a)
361 ok_(__FILE__,
line)(
res,
"InternetQueryOptionW(INTERNET_OPTION_HTTP_VERSION) failed: %u\n",
GetLastError());
362 ok_(__FILE__,
line)(
v.dwMajorVersion == 1,
"dwMajorVersion = %d\n",
v.dwMajorVersion);
363 ok_(__FILE__,
line)(
v.dwMinorVersion == 1,
"dwMinorVersion = %d\n",
v.dwMinorVersion);
371 DWORD dwInternetStatus,
372 LPVOID lpvStatusInformation,
373 DWORD dwStatusInformationLength
378 switch (dwInternetStatus)
382 trace(
"%04x:Callback %p 0x%lx INTERNET_STATUS_RESOLVING_NAME \"%s\" %d\n",
384 (
LPCSTR)lpvStatusInformation,dwStatusInformationLength);
385 *(
LPSTR)lpvStatusInformation =
'\0';
389 trace(
"%04x:Callback %p 0x%lx INTERNET_STATUS_NAME_RESOLVED \"%s\" %d\n",
391 (
LPCSTR)lpvStatusInformation,dwStatusInformationLength);
392 *(
LPSTR)lpvStatusInformation =
'\0';
396 trace(
"%04x:Callback %p 0x%lx INTERNET_STATUS_CONNECTING_TO_SERVER \"%s\" %d\n",
398 (
LPCSTR)lpvStatusInformation,dwStatusInformationLength);
399 ok(dwStatusInformationLength ==
strlen(lpvStatusInformation)+1,
"unexpected size %u\n",
400 dwStatusInformationLength);
401 *(
LPSTR)lpvStatusInformation =
'\0';
405 trace(
"%04x:Callback %p 0x%lx INTERNET_STATUS_CONNECTED_TO_SERVER \"%s\" %d\n",
407 (
LPCSTR)lpvStatusInformation,dwStatusInformationLength);
408 ok(dwStatusInformationLength ==
strlen(lpvStatusInformation)+1,
"unexpected size %u\n",
409 dwStatusInformationLength);
410 *(
LPSTR)lpvStatusInformation =
'\0';
414 trace(
"%04x:Callback %p 0x%lx INTERNET_STATUS_SENDING_REQUEST %p %d\n",
416 lpvStatusInformation,dwStatusInformationLength);
419 ok(dwStatusInformationLength ==
sizeof(
DWORD),
420 "info length should be sizeof(DWORD) instead of %d\n",
421 dwStatusInformationLength);
423 trace(
"%04x:Callback %p 0x%lx INTERNET_STATUS_REQUEST_SENT 0x%x %d\n",
425 *(
DWORD *)lpvStatusInformation,dwStatusInformationLength);
429 trace(
"%04x:Callback %p 0x%lx INTERNET_STATUS_RECEIVING_RESPONSE %p %d\n",
431 lpvStatusInformation,dwStatusInformationLength);
434 ok(dwStatusInformationLength ==
sizeof(
DWORD),
435 "info length should be sizeof(DWORD) instead of %d\n",
436 dwStatusInformationLength);
438 trace(
"%04x:Callback %p 0x%lx INTERNET_STATUS_RESPONSE_RECEIVED 0x%x %d\n",
440 *(
DWORD *)lpvStatusInformation,dwStatusInformationLength);
444 trace(
"%04x:Callback %p 0x%lx INTERNET_STATUS_CTL_RESPONSE_RECEIVED %p %d\n",
446 lpvStatusInformation,dwStatusInformationLength);
450 trace(
"%04x:Callback %p 0x%lx INTERNET_STATUS_PREFETCH %p %d\n",
452 lpvStatusInformation,dwStatusInformationLength);
456 trace(
"%04x:Callback %p 0x%lx INTERNET_STATUS_CLOSING_CONNECTION %p %d\n",
458 lpvStatusInformation,dwStatusInformationLength);
462 trace(
"%04x:Callback %p 0x%lx INTERNET_STATUS_CONNECTION_CLOSED %p %d\n",
464 lpvStatusInformation,dwStatusInformationLength);
468 "info length should be sizeof(HINTERNET) instead of %d\n",
469 dwStatusInformationLength);
471 trace(
"%04x:Callback %p 0x%lx INTERNET_STATUS_HANDLE_CREATED %p %d\n",
473 *(
HINTERNET *)lpvStatusInformation,dwStatusInformationLength);
479 "info length should be sizeof(HINTERNET) instead of %d\n",
480 dwStatusInformationLength);
482 trace(
"%04x:Callback %p 0x%lx INTERNET_STATUS_HANDLE_CLOSING %p %d\n",
484 *(
HINTERNET *)lpvStatusInformation, dwStatusInformationLength);
492 "info length should be sizeof(INTERNET_ASYNC_RESULT) instead of %d\n",
493 dwStatusInformationLength);
496 trace(
"%04x:Callback %p 0x%lx INTERNET_STATUS_REQUEST_COMPLETE {%ld,%d} %d\n",
506 trace(
"%04x:Callback %p 0x%lx INTERNET_STATUS_REDIRECT \"%s\" %d\n",
508 (
LPCSTR)lpvStatusInformation, dwStatusInformationLength);
509 *(
LPSTR)lpvStatusInformation =
'\0';
515 trace(
"%04x:Callback %p 0x%lx INTERNET_STATUS_INTERMEDIATE_RESPONSE %p %d\n",
517 lpvStatusInformation, dwStatusInformationLength);
521 trace(
"%04x:Callback %p 0x%lx %d %p %d\n",
523 lpvStatusInformation, dwStatusInformationLength);
533#define open_simple_request(a,b,c,d,e) _open_simple_request(__LINE__,a,b,c,d,e)
535 int port,
const char *verb,
const char *
url)
547#define close_request(a) _close_request(__LINE__,a)
560#define receive_simple_request(a,b,c) _receive_simple_request(__LINE__,a,b,c)
594 DWORD contents_length, accepts_ranges;
597 trace(
"Starting InternetReadFile test with flags 0x%x on url %s\n",
flags,
test->url);
600 trace(
"InternetOpenA <--\n");
603 ok((hi != 0x0),
"InternetOpen failed with error %u\n",
GetLastError());
604 trace(
"InternetOpenA -->\n");
606 if (hi == 0x0)
goto abort;
608 pInternetSetStatusCallbackA(hi,&
callback);
612 trace(
"InternetConnectA <--\n");
615 ok((hic != 0x0),
"InternetConnect failed with error %u\n",
GetLastError());
616 trace(
"InternetConnectA -->\n");
618 if (hic == 0x0)
goto abort;
623 trace(
"HttpOpenRequestA <--\n");
635 ok((hor != 0x0),
"HttpOpenRequest failed with error %u\n",
GetLastError());
637 trace(
"HttpOpenRequestA -->\n");
639 if (hor == 0x0)
goto abort;
646 ok(
res,
"HttpQueryInfoA(HTTP_QUERY_RAW_HEADERS) failed with error %d\n",
GetLastError());
648 ok(!
strcmp(
buffer,
""),
"HTTP_QUERY_RAW_HEADERS: expected string \"\", but got \"%s\"\n",
buffer);
688 trace(
"HttpSendRequestA -->\n");
689 if(
test->post_data) {
698 "Asynchronous HttpSendRequest NOT returning 0 with error ERROR_IO_PENDING\n");
701 "Synchronous HttpSendRequest returning 0, error %u\n",
GetLastError());
702 trace(
"HttpSendRequestA <--\n");
746 ok(
res,
"InternetQueryOptionA(INTERNET_OPTION_URL) failed with error %d\n",
GetLastError());
752 ok(
res,
"HttpQueryInfoA(HTTP_QUERY_RAW_HEADERS) failed with error %d\n",
GetLastError());
756 ok(
buffer[
length-2],
"Expected any header character, got 0x00\n");
763 ok(!
res,
"Expected 0x00, got %d\n",
res);
765 ok(length2 ==
length+1,
"Expected %d, got %d\n",
length+1, length2);
770 ok(
res,
"HttpQueryInfoA(HTTP_QUERY_RAW_HEADERS) failed with error %d\n",
GetLastError());
771 ok(
buffer[length2] == 0x00,
"Expected 0x00, got %02X\n",
buffer[length2]);
772 ok(
buffer[length2+1] == 0x77,
"Expected 0x77, got %02X\n",
buffer[length2+1]);
773 ok(length2 ==
length,
"Value should not have changed: %d != %d\n", length2,
length);
776 memset(wbuffer, 0x77,
sizeof(wbuffer));
778 ok(
res,
"HttpQueryInfoW(HTTP_QUERY_RAW_HEADERS) failed with error %d\n",
GetLastError());
779 ok(
length %
sizeof(
WCHAR) == 0,
"Expected that length is a multiple of sizeof(WCHAR), got %d.\n",
length);
782 ok(wbuffer[
length-2],
"Expected any header character, got 0x0000\n");
783 ok(!wbuffer[
length-1],
"Expected 0x0000, got %04X\n", wbuffer[
length-1]);
784 ok(!wbuffer[
length],
"Expected 0x0000, got %04X\n", wbuffer[
length]);
786 "Expected 0x7777, got %04X\n", wbuffer[
length+1]);
790 ok(!
res,
"Expected 0x00, got %d\n",
res);
792 ok(length2 %
sizeof(
WCHAR) == 0,
"Expected that length is a multiple of sizeof(WCHAR), got %d.\n", length2);
793 length2 /=
sizeof(
WCHAR);
794 ok(length2 ==
length+1,
"Expected %d, got %d\n",
length+1, length2);
797 memset(wbuffer, 0x77,
sizeof(wbuffer));
799 ok(
res,
"HttpQueryInfoW(HTTP_QUERY_RAW_HEADERS) failed with error %d\n",
GetLastError());
800 ok(length2 %
sizeof(
WCHAR) == 0,
"Expected that length is a multiple of sizeof(WCHAR), got %d.\n", length2);
801 length2 /=
sizeof(
WCHAR);
802 ok(!wbuffer[length2],
"Expected 0x0000, got %04X\n", wbuffer[length2]);
803 ok(wbuffer[length2+1] == 0x7777,
"Expected 0x7777, got %04X\n", wbuffer[length2+1]);
804 ok(length2 ==
length,
"Value should not have changed: %d != %d\n", length2,
length);
814 "expected ERROR_HTTP_HEADER_NOT_FOUND, got %u\n",
GetLastError());
815 ok(
index == 0,
"Index was incremented\n");
824 "expected ERROR_HTTP_HEADER_NOT_FOUND, got %x (%u)\n",
res,
GetLastError());
831 ok(!
res ||
index == 1,
"Index was not incremented although result is %x (index = %u)\n",
res,
index);
847 trace(
"Option HTTP_QUERY_CONTENT_ENCODING -> %i %s\n",
res,
buffer);
856 "Got unexpected length %#x, GetLastError() %u, contents_length %u, accepts_ranges %#x.\n",
871 ok(!
res,
"InternetReadFile should have failed\n");
873 "InternetReadFile should have set last error to ERROR_INVALID_HANDLE instead of %u\n",
878 trace(
"Entering Query loop\n");
910 ok(!
length,
"InternetQueryDataAvailable returned ERROR_IO_PENDING and %u length\n",
length);
913 ok(exlen,
"length = 0\n");
946 ok(!on_async,
"Returned zero size in response to request complete\n");
970 trace(
"Starting InternetReadFile chunked test\n");
972 trace(
"InternetOpenA <--\n");
974 ok((hi != 0x0),
"InternetOpen failed with error %u\n",
GetLastError());
975 trace(
"InternetOpenA -->\n");
977 if (hi == 0x0)
goto abort;
979 trace(
"InternetConnectA <--\n");
982 ok((hic != 0x0),
"InternetConnect failed with error %u\n",
GetLastError());
983 trace(
"InternetConnectA -->\n");
985 if (hic == 0x0)
goto abort;
987 trace(
"HttpOpenRequestA <--\n");
999 ok((hor != 0x0),
"HttpOpenRequest failed with error %u\n",
GetLastError());
1001 trace(
"HttpOpenRequestA -->\n");
1003 if (hor == 0x0)
goto abort;
1005 trace(
"HttpSendRequestA -->\n");
1009 "Synchronous HttpSendRequest returning 0, error %u\n",
GetLastError());
1010 trace(
"HttpSendRequestA <--\n");
1025 "Failed to get TRANSFER_ENCODING option, error %u\n",
GetLastError() );
1027 "Wrong transfer encoding '%s'\n",
buffer );
1032 ok( !
res,
"Found CONTENT_LENGTH option '%s'\n",
buffer );
1036 trace(
"Entering Query loop\n");
1041 ok(!(!
res &&
length != 0),
"InternetQueryDataAvailable failed with non-zero length\n");
1054 trace(
"ReadFile -> %i %i\n",
res,got);
1055 ok(
length == got,
"only got %u of %u available\n", got,
length );
1056 ok(
buffer[got-1] ==
'\n',
"received partial line '%s'\n",
buffer );
1069 ok( !got,
"got %u\n", got );
1074 trace(
"aborting\n");
1077 ok (
res,
"InternetCloseHandle of handle opened by HttpOpenRequestA failed\n");
1081 ok (
res,
"InternetCloseHandle of handle opened by InternetOpenA failed\n");
1093 trace(
"Starting InternetReadFileExA test with flags 0x%x\n",
flags);
1096 trace(
"InternetOpenA <--\n");
1098 ok((hi != 0x0),
"InternetOpen failed with error %u\n",
GetLastError());
1099 trace(
"InternetOpenA -->\n");
1101 if (hi == 0x0)
goto abort;
1103 pInternetSetStatusCallbackA(hi,&
callback);
1107 trace(
"InternetConnectA <--\n");
1110 ok((hic != 0x0),
"InternetConnect failed with error %u\n",
GetLastError());
1111 trace(
"InternetConnectA -->\n");
1113 if (hic == 0x0)
goto abort;
1118 trace(
"HttpOpenRequestA <--\n");
1130 ok((hor != 0x0),
"HttpOpenRequest failed with error %u\n",
GetLastError());
1132 trace(
"HttpOpenRequestA -->\n");
1134 if (hor == 0x0)
goto abort;
1161 trace(
"HttpSendRequestA -->\n");
1166 "Asynchronous HttpSendRequest NOT returning 0 with error ERROR_IO_PENDING\n");
1169 "Synchronous HttpSendRequest returning 0, error %u\n",
GetLastError());
1170 trace(
"HttpSendRequestA <--\n");
1206 "InternetReadFileEx should have failed with ERROR_INVALID_PARAMETER instead of %s, %u\n",
1220 "InternetReadFileEx should have failed with ERROR_INVALID_PARAMETER instead of %s, %u\n",
1235 ok(rc,
"InternetReadFileEx failed with error %u\n",
GetLastError());
1240 "InternetReadFileEx should have failed with ERROR_INVALID_HANDLE instead of %s, %u\n",
1244 trace(
"Entering Query loop\n");
1262 trace(
"InternetReadFileEx -> PENDING\n");
1264 "Should not get ERROR_IO_PENDING without INTERNET_FLAG_ASYNC\n");
1279 trace(
"InternetReadFileEx -> SUCCEEDED\n");
1298 "InternetReadFileEx sets offsets to 0x%x%08x\n",
1308 ok(
length > 0,
"failed to read any of the document\n");
1325 "DeleteUrlCacheEntry returned %x, GetLastError() = %d\n",
ret,
GetLastError());
1328 ok((myhinternet != 0),
"InternetOpen failed, error %u\n",
GetLastError());
1338 ok((myhttp != 0),
"InternetOpenUrl failed, error %u\n",
GetLastError());
1341 totalbytes += readbytes;
1343 totalbytes += readbytes;
1344 trace(
"read 0x%08x bytes\n",totalbytes);
1365 static char szPostData[] =
"mode=Test";
1366 static const char szContentType[] =
"Content-Type: application/x-www-form-urlencoded";
1370 ok( hSession !=
NULL ,
"Unable to open Internet session\n");
1374 ok( hConnect !=
NULL,
"Unable to connect to http://test.winehq.org\n");
1379 skip(
"Network unreachable, skipping test\n" );
1400 ok(
ret,
"HttpSendRequestEx Failed with error %u\n",
error);
1405 for (
i = 3; szPostData[
i];
i++)
1407 "InternetWriteFile failed\n");
1416 "Unable to read response\n");
1417 szBuffer[dwBytesRead] = 0;
1419 ok(dwBytesRead == 13,
"Read %u bytes instead of 13\n",dwBytesRead);
1431 static const char *
types[] = {
"*",
"",
NULL };
1432 static const WCHAR slash[] = {
'/', 0}, any[] = {
'*', 0},
empty[] = {0};
1441 ok(
connect ==
NULL,
"InternetConnectA should have failed\n");
1446 ok(
connect ==
NULL,
"InternetConnectA should have failed\n");
1456 skip(
"Network unreachable, skipping test\n" );
1489 static const char cache_only_url[] =
"http://test.winehq.org/tests/cache-only";
1490 BYTE cache_headers[] =
"HTTP/1.1 200 OK\r\n\r\n";
1492 trace(
"Testing cache read...\n");
1499 li.
u.HighPart =
now.dwHighDateTime;
1500 li.
u.LowPart =
now.dwLowDateTime;
1518 cache_headers,
sizeof(cache_headers)-1,
"", 0);
1586 static const char cached_content[] =
"data read from cache";
1587 static const char *
types[] = {
"*",
"",
NULL };
1599 skip(
"Network unreachable, skipping test\n" );
1610 ok(
ret,
"InternetQueryOptionA(INTERNET_OPTION_URL) failed: %u\n",
GetLastError());
1611 ok(!
strcmp(
url,
"http://test.winehq.org/tests/hello.html"),
"Wrong URL %s\n",
url);
1615 ok(!
ret,
"InternetQueryOptionA(INTERNET_OPTION_DATAFILE_NAME) succeeded\n");
1624 ok(
ret,
"InternetQueryOptionA(INTERNET_OPTION_DATAFILE_NAME) failed: %u\n",
GetLastError());
1659 ok(
ret,
"HttpSendRequest failed\n");
1683 ok(!
ret,
"InternetQueryOptionA(INTERNET_OPTION_DATAFILE_NAME) succeeded\n");
1703 ok(
file_name[0] == 0,
"Didn't expect a file name\n");
1725 ok(!
ret,
"InternetQueryOptionA(INTERNET_OPTION_DATAFILE_NAME) succeeded\n");
1738 ok(
ret,
"InternetQueryOptionA(INTERNET_OPTION_DATAFILE_NAME) failed: %u\n",
GetLastError());
1746 ok(
lock == lock2,
"lock != lock2\n");
1780 ok( hSession !=
NULL ,
"Unable to open Internet session\n");
1784 ok( hConnect !=
NULL,
"Unable to connect to http://test.winehq.org\n");
1789 skip(
"Network unreachable, skipping test\n" );
1792 ok( hRequest !=
NULL,
"Failed to open request handle\n");
1798 buffer,&
len,&
index)==0,
"Warning hearder reported as Existing\n");
1801 "Failed to add new header\n");
1808 ok(
index == 1,
"Index was not incremented\n");
1810 ok(
len == 5,
"Invalid length (exp. 5, got %d)\n",
len);
1823 ok(
index == 0,
"Index was incremented\n");
1825 ok(
len == 6,
"Invalid length (exp. 6, got %d)\n",
len);
1834 ok(
len > 40,
"Invalid length (exp. more than 40, got %d)\n",
len);
1835 ok(
index == 0,
"Index was incremented\n");
1844 ok(
len > 40,
"Invalid length (exp. more than 40, got %d)\n",
len);
1845 ok(
index == 0,
"Index was incremented\n");
1853 ok(
len > 40,
"Invalid length (exp. more than 40, got %d)\n",
len);
1854 ok(
index == 0,
"Index was incremented\n");
1864 ok(
len +
sizeof(
CHAR) <= oldlen,
"Result longer than advertised\n");
1868 ok(
strncmp(
buffer,
"POST /tests/post.php HTTP/1", 25)==0,
"Invalid beginning of headers string\n");
1870 ok(
index == 0,
"Index was incremented\n");
1880 ok(
len > 80,
"Invalid length (exp. more than 80, got %d)\n",
len);
1881 ok(
index == 0,
"Index was incremented\n");
1886 len =
sizeof(wbuffer);
1887 memset(wbuffer,
'x',
sizeof(wbuffer));
1889 wbuffer,&
len,&
index),
"Unable to query header\n");
1890 ok(
len +
sizeof(
WCHAR) <= oldlen,
"Result longer than advertised\n");
1892 ok((
len <
sizeof(wbuffer)-
sizeof(
WCHAR)) && (wbuffer[
len/
sizeof(
WCHAR)] == 0),
"No NUL at end\n");
1893 ok(
index == 0,
"Index was incremented\n");
1903 ok(
len == 2 ||
len == 4 ,
"Expected 2 or 4, got %d\n",
len);
1905 ok(
index == 0,
"Index was incremented\n");
1908 "Failed to add duplicate header using HTTP_ADDREQ_FLAG_ADD\n");
1915 ok(
index == 1,
"Index was not incremented\n");
1921 ok(
index == 2,
"Index was not incremented\n");
1935 ok(
index == 1,
"Index was not incremented\n");
1941 ok(
index == 2,
"Index was not incremented\n");
1955 ok(
index == 1,
"Index was not incremented\n");
1961 ok(
index == 2,
"Index was not incremented\n");
1975 ok(
index == 1,
"Index was not incremented\n");
1980 ok(
index == 2,
"Index was not incremented\n");
1992 ok(
index == 1,
"Index was not incremented\n");
1997 ok(
index == 2,
"Index was not incremented\n");
2009 ok(
index == 1,
"Index was not incremented\n");
2010 ok(
strcmp(
buffer,
"test2, test4, test5; test6")==0,
"incorrect string was returned(%s)\n",
buffer);
2014 ok(
index == 2,
"Index was not incremented\n");
2026 ok(
index == 1,
"Index was not incremented\n");
2031 ok(
index == 2,
"Index was not incremented\n");
2044 ok(
index == 1,
"Index was not incremented\n");
2049 "Failed to add header with malformed entries in list\n");
2055 ok(
index == 1,
"Index was not incremented\n");
2061 ok(
index == 1,
"Index was not incremented\n");
2067 ok(
index == 1,
"Index was not incremented\n");
2078 ok(
index == 1,
"index was not incremented\n");
2088 "header still present\n");
2098"Garbage: Header\r\n";
2101"HTTP/1.1 100 Continue\r\n";
2104"HTTP/1.1 100 Continue\r\n"
2105"Server: winecontinue\r\n"
2106"Tag: something witty\r\n";
2109"HTTP/1.1 200 OK\r\n"
2110"Server: winetest\r\n"
2114"HTTP/1.1 201 OK\r\n"
2115"Server: winetest\r\n"
2119"HTTP/1.1 200 OK\r\n"
2120"Date: Mon, 01 Dec 2008 13:44:34 GMT\r\n"
2121"Server: winetest\r\n"
2122"Content-Length: 0\r\n"
2123"Set-Cookie: one\r\n"
2124"Set-Cookie: two\r\n"
2129"HTTP/1.1 200 OK\r\n"
2130"Content-Length: %I64u\r\n"
2134"HTTP/1.1 200 OK\r\n"
2135"Date: Mon, 01 Dec 2008 13:44:34 GMT\r\n"
2136"Server: winetest\r\n"
2137"Content-Length: 0\r\n"
2138"Set-Cookie: subcookie2=data; path=/test_cookie_set_path\r\n"
2142"HTTP/1.1 200 OK\r\n"
2143"Date: Mon, 01 Dec 2008 13:44:34 GMT\r\n"
2144"Server: winetest\r\n"
2145"Content-Length: 0\r\n"
2146"Set-Cookie: testcookie=testvalue\r\n"
2150"HTTP/1.1 400 Bad Request\r\n"
2151"Server: winetest\r\n"
2155"HTTP/1.1 401 Unauthorized\r\n"
2156"Server: winetest\r\n"
2157"Connection: close\r\n"
2158"WWW-Authenticate: Basic realm=\"placebo\"\r\n"
2162"HTTP/1.0 401 Anonymous requests or requests on unsecure channel are not allowed\r\n"
2163"HTTP/1.0 401 Anonymous requests or requests on unsecure channel are not allowed"
2165"Server: winetest\r\n";
2168"HTTP/1.1 407 Proxy Authentication Required\r\n"
2169"Server: winetest\r\n"
2170"Proxy-Connection: close\r\n"
2171"Proxy-Authenticate: Basic realm=\"placebo\"\r\n"
2176"<HEAD><TITLE>wininet test page</TITLE></HEAD>\r\n"
2177"<BODY>The quick brown fox jumped over the lazy dog<P></BODY>\r\n"
2181"HTTP/1.1 200 OK\r\n"
2182"Connection: Keep-Alive\r\n"
2183"Content-Length: 18\r\n\r\n"
2184"HTTP/1.1 211 OK\r\n\r\n";
2187"HTTP/1.1 210 OK\r\n"
2188"Connection: Keep-Alive\r\n"
2189"Content-Length: 19\r\n\r\n"
2190"HTTP/1.1 211 OK\r\n\r\n";
2210 int last_request = 0;
2211 char host_header[22];
2212 char host_header_override[30];
2237 sprintf(host_header,
"Host: localhost:%d", si->
port);
2238 sprintf(host_header_override,
"Host: test.local:%d\r\n", si->
port);
2279 if (
strstr(
buffer,
"Proxy-Authorization: Basic bWlrZToxMTAx"))
2289 if (
strstr(
buffer,
"Authorization: Basic dXNlcjpwd2Q="))
2422 static const char nocontentmsg[] =
"HTTP/1.1 204 No Content\r\nConnection: close\r\n\r\n";
2427 static const char conn_close_response[] =
"HTTP/1.1 200 OK\r\nConnection: close\r\n\r\nsome content";
2428 send(
c, conn_close_response,
sizeof(conn_close_response)-1, 0);
2430 trace(
"closing connection\n");
2432 if (
strstr(
buffer,
"GET /test_cache_control_no_cache"))
2434 static const char no_cache_response[] =
"HTTP/1.1 200 OK\r\nCache-Control: no-cache\r\n\r\nsome content";
2436 send(
c, no_cache_response,
sizeof(no_cache_response)-1, 0);
2440 if (
strstr(
buffer,
"GET /test_cache_control_no_store"))
2442 static const char no_cache_response[] =
"HTTP/1.1 200 OK\r\nCache-Control: junk, \t No-StOrE\r\n\r\nsome content";
2443 send(
c, no_cache_response,
sizeof(no_cache_response)-1, 0);
2447 static const char gzip_response[] =
"HTTP/1.1 200 OK\r\nContent-Encoding: gzip\r\nContent-Type: text/html\r\n\r\n"
2448 "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03\x4b\xaf\xca\x2c\x50\x28"
2449 "\x49\x2d\x2e\xe1\x02\x00\x62\x92\xc7\x6c\x0a\x00\x00\x00";
2451 send(
c, gzip_response,
sizeof(gzip_response), 0);
2456 static const char head_response[] =
2457 "HTTP/1.1 200 OK\r\n"
2458 "Connection: Keep-Alive\r\n"
2459 "Content-Length: 100\r\n"
2462 send(
c, head_response,
sizeof(head_response), 0);
2476 static char msg[] =
"HTTP/1.1 200 OK\r\nConnection: Keep-Alive\r\n\r\n";
2477 static int seen_content_length;
2479 if (!seen_content_length)
2483 seen_content_length = 1;
2497 trace(
"closing connection\n");
2500 if (
strstr(
buffer,
"Authorization: Basic dXNlcjpwd2Q="))
2507 if (
strstr(
buffer,
"Authorization: Basic dXNlcjpwd2Q="))
2514 if (
strstr(
buffer,
"Authorization: Basic dXNlcjE6cHdkMQ=="))
2521 if (
strstr(
buffer,
"Authorization: Bearer dXNlcjE6cHdkMQ=="))
2523 else if (
strstr(
buffer,
"Authorization: Basic dXNlcjpwd2Q="))
2558 if (
strstr(
buffer,
"/test_cookie_check_host_override"))
2565 if (
strstr(
buffer,
"/test_cookie_check_different_host"))
2582 const char *page1_mid =
page1 + (
sizeof page1 - 1)/2;
2583 const char *page1_end =
page1 +
sizeof page1 - 1;
2587 send(
c, page1_mid, page1_end - page1_mid, 0);
2613 if (
strstr(
buffer,
"Authorization: Basic dGVzdDE6cGFzcw=="))
2620 if (
strstr(
buffer,
"Authorization: Basic dGVzdDE6cGFzczI="))
2628 }
while (!last_request);
2642 trace(
"basic request %s %s\n", verb,
url);
2679 skip(
"missing proxy header, not testing remaining proxy headers\n");
2682 ok(!
strcmp(
buffer,
"Basic realm=\"placebo\""),
"proxy auth info wrong\n");
2689 ok(
r,
"HttpQueryInfo failed\n");
2690 ok(!
strcmp(
buffer,
"Proxy Authentication Required"),
"proxy text wrong\n");
2694 ok(
r,
"HttpQueryInfo failed\n");
2699 ok(
r,
"HttpQueryInfo failed\n");
2705 ok(
r ==
FALSE,
"HttpQueryInfo failed\n");
2716 WCHAR bufferW[0x40];
2717 static const char url_fmt[] =
"http://test.winehq.org:%u/test2";
2720 useragent[] =
"winetest";
2721 static const WCHAR usernameW[] = {
'm',
'i',
'k',
'e',0},
2722 passwordW[] = {
'1',
'1',
'0',
'1',0},
2723 useragentW[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',0};
2731 ok(hi ==
NULL ||
broken(!!hi) ,
"open should have failed\n");
2735 ok(hi !=
NULL,
"open failed\n");
2739 ok(hc !=
NULL,
"connect failed\n");
2742 ok(
hr !=
NULL,
"HttpOpenRequest failed\n");
2748 ok(!
r,
"unexpected success\n");
2749 ok(sz == 1,
"got %u\n", sz);
2755 ok(!
r,
"unexpected success\n");
2756 ok(sz == 1,
"got %u\n", sz);
2762 ok(!sz,
"got %u\n", sz);
2768 ok(!sz,
"got %u\n", sz);
2774 ok(!
r,
"unexpected success\n");
2775 ok(sz == 1,
"got %u\n", sz);
2781 ok(!
r,
"unexpected success\n");
2782 ok(sz == 1,
"got %u\n", sz);
2788 ok(!sz,
"got %u\n", sz);
2794 ok(!sz,
"got %u\n", sz);
2800 ok(!
r,
"unexpected success\n");
2801 ok(sz == 34,
"got %u\n", sz);
2807 ok(sz == 33,
"got %u\n", sz);
2813 win_skip(
"skipping proxy tests on broken wininet\n");
2821 ok(!
r,
"unexpected success\n");
2824 ok(
r,
"failed to set user\n");
2827 ok(
r,
"failed to set user\n");
2842 ok(!
r,
"unexpected success\n");
2850 ok(!
r,
"unexpected success\n");
2856 ok(
r,
"failed to get username\n");
2861 sz =
sizeof(bufferW);
2863 ok(
r,
"failed to get username\n");
2864 ok(!
lstrcmpW(bufferW, usernameW),
"wrong username\n");
2865 ok(sz ==
lstrlenW(usernameW),
"got %u\n", sz);
2868 ok(
r,
"failed to set user\n");
2873 ok(
r,
"failed to get username\n");
2878 ok(
r,
"failed to set useragent\n");
2885 ok(!
r,
"unexpected success\n");
2886 ok(sz ==
strlen(useragent) + 1,
"got %u\n", sz);
2891 ok(
r,
"failed to get user agent\n");
2893 ok(sz ==
strlen(useragent),
"got %u\n", sz);
2900 ok(!
r,
"unexpected success\n");
2904 sz =
sizeof(bufferW);
2906 ok(
r,
"failed to get user agent\n");
2907 ok(!
lstrcmpW(bufferW, useragentW),
"wrong user agent\n");
2908 ok(sz ==
lstrlenW(useragentW),
"got %u\n", sz);
2911 ok(
r,
"failed to set user\n");
2918 ok(!
r,
"unexpected success\n");
2924 ok(
r,
"failed to get user\n");
2933 ok(!
r,
"unexpected success\n");
2937 sz =
sizeof(bufferW);
2939 ok(
r,
"failed to get user\n");
2940 ok(!
lstrcmpW(bufferW, usernameW),
"wrong user\n");
2941 ok(sz ==
lstrlenW(usernameW),
"got %u\n", sz);
2944 ok(
r,
"failed to set password\n");
2951 ok(!
r,
"unexpected success\n");
2957 ok(
r,
"failed to get password\n");
2966 ok(!
r,
"unexpected success\n");
2970 sz =
sizeof(bufferW);
2972 ok(
r,
"failed to get password\n");
2973 ok(!
lstrcmpW(bufferW, passwordW),
"wrong password\n");
2974 ok(sz ==
lstrlenW(passwordW),
"got %u\n", sz);
2983 ok(!
r,
"unexpected success\n");
2989 ok(
r,
"failed to get url\n");
2998 ok(!
r,
"unexpected success\n");
3002 sz =
sizeof(bufferW);
3004 ok(
r,
"failed to get url\n");
3010 ok(
r,
"failed to set password\n");
3017 ok(!
r,
"unexpected success\n");
3023 ok(
r,
"failed to get password\n");
3032 ok(!
r,
"unexpected success\n");
3036 sz =
sizeof(bufferW);
3038 ok(
r,
"failed to get password\n");
3039 ok(!
lstrcmpW(bufferW, passwordW),
"wrong password\n");
3040 ok(sz ==
lstrlenW(passwordW),
"got %u\n", sz);
3045 win_skip(
"skipping proxy tests on broken wininet\n");
3051 ok(
r,
"HttpQueryInfo failed\n");
3060 ok(hi !=
NULL,
"InternetOpen failed\n");
3063 ok(hc !=
NULL,
"InternetConnect failed\n");
3066 ok(
hr !=
NULL,
"HttpOpenRequest failed\n");
3081 static const char authorization[] =
"Authorization: Basic dXNlcjpwd2Q=";
3082 static const char connection[] =
"Connection: Close";
3083 static const char *
types[2] = {
"*",
NULL };
3099 ok(
ret,
"HttpAddRequestHeaders failed\n");
3102 ok(
ret,
"HttpSendRequest failed\n");
3113 ok(
ret,
"HttpSendRequest failed\n");
3118 ok(
ret,
"HttpQueryInfo failed\n");
3131 ok(
ret,
"HttpAddRequestHeaders failed\n");
3134 ok(
ret,
"HttpSendRequest failed\n");
3139 ok(
ret,
"HttpQueryInfo failed\n");
3152 ok(
ret,
"HttpAddRequestHeaders failed\n");
3154 data_len =
sizeof(
data);
3162 ok(
ret,
"HttpQueryInfo failed\n");
3176 ok(ses !=
NULL,
"InternetOpen failed\n");
3179 ok(con !=
NULL,
"InternetConnect failed\n");
3182 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3185 ok(
ret,
"HttpSendRequest failed\n");
3192 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3195 ok(
ret,
"HttpSendRequest failed\n");
3202 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3205 ok(
ret,
"HttpSendRequest failed\n");
3212 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3215 ok(
ret,
"HttpSendRequest failed\n");
3226 char buffer[128], host_header_override[30], full_url[128];
3231 sprintf(host_header_override,
"Host: test.local:%d\r\n",
port);
3232 sprintf(full_url,
"http://localhost:%d/test_host_override",
port);
3235 ok(ses !=
NULL,
"InternetOpen failed\n");
3238 ok(con !=
NULL,
"InternetConnect failed\n");
3241 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3248 ok(!
ret,
"HttpQueryInfo succeeded\n");
3254 ok(
ret,
"HttpAddRequestHeaders failed\n");
3260 ok(
ret,
"HttpQueryInfo failed\n");
3265 ok(
ret,
"HttpSendRequest failed\n");
3271 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3274 ok(
ret,
"HttpAddRequestHeaders failed\n");
3277 ok(
ret,
"HttpAddRequestHeaders failed\n");
3280 ok(
ret,
"HttpSendRequest failed\n");
3286 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3289 ok(
ret,
"HttpAddRequestHeaders failed\n");
3292 ok(
ret,
"HttpSendRequest failed\n");
3298 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3302 trace(
"replacing host header is supported.\n");
3305 ok(
ret,
"HttpSendRequest failed\n");
3309 trace(
"replacing host header is not supported.\n");
3315 ok(
ret,
"HttpSendRequest failed\n");
3323 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3326 ok(
ret,
"HttpAddRequestHeaders failed\n");
3329 ok(
ret,
"HttpSendRequest failed\n");
3335 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3338 ok(
ret,
"HttpAddRequestHeaders failed\n");
3341 ok(
ret,
"HttpSendRequest failed\n");
3347 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3350 ok(
ret,
"HttpAddRequestHeaders failed\n");
3353 ok(
ret,
"HttpSendRequest failed\n");
3359 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3362 ok(
ret,
"HttpSendRequest failed\n");
3369 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3372 ok(
ret,
"HttpSendRequest failed\n");
3378 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3381 ok(
ret,
"HttpAddRequestHeaders failed\n");
3384 ok(
ret,
"HttpSendRequest failed\n");
3393 ok(ses !=
NULL,
"InternetOpenA failed\n");
3411 ok(ses !=
NULL,
"InternetOpenA failed\n");
3420 ok(
ret,
"HttpAddRequestHeaders failed\n");
3432 ok(ses !=
NULL,
"InternetOpenA failed\n");
3441 ok(
ret,
"HttpAddRequestHeaders failed\n");
3453 ok(ses !=
NULL,
"InternetOpenA failed\n");
3507 "Asynchronous HttpSendRequest NOT returning 0 with error ERROR_IO_PENDING\n");
3537 "Asynchronous HttpSendRequest NOT returning 0 with error ERROR_IO_PENDING\n");
3567 "Asynchronous HttpSendRequest NOT returning 0 with error ERROR_IO_PENDING\n");
3625 "Asynchronous HttpSendRequest NOT returning 0 with error ERROR_IO_PENDING\n");
3653 "Asynchronous HttpSendRequest NOT returning 0 with error ERROR_IO_PENDING\n");
3680 trace(
"Testing 204 no content response...\n");
3714 "Asynchronous HttpSendRequest NOT returning 0 with error ERROR_IO_PENDING\n");
3743 trace(
"Testing connection close connection...\n");
3775 "Asynchronous HttpSendRequest NOT returning 0 with error ERROR_IO_PENDING\n");
3791 ok(
avail != 0,
"avail = 0\n");
3803 "Asynchronous HttpSendRequest NOT returning 0 with error ERROR_IO_PENDING\n");
3824 static const char cache_control_no_cache[] =
"/test_cache_control_no_cache";
3825 static const char cache_control_no_store[] =
"/test_cache_control_no_store";
3826 static const char cache_url_fmt[] =
"http://localhost:%d%s";
3828 char cache_url[256],
buf[256];
3833 trace(
"Testing no-cache header\n");
3842 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3844 sprintf(cache_url, cache_url_fmt,
port, cache_control_no_cache);
3852 ok(
size == 12,
"read %d bytes of data\n",
size);
3856 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3863 ok(
size == 0,
"read %d bytes of data\n",
size);
3868 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3870 sprintf(cache_url, cache_url_fmt,
port, cache_control_no_store);
3878 ok(
size == 12,
"read %d bytes of data\n",
size);
3890 static const char cache_url_fmt[] =
"http://localhost:%d%s";
3891 static const char get_gzip[] =
"/test_cache_gzip";
3892 static const char content[] =
"gzip test\n";
3893 static const char text_html[] =
"text/html";
3894 static const char raw_header[] =
"HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n";
3898 char cache_url[256],
buf[256];
3901 trace(
"Testing reading compressed content from cache\n");
3910 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3915 win_skip(
"INTERNET_OPTION_HTTP_DECODING not supported\n");
3921 ok(
ret,
"InternetSetOption(INTERNET_OPTION_HTTP_DECODING) failed: %d\n",
GetLastError());
3928 ok(
size == 10,
"read %d bytes of data\n",
size);
3946 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3950 ok(
ret,
"InternetSetOption(INTERNET_OPTION_HTTP_DECODING) failed: %d\n",
GetLastError());
3964 "HttpQueryInfo(HTTP_QUERY_CONTENT_ENCODING) returned %d, %d\n",
3976 sprintf(cache_url, cache_url_fmt,
port, get_gzip);
3980 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3987 ok(
size == 31,
"read %d bytes of data\n",
size);
3991 ok(req !=
NULL,
"HttpOpenRequest failed\n");
3995 ok(
ret,
"InternetSetOption(INTERNET_OPTION_HTTP_DECODING) failed: %d\n",
GetLastError());
4014 sprintf(cache_url, cache_url_fmt,
port, get_gzip);
4022 ok(
ret,
"InternetSetOption(INTERNET_OPTION_HTTP_DECODING) failed: %d\n",
GetLastError());
4028 ok(req !=
NULL,
"HttpOpenRequest failed\n");
4035 ok(
size == 10,
"read %d bytes of data\n",
size);
4045 sprintf(cache_url, cache_url_fmt,
port, get_gzip);
4056 ok(
ret,
"InternetSetOption(INTERNET_OPTION_HTTP_DECODING) failed: %d\n",
GetLastError());
4059 ok(req !=
NULL,
"HttpOpenRequest failed\n");
4066 ok(
size == 10,
"read %d bytes of data\n",
size);
4079 static const WCHAR header[] = {
'U',
'A',
'-',
'C',
'P',
'U',
':',
' ',
'x',
'8',
'6',0};
4085 ok(ses !=
NULL,
"InternetOpen failed\n");
4088 ok(con !=
NULL,
"InternetConnect failed\n");
4091 ok(req !=
NULL,
"HttpOpenRequest failed\n");
4096 ok(!
ret,
"HttpSendRequestW succeeded\n");
4100 "got %u expected ERROR_IO_PENDING\n",
error);
4115 ok(ses !=
NULL,
"InternetOpen failed\n");
4118 ok(con !=
NULL,
"InternetConnect failed\n");
4123 ok(req !=
NULL,
"HttpOpenRequest failed\n");
4130 ok(!
ret,
"HttpQueryInfo succeeded\n");
4140 ok(!!
strstr(
buffer,
"cookie=not biscuit"),
"got '%s' expected \'cookie=not biscuit\'\n",
buffer);
4151 ok(!
strstr(
buffer,
"cookie=not biscuit"),
"'%s' should not contain \'cookie=not biscuit\'\n",
buffer);
4159 ok(req !=
NULL,
"HttpOpenRequest failed\n");
4162 ok(
ret,
"HttpSendRequest failed\n");
4168 ok(req !=
NULL,
"HttpOpenRequest failed\n");
4171 ok(
ret,
"HttpSendRequest failed\n");
4177 ok(req !=
NULL,
"HttpOpenRequest failed\n");
4180 ok(
ret,
"HttpSendRequest failed\n");
4186 ok(req !=
NULL,
"HttpOpenRequest failed\n");
4189 ok(
ret,
"HttpSendRequest failed\n");
4195 ok(req !=
NULL,
"HttpOpenRequest failed\n");
4201 ok(
ret,
"HttpSendRequest failed\n");
4270 ok(
ret,
"HttpQueryInfo failed\n");
4271 ok(!
strcmp(
buffer,
"HTTP/1.0 401 Anonymous requests or requests on unsecure channel are not allowed"),
4272 "headers wrong \"%s\"\n",
buffer);
4277 ok(
ret,
"HttpQueryInfo failed\n");
4375 ok(
ret,
"HttpSendRequest failed\n");
4405 "Expected ERROR_HTTP_HEADER_NOT_FOUND, got %u\n",
GetLastError());
4428 ok(!
ret,
"HttpQueryInfo succeeded\n");
4429 ok(
index == 0xdeadbeef,
"expected 0xdeadbeef got %u\n",
index);
4467 ok(ses !=
NULL,
"InternetOpen failed\n");
4472 ok(!
ret,
"InternetSetOption succeeded\n");
4477 ok(!
ret,
"InternetSetOption succeeded\n");
4483 ok(!
ret,
"InternetSetOption succeeded\n");
4494 ok(!
ret,
"InternetQueryOption succeeded\n");
4500 ok(!
ret,
"InternetQueryOption succeeded\n");
4507 ok(!
ret,
"InternetQueryOption succeeded\n");
4514 ok(!
ret,
"InternetQueryOption succeeded\n");
4521 ok(
ctx == 1,
"expected 1 got %lu\n",
ctx);
4524 ok(con !=
NULL,
"InternetConnect failed\n");
4530 ok(
ctx == 0,
"expected 0 got %lu\n",
ctx);
4540 ok(
ctx == 2,
"expected 2 got %lu\n",
ctx);
4543 ok(req !=
NULL,
"HttpOpenRequest failed\n");
4549 ok(
ctx == 0,
"expected 0 got %lu\n",
ctx);
4559 ok(
ctx == 3,
"expected 3 got %lu\n",
ctx);
4561 size =
sizeof(idsi);
4569 ok(!
ret,
"InternetQueryOption succeeded\n");
4576 ok(!
ret,
"InternetQueryOption succeeded\n");
4582 ok(!
ret,
"InternetQueryOption succeeded\n");
4589 ok(!
ret,
"InternetQueryOption succeeded\n");
4607 "HTTP/1.1 200 OK\r\n"
4608 "Content-Length: 1\r\n"
4614 "HTTP/1.1 404 Fail\r\n"
4615 "Content-Length: 1\r\n"
4622 "Content-Length: 1\r\n"
4629 "Content-Length: 1\r\n"
4649 ok(
res,
"HttpSendRequest failed\n");
4712 char data[] = {
't',
'e',
's',
't'};
4740 ok(ses !=
NULL,
"InternetOpen failed\n");
4743 ok(con !=
NULL,
"InternetConnect failed\n");
4746 ok(req !=
NULL,
"HttpOpenRequest failed\n");
4749 ok(
ret,
"HttpAddRequestHeaders failed\n");
4752 ok(
ret,
"HttpSendRequestA failed\n");
4756 ok(
strstr(
buf,
"Accept-Encoding: gzip") !=
NULL,
"Accept-Encoding header not found in %s\n",
buf);
4761 ok(req !=
NULL,
"HttpOpenRequest failed\n");
4764 ok(
ret,
"HttpSendRequestA failed\n");
4768 ok(
strstr(
buf,
"Accept-Encoding: gzip") !=
NULL,
"Accept-Encoding header not found in %s\n",
buf);
4783 ok( ses !=
NULL,
"InternetOpenA failed\n" );
4820 ok( ses !=
NULL,
"InternetOpenA failed\n" );
4865 ok( ses !=
NULL,
"InternetOpenA failed\n" );
4902 ok( ses !=
NULL,
"InternetOpenA failed\n" );
4951 ok( ses !=
NULL,
"InternetOpenA failed\n" );
4988 ok( ses !=
NULL,
"InternetOpenA failed\n" );
5035 ok( ses !=
NULL,
"InternetOpenA failed\n" );
5050 ok(
ret,
"HttpAddRequestHeaders Failed\n");
5067 ok( ses !=
NULL,
"InternetOpenA failed\n" );
5089 ok( ses !=
NULL,
"InternetOpenA failed\n" );
5100 ok(
ret,
"HttpAddRequestHeaders Failed\n");
5126 ok( ses !=
NULL,
"InternetOpenA failed\n" );
5153 ok( ses !=
NULL,
"InternetOpenA failed\n" );
5164 ok(
ret,
"HttpAddRequestHeaders Failed\n");
5185 DWORD pending_reads;
5193 ok( ses !=
NULL,
"InternetOpenA failed\n" );
5194 pInternetSetStatusCallbackA( ses, &
callback );
5220 ok( !
ret,
"HttpSendRequestA unexpectedly succeeded\n" );
5238 memset( &ib, 0,
sizeof(ib) );
5259 if (!pending_reads++)
5279 ok( pending_reads == 1,
"expected 1 pending read, got %u\n", pending_reads );
5286 ok( ses !=
NULL,
"InternetOpenA failed\n" );
5287 pInternetSetStatusCallbackA( ses, &
callback );
5313 ok( !
ret,
"HttpSendRequestA unexpectedly succeeded\n" );
5348 if (!pending_reads++)
5359 ok(
bytes != 0,
"expected bytes != 0\n" );
5373 ok( pending_reads == 1,
"expected 1 pending read, got %u\n", pending_reads );
5388#define server_read_request(a) _server_read_request(__LINE__,a)
5431 if(new_connection) {
5442 ok(!
ret,
"HttpSendRequestA unexpectedly succeeded\n");
5451 if(new_connection) {
5509#define readex_expect_sync_data_len(a,b,c,d,e,f,g) _readex_expect_sync_data_len(__LINE__,a,b,c,d,e,f,g)
5522 buf->dwBufferLength = buf_size;
5525 ok_(__FILE__,
line)(
buf->dwBufferLength ==
len,
"dwBufferLength = %u, expected %u\n",
buf->dwBufferLength,
len);
5536#define readex_expect_sync_data(a,b,c,d,e,f) _readex_expect_sync_data(__LINE__,a,b,c,d,e,f)
5538 DWORD buf_size,
const char *exdata,
DWORD expect_receive)
5543#define read_expect_sync_data_len(a,b,c,d,e) _read_expect_sync_data_len(__LINE__,a,b,c,d,e)
5547 DWORD ret_size = 0xdeadbeef;
5558 ok_(__FILE__,
line)(ret_size ==
len,
"dwBufferLength = %u, expected %u\n", ret_size,
len);
5569#define read_expect_sync_data(a,b,c,d) _read_expect_sync_data(__LINE__,a,b,c,d)
5571 DWORD buf_size,
const char *exdata)
5583#define send_response_and_wait(a,b,c,d,e,f,g,h) _send_response_and_wait(__LINE__,a,b,c,d,e,f,g,h)
5585 void *
buf,
DWORD *ret_size,
const char *exdata,
5586 DWORD expected_size,
DWORD expected_req_error,
DWORD expected_receive_size)
5595 if(do_close_connection)
5610 ok_(__FILE__,
line)(*ret_size == expected_size,
"dwBufferLength = %u\n", *ret_size);
5617#define send_response_ex_and_wait(a,b,c,d,e,f) _send_response_ex_and_wait(__LINE__,a,b,c,d,e,f)
5620 DWORD expected_receive_size)
5623 exdata, exdata ?
strlen(exdata) :
buf->dwBufferLength, expected_req_error,
5624 expected_receive_size);
5638#define readex_expect_async(a,b,c,d,e) _readex_expect_async(__LINE__,a,b,c,d,e)
5640 DWORD buf_size,
const char *exdata)
5649 buf->dwBufferLength = buf_size;
5652 ok_(__FILE__,
line)(
buf->dwBufferLength == buf_size,
"dwBufferLength = %u, expected %u\n",
buf->dwBufferLength, buf_size);
5657 ok_(__FILE__,
line)(!*(
DWORD*)
buf->lpvBuffer,
"buffer data changed\n");
5672 *ret_size = 0xdeadbeef;
5676 ok(*ret_size == 0,
"dwBufferLength = %u\n", *ret_size);
5681 for(
p = (
const char*)
buf +
len;
p < (
const char*)
buf + buf_size;
p++) {
5683 ok(0,
"buffer data changed\n");
5689#define expect_data_available(a,b) _expect_data_available(__LINE__,a,b)
5698 ok_(__FILE__,
line)(
size == exsize,
"size = %u, expected %u\n",
size, exsize);
5703#define async_query_data_available(a,b) _async_query_data_available(__LINE__,a,b)
5714 "InternetQueryDataAvailable returned: %x(%u)\n",
res,
GetLastError());
5732 memset(&ib, 0,
sizeof(ib));
5736 trace(
"Testing InternetReadFileExW with IRF_ASYNC flag...\n");
5739 "HTTP/1.1 200 OK\r\n"
5740 "Server: winetest\r\n"
5755 trace(
"Testing InternetReadFileExW with no flags...\n");
5758 "HTTP/1.1 200 OK\r\n"
5759 "Server: winetest\r\n"
5774 trace(
"Testing InternetReadFile...\n");
5777 "HTTP/1.1 200 OK\r\n"
5778 "Server: winetest\r\n"
5793 trace(
"Testing InternetReadFileExW with IRF_NO_WAIT flag...\n");
5796 "HTTP/1.1 200 OK\r\n"
5797 "Server: winetest\r\n"
5806 win_skip(
"Skipping receive notification tests on too old Windows.\n");
5825 "HTTP/1.1 200 OK\r\n"
5826 "Server: winetest\r\n"
5827 "Transfer-Encoding: chunked\r\n"
5852 "HTTP/1.1 200 OK\r\n"
5853 "Server: winetest\r\n"
5854 "Transfer-Encoding: chunked\r\n"
5866 "HTTP/1.1 200 OK\r\n"
5867 "Server: winetest\r\n"
5868 "Connection: close\r\n"
5880 trace(
"Testing InternetQueryDataAvailable...\n");
5883 "HTTP/1.1 200 OK\r\n"
5884 "Server: winetest\r\n"
5902 "HTTP/1.1 200 OK\r\n"
5903 "Server: winetest\r\n"
5904 "Connection: close\r\n"
5921 for(
i = 0;
i < 10;
i++)
5949 memset(&ib, 0,
sizeof(ib));
5953 trace(
"Testing InternetReadFileExW on broken connection...\n");
5956 "HTTP/1.1 200 OK\r\n"
5957 "Server: winetest\r\n"
5958 "Content-Length: 10000\r\n"
5974 char buf[
sizeof(long_path)*2],
url[
sizeof(
buf)];
5983 long_path[
sizeof(long_path)-1] = 0;
5997 ok(
ret,
"InternetQueryOptionA(INTERNET_OPTION_URL) failed: %u\n",
GetLastError());
6014 memset(&ib, 0,
sizeof(ib));
6020 trace(
"Testing persistent connection...\n");
6023 "HTTP/1.1 200 OK\r\n"
6024 "Server: winetest\r\n"
6025 "Content-Length: 2\r\n"
6036 "Server: winetest\r\n"
6037 "Transfer-Encoding: chunked\r\n"
6054 "Server: winetest\r\n"
6055 "Transfer-Encoding: chunked\r\n"
6075 "Server: winetest\r\n"
6076 "Content-Length: 0\r\n"
6077 "Connection: keep-alive\r\n"
6092 "Server: winetest\r\n"
6093 "Transfer-Encoding: chunked\r\n"
6128 memset(&ib, 0,
sizeof(ib));
6132 trace(
"Testing redirection...\n");
6142 "Server: winetest\r\n"
6143 "Location: test_redirection\r\n"
6144 "Connection: keep-alive\r\n"
6145 "Content-Length: 0\r\n"
6152 sprintf(expect_url,
"http://localhost:%u/test_redirection",
port);
6158 "Server: winetest\r\n"
6159 "Content-Length: 3\r\n"
6176 trace(
"Test redirect to non-http URL...\n");
6183 "Server: winetest\r\n"
6184 "Location: test:non:http/url\r\n"
6185 "Connection: keep-alive\r\n"
6186 "Content-Length: 0\r\n"
6194 sprintf(expect_url,
"http://localhost:%u/socket",
port);
6201 trace(
"Test redirect to http URL with no host name...\n");
6208 "Server: winetest\r\n"
6209 "Location: http:///nohost\r\n"
6210 "Connection: keep-alive\r\n"
6211 "Content-Length: 0\r\n"
6219 sprintf(expect_url,
"http://localhost:%u/socket",
port);
6275 sizelen =
sizeof(
len);
6281 ok(
ret,
"HttpQueryInfo should have succeeded\n");
6290 ok(!
ret,
"HttpQueryInfo should have failed\n");
6292 "expected ERROR_HTTP_INVALID_HEADER, got %x\n",
GetLastError());
6293 ok(
len == ~0,
"expected ~0, got %u\n",
len);
6295 ok(sizelen ==
sizeof(
DWORD),
"sizelen %u\n", sizelen);
6300 sizelen =
sizeof(len64);
6304 ok(!
ret,
"HttpQueryInfo should have failed\n");
6306 "expected ERROR_HTTP_INVALID_HEADER, got %x\n",
GetLastError());
6307 ok(sizelen ==
sizeof(
DWORD64),
"sizelen %u\n", sizelen);
6308 ok(len64 == ~0,
"len64 %x%08x\n", (
DWORD)(len64 >> 32), (
DWORD)len64);
6314 "HTTP/1.1 200 OK\r\n"
6315 "Server: winetest\r\n"
6316 "Content-Length: 4294967296\r\n"
6393 skip(
"Skipping test_redirect and test_persistent_connection due to hang. See ROSTESTS-294.\n");
6434 "700 Raymond Ave\r\n"
6442 "Network Solutions L.L.C.\r\n"
6443 "Network Solutions OV Server CA 2"
6452 "test.winehq.com\r\n"
6453 "webmaster@winehq.org",
6460 "test.winehq.com\r\n"
6461 "webmaster@winehq.org"
6465 "Subject:\r\n%s\r\n"
6467 "Effective Date:\t%s %s\r\n"
6468 "Expiration Date:\t%s %s\r\n"
6469 "Security Protocol:\t%s\r\n"
6470 "Signature Type:\t%s\r\n"
6471 "Encryption Type:\t%s\r\n"
6472 "Privacy Strength:\t%s (%u bits)";
6477 char expiry_date[32];
6478 char expiry_time[32];
6479 char start_date[32];
6480 char start_time[32];
6486 size =
sizeof(actual);
6488 memset(actual, 0x55,
sizeof(actual));
6501 start_date, start_time, expiry_date, expiry_time,
6502 info->lpszSignatureAlgName,
info->lpszEncryptionAlgName,
info->lpszProtocolName,
6503 info->dwKeySize >= 128 ?
"High" :
"Low",
info->dwKeySize);
6509 memset(actual, 0x55,
sizeof(actual));
6512 ok(
size == 1,
"unexpected size: %u\n",
size);
6513 ok(actual[0] == 0x55,
"unexpected byte: %02x\n", actual[0]);
6528 win_skip(
"Querying INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT failed, skipping tests\n");
6535 ok(!
strcmp(
info.lpszSubjectInfo,
test->ex_subject),
"lpszSubjectInfo = %s\n",
info.lpszSubjectInfo);
6536 ok(!
strcmp(
info.lpszIssuerInfo,
test->ex_issuer),
"lpszIssuerInfo = %s\n",
info.lpszIssuerInfo);
6537 ok(!
info.lpszSignatureAlgName,
"lpszSignatureAlgName = %s\n",
info.lpszSignatureAlgName);
6538 ok(!
info.lpszEncryptionAlgName,
"lpszEncryptionAlgName = %s\n",
info.lpszEncryptionAlgName);
6539 ok(!
info.lpszProtocolName,
"lpszProtocolName = %s\n",
info.lpszProtocolName);
6540 ok(
info.dwKeySize >= 128 &&
info.dwKeySize <= 256,
"dwKeySize = %u\n",
info.dwKeySize);
6545 skip(
"Skipping tests that are English-only\n");
6549#define test_security_info(a,b,c) _test_security_info(__LINE__,a,b,c)
6557 if(!pInternetGetSecurityInfoByURLA) {
6558 win_skip(
"pInternetGetSecurityInfoByURLA not available\n");
6563 chain = (
void*)0xdeadbeef;
6575 "InternetGetSecurityInfoByURLA returned: %x(%u)\n",
res,
GetLastError());
6589#define test_secflags_option(a,b,c) _test_secflags_option(__LINE__,a,b,c)
6598 ok_(__FILE__,
line)(
res,
"InternetQueryOptionW(INTERNET_OPTION_SECURITY_FLAGS) failed: %u\n",
GetLastError());
6599 ok_(__FILE__,
line)((
flags & ~opt_flags) == ex_flags,
"INTERNET_OPTION_SECURITY_FLAGS flags = %x, expected %x\n",
6607 ok_(__FILE__,
line)((
flags & ~opt_flags) == ex_flags,
"INTERNET_OPTION_SECURITY_FLAGS(98) flags = %x, expected %x\n",
6611#define set_secflags(a,b,c) _set_secflags(__LINE__,a,b,c)
6617 ok_(__FILE__,
line)(
res,
"InternetSetOption(INTERNET_OPTION_SECURITY_FLAGS) failed: %u\n",
GetLastError());
6630 win_skip(
"Can't make https connections, skipping security flags test\n");
6634 trace(
"Testing security flags...\n");
6638 ok(ses !=
NULL,
"InternetOpen failed\n");
6640 pInternetSetStatusCallbackA(ses, &
callback);
6652 ok(req !=
NULL,
"HttpOpenRequest failed\n");
6659 win_skip(
"Incomplete security flags support, skipping\n");
6727 ok(
res,
"InternetSetOption(INTERNET_OPTION_END_BROWSER_SESSION) failed: %u\n",
GetLastError());
6733 ok(req !=
NULL,
"HttpOpenRequest failed\n");
6738 ok(
res,
"InternetQueryOption(INTERNET_OPTION_ERROR_MASK failed: %u\n",
GetLastError());
6766 cert->lpszSignatureAlgName = (
char *)0xdeadbeef;
6767 cert->lpszEncryptionAlgName = (
char *)0xdeadbeef;
6768 cert->lpszProtocolName = (
char *)0xdeadbeef;
6769 cert->dwKeySize = 0xdeadbeef;
6774 ok(
cert->lpszSubjectInfo &&
strlen(
cert->lpszSubjectInfo) > 1,
"expected a non-empty subject name\n");
6775 ok(
cert->lpszIssuerInfo &&
strlen(
cert->lpszIssuerInfo) > 1,
"expected a non-empty issuer name\n");
6776 ok(!
cert->lpszSignatureAlgName,
"unexpected signature algorithm name\n");
6777 ok(!
cert->lpszEncryptionAlgName,
"unexpected encryption algorithm name\n");
6778 ok(!
cert->lpszProtocolName,
"unexpected protocol name\n");
6779 ok(
cert->dwKeySize != 0xdeadbeef,
"unexpected key size\n");
6794 ok(
size == 1,
"unexpected size: %u\n",
size);
6801 ok(
size == 1,
"unexpected size: %u\n",
size);
6802 ok(
buf[0] == 0x55,
"unexpected byte: %02x\n",
buf[0]);
6820 win_skip(
"Unexpected cert errors %u, skipping security flags tests\n",
req_error);
6917 ok(
res,
"InternetSetOption(INTERNET_OPTION_END_BROWSER_SESSION) failed: %u\n",
GetLastError());
6922 ok(ses !=
NULL,
"InternetOpen failed\n");
6924 pInternetSetStatusCallbackA(ses, &
callback);
6936 ok(req !=
NULL,
"HttpOpenRequest failed\n");
6990 static const WCHAR gizmo5[] = {
'G',
'i',
'z',
'm',
'o',
'5',0};
6991 static const WCHAR testsite[] = {
't',
'e',
's',
't',
'.',
'w',
'i',
'n',
'e',
'h',
'q',
'.',
'o',
'r',
'g',0};
6992 static const WCHAR get[] = {
'G',
'E',
'T',0};
6993 static const WCHAR testpage[] = {
'/',
't',
'e',
's',
't',
's',
'/',
'h',
'e',
'l',
'l',
'o',
'.',
'h',
't',
'm',
'l',0};
6998 char certstr1[512], certstr2[512];
7002 ok(ses !=
NULL,
"InternetOpen failed\n");
7007 ok(con !=
NULL,
"InternetConnect failed\n");
7011 ok(req !=
NULL,
"HttpOpenRequest failed\n");
7019 win_skip(
"Cannot connect to https.\n");
7041 certificate_structW, &
size);
7048 "expected a non-empty subject name\n");
7051 "expected a non-empty issuer name\n");
7053 "unexpected signature algorithm name\n");
7055 "unexpected encryption algorithm name\n");
7057 "unexpected protocol name\n");
7058 ok(certificate_structA->
dwKeySize,
"expected a non-zero key size\n");
7064 size =
sizeof(certstr1);
7069 size2 =
sizeof(certstr2);
7073 ok(
size == size2,
"expected same size\n");
7074 ok(!
strcmp(certstr1, certstr2),
"expected same string\n");
7082 ok(ses !=
NULL,
"InternetOpen failed\n");
7087 ok(con !=
NULL,
"InternetConnect failed\n");
7091 ok(req !=
NULL,
"HttpOpenRequest failed\n");
7107 certificate_structA, &
size);
7113 "expected a non-empty subject name\n");
7116 "expected a non-empty issuer name\n");
7118 "unexpected signature algorithm name\n");
7120 "unexpected encryption algorithm name\n");
7122 "unexpected protocol name\n");
7123 ok(certificate_structA->
dwKeySize,
"expected a non-zero key size\n");
7138 certificate_structW, &
size);
7145 "expected a non-empty subject name\n");
7148 "expected a non-empty issuer name\n");
7150 "unexpected signature algorithm name\n");
7152 "unexpected encryption algorithm name\n");
7154 "unexpected protocol name\n");
7155 ok(certificate_structA->
dwKeySize,
"expected a non-zero key size\n");
7174 ok(ses !=
NULL,
"InternetOpen failed\n");
7177 ok(con !=
NULL,
"InternetConnect failed\n");
7180 ok(req !=
NULL,
"HttpOpenRequest failed\n");
7185 ok(!
ret,
"HttpQueryInfo succeeded\n");
7189 ok(
ret,
"HttpAddRequestHeaders succeeded\n");
7194 ok(
ret,
"HttpQueryInfo failed\n");
7199 ok(req !=
NULL,
"HttpOpenRequest failed\n");
7204 ok(!
ret,
"HttpQueryInfo succeeded\n");
7208 ok(
ret,
"HttpAddRequestHeaders failed\n");
7214 ok(!
strcmp(
buffer,
"audio/*, image/*, text/*"),
"got '%s' expected 'audio/*, image/*, text/*'\n",
buffer);
7224 static const char *
types[] = { (
const char *)6240,
"*/*",
"%p",
"", (
const char *)0xffffffff,
"*/*",
NULL };
7267 trace(
"request handle: 0x%08lx\n",
result->dwResult);
7299 ok(
ret,
"InternetSetOption(INTERNET_OPTION_END_BROWSER_SESSION) failed: %u\n",
GetLastError());
7313 ok(ses !=
NULL,
"InternetOpen failed\n");
7318 ok(!
ret,
"InternetSetOptionA succeeded\n");
7323 ok(!
ret,
"InternetSetOptionA failed\n");
7326 pInternetSetStatusCallbackW(ses,
cb);
7339 "expected INTERNET_HANDLE_TYPE_HTTP_REQUEST, got %u\n",
type);
7344 ok(
size > 0,
"expected size > 0\n");
7390 BOOL status_ok, function_ok;
7408 ok(buflen ==
sizeof(*ar),
"unexpected buflen = %d\n", buflen);
7426 i < info->
count - 1 &&
7571 "Public ID=codeweavers"
7598 static const char *
accept[2] = {
"*/*",
NULL};
7601 trace(
"Async HttpSendRequestEx test (%s %s)\n", nd->
method, nd->
host);
7613 ok( ses !=
NULL,
"InternetOpen failed\n" );
7632 b.lpcszHeader =
"Content-Type: application/x-www-form-urlencoded";
7633 b.dwHeadersLength =
strlen(
b.lpcszHeader );
7644 skip(
"WaitForSingleObject returned %d, assuming DNS problem\n",
error);
7659 "expected ERROR_INTERNET_INCORRECT_HANDLE_STATE got %u\n",
error );
7669 ok( written ==
size,
"expected %u got %u\n", written,
size );
7676 ok( !
ret,
"HttpEndRequestA succeeded\n" );
7685 ok( !
ret,
"HttpEndRequestA succeeded\n" );
7706 LPVOID lpvStatusInformation,
DWORD dwStatusInformationLength)
7712 trace(
"closetest_callback %p: %d\n", hInternet, dwInternetStatus);
7715 "Unexpected hInternet %p\n", hInternet);
7722 "InternetQueryOptionA(%p INTERNET_OPTION_HANDLE_TYPE) failed: %x %u, expected TRUE ERROR_INVALID_HANDLE\n",
7745 "Asynchronous HttpSendRequest NOT returning 0 with error ERROR_IO_PENDING\n");
7752 trace(
"Closed session handle\n");
7765 "InternetQueryOptionA(%p INTERNET_OPTION_REQUEST_FLAGS) failed: %x %u, expected TRUE ERROR_INVALID_HANDLE\n",
7780 ok(!
ret,
"unexpected success\n");
7809 ok(!
ret,
"HttpSendRequest succeeded\n");
7832 win_skip(
"Can't make https connection\n");
7860 ok(!
strcmp(
buffer,
"test.winehq.org:443"),
"Expected test.winehg.org:443, got '%s'\n",
buffer);
7876#define STATUS_STRING(status) status_string[status] = #status
7925 ok(
strstr(
buf,
"winetest: winetest" ) !=
NULL,
"header missing\n" );
7938 ok( ses !=
NULL,
"InternetOpenA failed\n" );
7947 pInternetSetStatusCallbackA( req,
header_cb );
7952 ok( !
ret,
"HttpSendRequestA succeeded\n" );
7972 ok( ses !=
NULL,
"InternetOpenA failed\n" );
7981 size =
sizeof(actual);
7983 memset( actual, 0x55,
sizeof(actual) );
7987 ok(
size == 0,
"unexpected size: %u\n",
size );
7988 ok( actual[0] == 0x55,
"unexpected byte: %02x\n", actual[0] );
8001 win_skip(
"Skipping wininet:http due to hang ROSTESTS-357\n");
8008 win_skip(
"Too old IE (older than 6.0)\n");
8012 pInternetSetStatusCallbackA = (
void*)
GetProcAddress(
hdll,
"InternetSetStatusCallbackA");
8013 pInternetSetStatusCallbackW = (
void*)
GetProcAddress(
hdll,
"InternetSetStatusCallbackW");
8014 pInternetGetSecurityInfoByURLA = (
void*)
GetProcAddress(
hdll,
"InternetGetSecurityInfoByURLA");
8016 if(!pInternetGetSecurityInfoByURLA) {
8018 win_skip(
"IE6 found. It's too old for some tests.\n");
int strcmp(const char *String1, const char *String2)
char * strstr(char *String1, char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
ULONG WSAAPI inet_addr(IN CONST CHAR FAR *cp)
static unsigned char bytes[4]
static struct sockaddr_in sa
#define InterlockedDecrement
void get(int argc, const char *argv[])
#define RegCloseKey(hKey)
static const WCHAR proxy_enable[]
static const WCHAR internet_settings[]
#define ERROR_INSUFFICIENT_BUFFER
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
VOID WINAPI CertFreeCertificateChain(PCCERT_CHAIN_CONTEXT pChainContext)
static const WCHAR empty[]
#define ERROR_INVALID_PARAMETER
#define INVALID_SET_FILE_POINTER
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define HeapFree(x, y, z)
#define ERROR_INVALID_HANDLE
#define FILE_ATTRIBUTE_NORMAL
#define MultiByteToWideChar
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
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)
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
LANGID WINAPI GetUserDefaultLangID(void)
#define INTERNET_MAX_URL_LENGTH
BOOL WINAPI HttpEndRequestA(HINTERNET hRequest, LPINTERNET_BUFFERSA lpBuffersOut, DWORD dwFlags, DWORD_PTR dwContext)
BOOL WINAPI HttpAddRequestHeadersA(HINTERNET hHttpRequest, LPCSTR lpszHeader, DWORD dwHeaderLength, DWORD dwModifier)
HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession, LPCSTR lpszVerb, LPCSTR lpszObjectName, LPCSTR lpszVersion, LPCSTR lpszReferrer, LPCSTR *lpszAcceptTypes, DWORD dwFlags, DWORD_PTR dwContext)
BOOL WINAPI HttpSendRequestW(HINTERNET hHttpRequest, LPCWSTR lpszHeaders, DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength)
BOOL WINAPI HttpQueryInfoA(HINTERNET hHttpRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex)
BOOL WINAPI HttpQueryInfoW(HINTERNET hHttpRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex)
BOOL WINAPI HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength)
BOOL WINAPI HttpSendRequestExA(HINTERNET hRequest, LPINTERNET_BUFFERSA lpBuffersIn, LPINTERNET_BUFFERSA lpBuffersOut, DWORD dwFlags, DWORD_PTR dwContext)
HINTERNET WINAPI HttpOpenRequestW(HINTERNET hHttpSession, LPCWSTR lpszVerb, LPCWSTR lpszObjectName, LPCWSTR lpszVersion, LPCWSTR lpszReferrer, LPCWSTR *lpszAcceptTypes, DWORD dwFlags, DWORD_PTR dwContext)
BOOL WINAPI InternetQueryOptionW(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength)
BOOL WINAPI InternetWriteFile(HINTERNET hFile, LPCVOID lpBuffer, DWORD dwNumOfBytesToWrite, LPDWORD lpdwNumOfBytesWritten)
BOOL WINAPI InternetQueryOptionA(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength)
BOOL WINAPI InternetLockRequestFile(HINTERNET hInternet, HANDLE *lphLockReqHandle)
BOOL WINAPI InternetReadFileExW(HINTERNET hFile, LPINTERNET_BUFFERSW lpBuffer, DWORD dwFlags, DWORD_PTR dwContext)
BOOL WINAPI InternetUnlockRequestFile(HANDLE hLockHandle)
BOOL WINAPI InternetCanonicalizeUrlA(LPCSTR lpszUrl, LPSTR lpszBuffer, LPDWORD lpdwBufferLength, DWORD dwFlags)
DWORD WINAPI InternetSetFilePointer(HINTERNET hFile, LONG lDistanceToMove, PVOID pReserved, DWORD dwMoveContext, DWORD_PTR dwContext)
BOOL WINAPI InternetReadFile(HINTERNET hFile, LPVOID lpBuffer, DWORD dwNumOfBytesToRead, LPDWORD pdwNumOfBytesRead)
HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType, LPCSTR lpszProxy, LPCSTR lpszProxyBypass, DWORD dwFlags)
BOOL WINAPI InternetSetOptionA(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength)
HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl, LPCSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
BOOL WINAPI InternetReadFileExA(HINTERNET hFile, LPINTERNET_BUFFERSA lpBuffersOut, DWORD dwFlags, DWORD_PTR dwContext)
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
BOOL WINAPI InternetQueryDataAvailable(HINTERNET hFile, LPDWORD lpdwNumberOfBytesAvailable, DWORD dwFlags, DWORD_PTR dwContext)
HINTERNET WINAPI InternetConnectA(HINTERNET hInternet, LPCSTR lpszServerName, INTERNET_PORT nServerPort, LPCSTR lpszUserName, LPCSTR lpszPassword, DWORD dwService, DWORD dwFlags, DWORD_PTR dwContext)
HINTERNET WINAPI InternetConnectW(HINTERNET hInternet, LPCWSTR lpszServerName, INTERNET_PORT nServerPort, LPCWSTR lpszUserName, LPCWSTR lpszPassword, DWORD dwService, DWORD dwFlags, DWORD_PTR dwContext)
HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength)
BOOL WINAPI DeleteUrlCacheEntryA(LPCSTR lpszUrlName)
BOOL WINAPI CreateUrlCacheEntryA(LPCSTR lpszUrlName, DWORD dwExpectedFileSize, LPCSTR lpszFileExtension, LPSTR lpszFileName, DWORD dwReserved)
BOOL WINAPI CommitUrlCacheEntryA(LPCSTR lpszUrlName, LPCSTR lpszLocalFileName, FILETIME ExpireTime, FILETIME LastModifiedTime, DWORD CacheEntryType, LPBYTE lpHeaderInfo, DWORD dwHeaderSize, LPCSTR lpszFileExtension, LPCSTR lpszOriginalUrl)
INT WSAAPI recvfrom(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags, OUT LPSOCKADDR from, IN OUT INT FAR *fromlen)
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
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
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
HLOCAL NTAPI LocalFree(HLOCAL hMem)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
#define memcpy(s1, s2, n)
#define ERROR_FILE_NOT_FOUND
static struct test_info tests[]
#define sprintf(buf, format,...)
static IPrintDialogCallback callback
static const char * strw(LPCWSTR x)
static HMODULE MODULEINFO DWORD cb
static HINSTANCE hkernel32
#define todo_wine_if(is_todo)
static const CHAR post_data[]
static BOOL test_redirect
static void test_http_connection(void)
#define CHECK_EXPECT(status)
static void test_basic_auth_credentials_different(int port)
static const struct notification async_send_request_ex_test[]
static const char okmsg2[]
#define _SECURITY_FLAG_CERT_REV_FAILED
static int optional[MAX_INTERNET_STATUS]
static void _test_status_code(unsigned line, HINTERNET req, DWORD excode, BOOL is_todo)
static void _readex_expect_sync_data(unsigned line, HINTERNET req, DWORD flags, INTERNET_BUFFERSW *buf, DWORD buf_size, const char *exdata, DWORD expect_receive)
static void _read_expect_sync_data_len(unsigned line, HINTERNET req, void *buf, DWORD buf_size, const char *exdata, DWORD len)
static const char ok_with_length2[]
static HINTERNET closetest_session
static void test_connection_header(int port)
static void test_request_content_length(int port)
static void server_send_string(const char *msg)
#define async_query_data_available(a, b)
static int notified[MAX_INTERNET_STATUS]
static void test_proxy_direct(int port)
static HANDLE conn_wait_event
static const char expandcontmsg[]
static DWORD _expect_data_available(unsigned line, HINTERNET req, int exsize)
static void _readex_expect_async(unsigned line, HINTERNET req, DWORD flags, INTERNET_BUFFERSW *buf, DWORD buf_size, const char *exdata)
static DWORD CALLBACK server_thread(LPVOID param)
static void WINAPI header_cb(HINTERNET handle, DWORD_PTR ctx, DWORD status, LPVOID info, DWORD len)
static void HttpSendRequestEx_test(void)
#define test_http_version(a)
static HANDLE complete_event
#define test_secflags_option(a, b, c)
static const char okmsg[]
static const char largemsg[]
static void _send_response_ex_and_wait(unsigned line, const char *response, BOOL close_connection, INTERNET_BUFFERSW *buf, const char *exdata, DWORD expected_req_error, DWORD expected_receive_size)
static void _test_security_info(unsigned line, const char *urlc, DWORD error, DWORD ex_flags)
static void test_basic_auth_credentials_end_session(int port)
static BOOL https_support
static CRITICAL_SECTION notification_cs
#define test_request_flags_todo(a, b)
static void setup_test(struct info *info, enum api function, unsigned int line, DWORD expect_result)
static void test_no_cache(int port)
static void test_basic_auth_credentials_reuse(int port)
static void test_no_content(int port)
#define SET_WINE_ALLOW(status)
static const struct notification async_send_request_ex_resolve_failure_test[]
static void _open_simple_request(unsigned line, test_request_t *req, const char *host, int port, const char *verb, const char *url)
#define receive_simple_request(a, b, c)
static const char noauthmsg2[]
static void release_cert_info(INTERNET_CERTIFICATE_INFOA *info)
static void test_cookie_header(int port)
static HANDLE conn_close_event
#define test_request_flags(a, b)
static const char noauthmsg[]
#define send_response_and_wait(a, b, c, d, e, f, g, h)
static void open_read_test_request(int port, test_request_t *req, const char *response)
static void test_remove_dot_segments(int port)
static void read_expect_async(HINTERNET req, void *buf, DWORD buf_size, DWORD *ret_size, const char *exdata)
static void _send_response_and_wait(unsigned line, const char *response, BOOL do_close_connection, void *buf, DWORD *ret_size, const char *exdata, DWORD expected_size, DWORD expected_req_error, DWORD expected_receive_size)
static void test_connection_break(int port)
#define MAX_INTERNET_STATUS
static void _server_read_request(unsigned line, const char *expected_request)
static const http_status_test_t http_status_tests[]
#define STATUS_STRING(status)
static void test_secure_connection(void)
static void test_proxy_indirect(int port)
static void test_connection_closing(int port)
static const char notokmsg[]
#define CHECK_NOTIFIED(status)
static const char page1[]
static void test_response_without_headers(int port)
static void test_concurrent_header_access(void)
static void test_basic_authentication(int port)
#define send_response_ex_and_wait(a, b, c, d, e, f)
static int strcmp_wa(LPCWSTR strw, const char *stra)
static HINTERNET closetest_req
static const char garbagemsg[]
#define CLEAR_NOTIFIED(status)
static void WINAPI closetest_callback(HINTERNET hInternet, DWORD_PTR dwContext, DWORD dwInternetStatus, LPVOID lpvStatusInformation, DWORD dwStatusInformationLength)
static void _close_request(unsigned line, test_request_t *req)
static const char ok_with_length[]
static BOOL closetest_closed
static int test_cache_gzip
static void test_header_override(int port)
static void init_status_tests(void)
static void test_cert_struct(HINTERNET req, const cert_struct_test_t *test)
static INTERNET_STATUS_CALLBACK
#define set_secflags(a, b, c)
static void init_events(void)
static void _test_http_version(unsigned line, HINTERNET req)
static void test_http_cache(void)
static void test_cache_control_verb(int port)
static void test_open_url_async(void)
static void test_large_content(int port)
#define SET_OPTIONAL(status)
static BOOL first_connection_to_test_url
#define expect_data_available(a, b)
#define CHECK_NOTIFIED2(status, num)
#define read_expect_sync_data(a, b, c, d)
static void InternetReadFile_chunked_test(void)
static void test_basic_auth_credentials_cached_manual(int port)
static void send_socket_request(test_request_t *req, BOOL new_connection)
#define test_request_url(a, b)
static void test_user_agent_header(void)
static const char * status_string[MAX_INTERNET_STATUS]
#define server_read_request(a)
static const char okmsg_cookie_path[]
static void _async_query_data_available(unsigned line, HINTERNET req, DWORD *size)
static void InternetOpenUrlA_test(void)
static void test_head_request(int port)
static void test_header_handling_order(int port)
#define open_simple_request(a, b, c, d, e)
static void test_async_read(int port)
#define CHECK_NOT_NOTIFIED(status)
static const cert_struct_test_t test_winehq_org_cert
static void test_basic_request(int port, const char *verb, const char *url)
static DWORD received_response_size
static void reset_events(void)
static void InternetOpenRequest_test(void)
static void test_async_HttpSendRequestEx(const struct notification_data *nd)
static void HttpHeaders_test(void)
static void CALLBACK check_notification(HINTERNET handle, DWORD_PTR context, DWORD status, LPVOID buffer, DWORD buflen)
static void test_InternetCloseHandle(void)
static void test_persistent_connection(int port)
static const struct notification async_send_request_ex_chunked_test[]
static void test_successive_HttpSendRequest(int port)
static DWORD _receive_simple_request(unsigned line, HINTERNET req, char *buf, size_t buf_size)
static void close_connection(void)
static void test_HttpSendRequestW(int port)
#define test_security_info(a, b, c)
static const char * send_buffer
static void test_basic_auth_credentials_manual(int port)
static void test_default_service_port(void)
static void test_cache_read_gzipped(int port)
static void test_cert_struct_string(HINTERNET req, const INTERNET_CERTIFICATE_INFOA *info)
static void _test_request_flags(unsigned line, HINTERNET req, DWORD exflags, BOOL is_todo)
static void close_async_handle(HINTERNET handle, int handle_cnt)
static int wine_allow[MAX_INTERNET_STATUS]
static void _test_secflags_option(unsigned line, HINTERNET req, DWORD ex_flags, DWORD opt_flags)
static void test_premature_disconnect(int port)
static void _test_request_url(unsigned line, HINTERNET req, const char *expected_url)
static const char okmsg201[]
static void test_cache_read(void)
static const char * cert_string_fmt
static void test_HttpQueryInfo(int port)
static void InternetLockRequestFile_test(void)
static void test_connection_failure(void)
#define test_status_code(a, b)
#define SET_OPTIONAL2(status, num)
static HANDLE request_sent_event
#define readex_expect_sync_data(a, b, c, d, e, f)
static void test_http_status(int port)
static const struct notification async_send_request_ex_test2[]
static HANDLE server_req_rec_event
static void open_socket_request(int port, test_request_t *req, const char *verb)
static const char contmsg[]
static void test_bogus_accept_types_array(void)
static HINTERNET closetest_conn
static void WINAPI readex_callback(HINTERNET handle, DWORD_PTR context, DWORD status, void *info, DWORD info_size)
static void InternetReadFileExA_test(int flags)
static const cert_struct_test_t test_winehq_com_cert
static void _read_expect_sync_data(unsigned line, HINTERNET req, void *buf, DWORD buf_size, const char *exdata)
#define SET_EXPECT2(status, num)
static void test_http_read(int port)
static int expect[MAX_INTERNET_STATUS]
static void test_cert_string(void)
#define readex_expect_async(a, b, c, d, e)
static void test_accept_encoding(int port)
static void InternetReadFile_test(int flags, const test_data_t *test)
static BOOL skip_receive_notification_tests
static const char proxymsg[]
static BOOL proxy_active(void)
static void test_invalid_response_headers(int port)
static void test_conn_close(int port)
static DWORD64 content_length
static void test_options(int port)
static void _readex_expect_sync_data_len(unsigned line, HINTERNET req, DWORD flags, INTERNET_BUFFERSW *buf, DWORD buf_size, const char *exdata, DWORD len, DWORD expect_receive)
static int close_handle_cnt
#define _SECURITY_FLAG_CERT_INVALID_CA
static void free_events(void)
static void _set_secflags(unsigned line, HINTERNET req, BOOL use_undoc, DWORD flags)
static void test_security_flags(void)
#define SET_EXPECT(status)
static const char okmsg_cookie[]
static PCCERT_CHAIN_CONTEXT DWORD *static BOOL is_lang_english(void)
static void send_response_len_and_wait(unsigned len, BOOL close_connection, INTERNET_BUFFERSW *buf)
static void test_long_url(void)
#define server_read_data(a)
#define LOCALE_USER_DEFAULT
static unsigned int file_size
TCHAR file_path[MAX_PATH]
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)
wchar_t const *const size_t const buffer_size
LPSTR lpszSignatureAlgName
LPSTR lpszEncryptionAlgName
struct _INTERNET_BUFFERSA * Next
const char * response_text
const struct notification * test
const struct notification * test
const char * redirected_url
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)
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)
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
struct _LARGE_INTEGER::@2379 u
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
DWORD WINAPI GetLastError(void)
DWORD WINAPI GetCurrentThreadId(void)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define ERROR_SHARING_VIOLATION
static const char nocontentmsg[]
#define HTTP_STATUS_BAD_REQUEST
#define SECURITY_FLAG_SECURE
#define INTERNET_DEFAULT_HTTP_PORT
#define SECURITY_FLAG_STRENGTH_STRONG
#define SECURITY_FLAG_IGNORE_UNKNOWN_CA
#define SECURITY_FLAG_IGNORE_CERT_CN_INVALID
#define INTERNET_DEFAULT_HTTPS_PORT
BOOL WINAPI InternetSetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName, LPCSTR lpCookieData)
#define HTTP_ADDREQ_FLAG_REPLACE
#define INTERNET_FLAG_FROM_CACHE
#define INTERNET_STATUS_RECEIVING_RESPONSE
#define INTERNET_ERROR_MASK_COMBINED_SEC_CERT
#define INTERNET_OPTION_SECURITY_FLAGS
#define INTERNET_OPTION_PROXY_PASSWORD
#define HTTP_QUERY_SET_COOKIE
#define INTERNET_HANDLE_TYPE_HTTP_REQUEST
#define INTERNET_STATUS_CONNECTION_CLOSED
#define HTTP_QUERY_PROXY_AUTHENTICATE
#define INTERNET_FLAG_RELOAD
#define ERROR_INTERNET_INVALID_URL
#define INTERNET_STATUS_STATE_CHANGE
#define INTERNET_FLAG_RESYNCHRONIZE
#define INTERNET_OPTION_PROXY_USERNAME
#define ERROR_INTERNET_OPERATION_CANCELLED
#define HTTP_QUERY_FLAG_SYSTEMTIME
#define HTTP_QUERY_ACCEPT
#define INTERNET_FLAG_ASYNC
#define HTTP_QUERY_RAW_HEADERS_CRLF
#define INTERNET_STATUS_REQUEST_SENT
#define INTERNET_FLAG_KEEP_CONNECTION
#define INTERNET_STATUS_COOKIE_RECEIVED
#define INTERNET_STATUS_USER_INPUT_REQUIRED
#define HTTP_QUERY_STATUS_TEXT
#define INTERNET_OPTION_USER_AGENT
#define HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON
#define HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA
#define ERROR_INTERNET_ITEM_NOT_FOUND
#define INTERNET_OPTION_PASSWORD
#define ERROR_INTERNET_SECURITY_CHANNEL_ERROR
#define HTTP_QUERY_USER_AGENT
#define INTERNET_STATUS_SENDING_REQUEST
#define INTERNET_OPTION_DATAFILE_NAME
#define INTERNET_STATUS_PREFETCH
#define INTERNET_ERROR_MASK_LOGIN_FAILURE_DISPLAY_ENTITY_BODY
#define HTTP_QUERY_VERSION
#define HTTP_QUERY_FLAG_NUMBER
#define INTERNET_STATUS_HANDLE_CLOSING
#define ERROR_INTERNET_INVALID_CA
#define ERROR_INTERNET_OPTION_NOT_SETTABLE
#define HTTP_QUERY_FORWARDED
#define INTERNET_FLAG_NEED_FILE
#define INTERNET_STATUS_RESOLVING_NAME
#define INTERNET_FLAG_NO_CACHE_WRITE
#define INTERNET_FLAG_TRANSFER_BINARY
#define NORMAL_CACHE_ENTRY
#define INTERNET_STATUS_INTERMEDIATE_RESPONSE
#define INTERNET_FLAG_SECURE
#define HTTP_ADDREQ_FLAG_ADD
#define INTERNET_OPTION_URL
#define HTTP_QUERY_ACCEPT_RANGES
#define HTTP_QUERY_CONTENT_TYPE
#define INTERNET_REQFLAG_NO_HEADERS
struct _INTERNET_BUFFERSA INTERNET_BUFFERSA
#define INTERNET_STATUS_RESPONSE_RECEIVED
#define INTERNET_OPEN_TYPE_DIRECT
#define INTERNET_STATUS_REDIRECT
#define HTTP_QUERY_COOKIE
#define INTERNET_OPTION_PROXY
#define INTERNET_STATUS_REQUEST_COMPLETE
#define INTERNET_STATUS_CONNECTING_TO_SERVER
#define HTTP_QUERY_AUTHORIZATION
#define ERROR_INTERNET_INCORRECT_HANDLE_STATE
#define INTERNET_MAX_PATH_LENGTH
#define ERROR_INTERNET_INVALID_OPERATION
#define INTERNET_OPEN_TYPE_PROXY
#define HTTP_QUERY_TRANSFER_ENCODING
#define INTERNET_INVALID_PORT_NUMBER
#define INTERNET_STATUS_HANDLE_CREATED
#define INTERNET_STATUS_COOKIE_HISTORY
#define HTTP_ADDREQ_FLAG_COALESCE
#define HTTP_QUERY_STATUS_CODE
#define INTERNET_OPEN_TYPE_PRECONFIG
#define INTERNET_STATUS_COOKIE_SENT
#define HTTP_QUERY_RAW_HEADERS
#define SECURITY_FLAG_IGNORE_REVOCATION
#define HTTP_QUERY_CONTENT_ENCODING
#define INTERNET_OPTION_ERROR_MASK
#define HTTP_QUERY_CUSTOM
#define ERROR_INTERNET_INVALID_OPTION
#define ERROR_HTTP_INVALID_SERVER_RESPONSE
#define INTERNET_HANDLE_TYPE_CONNECT_HTTP
#define ERROR_INTERNET_CANNOT_CONNECT
#define HTTP_QUERY_SERVER
#define INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT
#define INTERNET_OPTION_HTTP_VERSION
#define ERROR_HTTP_INVALID_QUERY_REQUEST
#define HTTP_ADDREQ_FLAG_ADD_IF_NEW
#define ERROR_INTERNET_NAME_NOT_RESOLVED
#define ERROR_HTTP_INVALID_HEADER
#define INTERNET_STATUS_CONNECTED_TO_SERVER
#define INTERNET_OPTION_CONTEXT_VALUE
#define INTERNET_STATUS_NAME_RESOLVED
#define INTERNET_OPTION_HANDLE_TYPE
#define INTERNET_FLAG_FORMS_SUBMIT
#define INTERNET_OPTION_SECURITY_CERTIFICATE
#define INTERNET_STATUS_CTL_RESPONSE_RECEIVED
#define ERROR_INTERNET_INCORRECT_HANDLE_TYPE
#define HTTP_QUERY_FLAG_REQUEST_HEADERS
#define INTERNET_STATUS_P3P_HEADER
#define ERROR_INTERNET_SEC_CERT_ERRORS
#define INTERNET_STATUS_CLOSING_CONNECTION
#define INTERNET_OPTION_USERNAME
#define INTERNET_OPTION_HTTP_DECODING
#define INTERNET_STATUS_PRIVACY_IMPACTED
#define INTERNET_OPTION_DIAGNOSTIC_SOCKET_INFO
#define INTERNET_OPTION_SETTINGS_CHANGED
#define ERROR_HTTP_HEADER_NOT_FOUND
#define INTERNET_OPTION_END_BROWSER_SESSION
#define INTERNET_STATUS_DETECTING_PROXY
#define HTTP_QUERY_CONTENT_LENGTH
#define INTERNET_OPTION_CALLBACK
#define INTERNET_SERVICE_HTTP
#define INTERNET_OPTION_REQUEST_FLAGS
#define INTERNET_STATUS_P3P_POLICYREF
#define HKEY_CURRENT_USER