26#define _WIN32_WINNT 0x0600
30#define WIN32_NO_STATUS
44#define WSA_CMSG_ALIGN(len) (((len) + sizeof(SIZE_T) - 1) & ~(sizeof(SIZE_T) - 1))
50#define TEST_TIMEOUT 30
53#define NUM_UDP_PEERS 3
56#define NUM_QUERIES 250
58#define SERVERIP "127.0.0.1"
59#define SERVERPORT 9374
61#define wsa_ok(op, cond, msg) \
65 if ( !(cond tmp) ) err = WSAGetLastError(); \
66 ok ( cond tmp, msg, GetCurrentThreadId(), err); \
69#define make_keepalive(k, enable, time, interval) \
71 k.keepalivetime = time; \
72 k.keepaliveinterval = interval;
348 (
LPVOID) &optval,
sizeof (optval) ) == 0,
349 "setting SO_OPENTYPE failed\n" );
352 "getting SO_OPENTYPE failed\n" );
353 ok ( optval == newval,
"failed to set SO_OPENTYPE\n" );
362static void fill_buffer (
char *
buf,
int chunk_size,
int n_chunks )
375 for (
i = 0;
i < chunk_size;
i++ )
376 if (
p[
i] !=
c )
return i;
389 while ( ( tmp =
recv (
s,
buf, 256, 0 ) ) > 0 )
391 ok (
n <= 0,
"garbage data received: %d bytes\n",
n );
403 wsa_ok (
n, 0 <=,
"do_synchronous_send (%x): error %d\n" );
416 wsa_ok (
n, 0 <=,
"do_synchronous_recv (%x): error %d:\n" );
429 wsa_ok (
n, 0 <=,
"do_synchronous_recv (%x): error %d:\n" );
442 ok ( tmp == 0,
"check_so_opentype: wrong startup value of SO_OPENTYPE: %d\n", tmp );
447 for (;
a &&
b ;
a =
a->ai_next,
b =
b->ai_next)
449 ok(
a->ai_flags ==
b->ai_flags,
450 "Wrong flags %d != %d\n",
a->ai_flags,
b->ai_flags);
451 ok(
a->ai_family ==
b->ai_family,
452 "Wrong family %d != %d\n",
a->ai_family,
b->ai_family);
453 ok(
a->ai_socktype ==
b->ai_socktype,
454 "Wrong socktype %d != %d\n",
a->ai_socktype,
b->ai_socktype);
455 ok(
a->ai_protocol ==
b->ai_protocol,
456 "Wrong protocol %d != %d\n",
a->ai_protocol,
b->ai_protocol);
457 ok(
a->ai_addrlen ==
b->ai_addrlen,
458 "Wrong addrlen %lu != %lu\n",
a->ai_addrlen,
b->ai_addrlen);
460 "Wrong address data\n");
461 if (
a->ai_canonname &&
b->ai_canonname)
463 ok(!
strcmp(
a->ai_canonname,
b->ai_canonname),
"Wrong canonical name '%s' != '%s'\n",
464 a->ai_canonname,
b->ai_canonname);
467 ok(!
a->ai_canonname && !
b->ai_canonname,
"Expected both names absent (%p != %p)\n",
468 a->ai_canonname,
b->ai_canonname);
470 ok(!
a && !
b,
"Expected both addresses null (%p != %p)\n",
a,
b);
475 for (;
a &&
b ;
a =
a->ai_next,
b =
b->ai_next)
477 ok(
a->ai_flags ==
b->ai_flags,
478 "Wrong flags %d != %d\n",
a->ai_flags,
b->ai_flags);
479 ok(
a->ai_family ==
b->ai_family,
480 "Wrong family %d != %d\n",
a->ai_family,
b->ai_family);
481 ok(
a->ai_socktype ==
b->ai_socktype,
482 "Wrong socktype %d != %d\n",
a->ai_socktype,
b->ai_socktype);
483 ok(
a->ai_protocol ==
b->ai_protocol,
484 "Wrong protocol %d != %d\n",
a->ai_protocol,
b->ai_protocol);
485 ok(
a->ai_addrlen ==
b->ai_addrlen,
486 "Wrong addrlen %lu != %lu\n",
a->ai_addrlen,
b->ai_addrlen);
488 "Wrong address data\n");
489 if (
a->ai_canonname &&
b->ai_canonname)
491 ok(!
lstrcmpW(
a->ai_canonname,
b->ai_canonname),
"Wrong canonical name '%s' != '%s'\n",
495 ok(!
a->ai_canonname && !
b->ai_canonname,
"Expected both names absent (%p != %p)\n",
496 a->ai_canonname,
b->ai_canonname);
498 ok(!
a && !
b,
"Expected both addresses null (%p != %p)\n",
a,
b);
516 trace (
"address in use, waiting ...\n" );
519 ok (
err == 0,
"failed to bind: %d\n", wsaerr );
541 mem->sock[
i].n_recvd = 0;
542 mem->sock[
i].n_sent = 0;
615 trace (
"simple_server (%x) starting\n",
id );
624 trace (
"simple_server (%x) ready\n",
id );
629 trace (
"simple_server (%x): waiting for client\n",
id );
632 tmp =
sizeof (
mem->sock[0].peer );
637 "simple_server (%x): strange peer address\n",
id );
641 ok ( n_recvd == n_expected,
642 "simple_server (%x): received less data than expected: %d of %d\n",
id, n_recvd, n_expected );
644 ok (
pos == -1,
"simple_server (%x): test pattern error: %d\n",
id,
pos);
648 ok ( n_sent == n_expected,
649 "simple_server (%x): sent less data than expected: %d of %d\n",
id, n_sent, n_expected );
657 trace (
"simple_server (%x) exiting\n",
id );
672 trace (
"oob_server (%x) starting\n",
id );
681 trace (
"oob_server (%x) ready\n",
id );
684 trace (
"oob_server (%x): waiting for client\n",
id );
687 tmp =
sizeof (
mem->sock[0].peer );
692 "oob_server (%x): strange peer address\n",
id );
696 ok ( atmark == 1,
"oob_server (%x): unexpectedly at the OOB mark: %i\n",
id, atmark );
700 ok ( n_recvd == n_expected,
701 "oob_server (%x): received less data than expected: %d of %d\n",
id, n_recvd, n_expected );
703 ok (
pos == -1,
"oob_server (%x): test pattern error: %d\n",
id,
pos);
707 ok ( atmark == 1,
"oob_server (%x): unexpectedly at the OOB mark: %i\n",
id, atmark );
711 ok ( n_sent == n_expected,
712 "oob_server (%x): sent less data than expected: %d of %d\n",
id, n_sent, n_expected );
717 "oob_server (%x): received less data than expected: %d of %d\n",
id, n_recvd, 8 );
721 trace(
"oob_server (%x): %s the OOB mark: %i\n",
id, atmark == 1 ?
"not at" :
"at", atmark );
727 todo_wine ok ( atmark == 0,
"oob_server (%x): not at the OOB mark: %i\n",
id, atmark );
733 trace (
"oob_server (%x) exiting\n",
id );
746 n_set, delta, n_ready;
748 fd_set fds_recv, fds_send, fds_openrecv, fds_opensend;
750 trace (
"select_server (%x) starting\n",
id );
759 trace (
"select_server (%x) ready\n",
id );
771 fds_recv = fds_openrecv;
772 fds_send = fds_opensend;
777 "select_server (%x): select() failed: %d\n" );
783 trace (
"select_server (%x): accepting client connection\n",
id );
786 tmp =
sizeof (
mem->sock[n_connections].peer );
791 "select_server (%x): strange peer address\n",
id );
794 FD_SET (
mem->sock[n_connections].s, &fds_openrecv );
795 FD_SET (
mem->sock[n_connections].s, &fds_opensend );
802 for (
i = 0;
i < n_connections;
i++ )
807 if (
mem->sock[
i].n_recvd < n_expected ) {
811 mem->sock[
i].n_recvd += n_recvd;
813 if (
mem->sock[
i].n_recvd == n_expected ) {
815 ok (
pos == -1,
"select_server (%x): test pattern error: %d\n",
id,
pos );
819 ok (
mem->sock[
i].n_recvd <= n_expected,
"select_server (%x): received too many bytes: %d\n",
id,
mem->sock[
i].n_recvd );
824 delta =
mem->sock[
i].n_recvd -
mem->sock[
i].n_sent;
829 if ( ( delta > 0 ) && (
mem->sock[
i].n_sent < n_expected ) ) {
833 mem->sock[
i].n_sent += n_sent;
835 if (
mem->sock[
i].n_sent == n_expected ) {
839 ok (
mem->sock[
i].n_sent <= n_expected,
"select_server (%x): sent too many bytes: %d\n",
id,
mem->sock[
i].n_sent );
845 ok ( ( n_set == n_ready ),
"select_server (%x): select() returns wrong number of ready sockets\n",
id );
863 trace (
"select_server (%x) exiting\n",
id );
879 trace (
"simple_client (%x): starting\n",
id );
882 trace (
"simple_client (%x): server ready\n",
id );
891 0 ==,
"simple_client (%x): connect error: %d\n" );
893 "simple_client (%x): failed to set blocking mode\n",
id );
894 trace (
"simple_client (%x) connected\n",
id );
898 ok ( n_sent == n_expected,
899 "simple_client (%x): sent less data than expected: %d of %d\n",
id, n_sent, n_expected );
906 ok ( n_recvd == n_expected,
907 "simple_client (%x): received less data than expected: %d of %d\n",
id, n_recvd, n_expected );
911 ok (
pos == -1,
"simple_client (%x): test pattern error: %d\n",
id,
pos);
915 trace (
"simple_client (%x) exiting\n",
id );
929 trace (
"oob_client (%x): starting\n",
id );
932 trace (
"oob_client (%x): server ready\n",
id );
941 0 ==,
"oob_client (%x): connect error: %d\n" );
943 "oob_client (%x): failed to set blocking mode\n",
id );
944 trace (
"oob_client (%x) connected\n",
id );
948 ok ( n_sent == n_expected,
949 "oob_client (%x): sent less data than expected: %d of %d\n",
id, n_sent, n_expected );
953 ok ( n_recvd == n_expected,
954 "simple_client (%x): received less data than expected: %d of %d\n",
id, n_recvd, n_expected );
956 ok (
pos == -1,
"simple_client (%x): test pattern error: %d\n",
id,
pos);
960 ok ( n_sent == n_expected,
961 "oob_client (%x): sent less data than expected: %d of %d\n",
id, n_sent, n_expected );
968 trace (
"oob_client (%x) exiting\n",
id );
980 int fromLen =
sizeof(
mem->addr);
984 trace (
"simple_client (%x): starting\n",
id );
987 trace (
"simple_client (%x): server ready\n",
id );
996 0 ==,
"simple_client (%x): connect error: %d\n" );
998 "simple_client (%x): failed to set blocking mode\n",
id );
999 trace (
"simple_client (%x) connected\n",
id );
1003 ok ( n_sent == n_expected,
1004 "simple_client (%x): sent less data than expected: %d of %d\n",
id, n_sent, n_expected );
1022 ok ( n_recvd == n_expected,
1023 "simple_client (%x): received less data than expected: %d of %d\n",
id, n_recvd, n_expected );
1029 "0.0.0.0"),
"lpFrom shouldn't be updated on connection oriented sockets\n");
1033 ok (
pos == -1,
"simple_client (%x): test pattern error: %d\n",
id,
pos);
1037 trace (
"simple_client (%x) exiting\n",
id );
1052 char *send_last, *recv_last, *send_p, *recv_p;
1055 trace (
"event_client (%x): starting\n",
id );
1057 trace (
"event_client (%x): server ready\n",
id );
1069 ok ( tmp ==
WAIT_OBJECT_0,
"event_client (%x): wait for connect event failed: %d\n",
id, tmp );
1071 ok (
err == 0,
"event_client (%x): WSAEnumNetworkEvents error: %d\n",
id,
err );
1073 ok (
err == 0,
"event_client (%x): connect error: %d\n",
id,
err );
1077 trace (
"event_client (%x) connected\n",
id );
1081 recv_p =
mem->recv_buf;
1082 recv_last =
mem->recv_buf + n_expected;
1083 send_p =
mem->send_buf;
1084 send_last =
mem->send_buf + n_expected;
1092 ok(
err == 0,
"event_client (%x): WSAEnumNetworkEvents error: %d\n",
id,
err );
1097 ok (
err == 0,
"event_client (%x): FD_WRITE error code: %d\n",
id,
err );
1111 while (
n >= 0 && send_p < send_last );
1113 if ( send_p == send_last )
1115 trace (
"event_client (%x): all data sent - shutdown\n",
id );
1124 ok (
err == 0,
"event_client (%x): FD_READ error code: %d\n",
id,
err );
1125 if (
err != 0 )
break;
1129 wsa_ok (
n, 0 <=,
"event_client (%x): recv error: %d\n" );
1133 if ( recv_p == recv_last )
1136 trace (
"event_client (%x): all data received\n",
id );
1142 ok ( 0,
"event_client (%x): read error: %d\n",
id,
err );
1148 trace (
"event_client (%x): close event\n",
id );
1150 ok (
err == 0,
"event_client (%x): FD_CLOSE error code: %d\n",
id,
err );
1155 n = send_p -
mem->send_buf;
1156 ok ( send_p == send_last,
1157 "simple_client (%x): sent less data than expected: %d of %d\n",
id,
n, n_expected );
1158 n = recv_p -
mem->recv_buf;
1159 ok ( recv_p == recv_last,
1160 "simple_client (%x): received less data than expected: %d of %d\n",
id,
n, n_expected );
1162 ok (
n == -1,
"event_client (%x): test pattern error: %d\n",
id,
n);
1166 trace (
"event_client (%x) exiting\n",
id );
1200 ok(
res == 0,
"WSAStartup() failed unexpectedly: %d\n",
res);
1206 for (socks = 0; socks <
sizeof(pairs) /
sizeof(pairs[0]); socks++)
1213 "WSADuplicateSocketA should have worked\n");
1219 "WSADuplicateSocketA should have worked\n");
1230 ok(
res == 0,
"WSAStartup() failed unexpectedly: %d\n",
res);
1246 for (
i = 0;
i < socks;
i++)
1248 for (
j = 0;
j < 4;
j++)
1251 int size =
sizeof(saddr);
1254 case 0:
sock = pairs[
i].src;
break;
1255 case 1:
sock = pairs[
i].dup_src;
break;
1256 case 2:
sock = pairs[
i].dst;
break;
1257 case 3:
sock = pairs[
i].dup_dst;
break;
1269 for (
i = 0;
i < socks;
i++)
1278 ok(
res == 0,
"expected 0, got %d\n",
res);
1283 "WSACleanup returned %d WSAGetLastError is %d\n",
res,
error);
1288static void Init (
void)
1296 pFreeAddrInfoW = (
void *)
GetProcAddress(hws2_32,
"FreeAddrInfoW");
1297 pFreeAddrInfoExW = (
void *)
GetProcAddress(hws2_32,
"FreeAddrInfoExW");
1299 pGetAddrInfoExW = (
void *)
GetProcAddress(hws2_32,
"GetAddrInfoExW");
1300 pGetAddrInfoExOverlappedResult = (
void *)
GetProcAddress(hws2_32,
"GetAddrInfoExOverlappedResult");
1305 pWSALookupServiceBeginW = (
void *)
GetProcAddress(hws2_32,
"WSALookupServiceBeginW");
1306 pWSALookupServiceEnd = (
void *)
GetProcAddress(hws2_32,
"WSALookupServiceEnd");
1307 pWSALookupServiceNextW = (
void *)
GetProcAddress(hws2_32,
"WSALookupServiceNextW");
1308 pWSAEnumNameSpaceProvidersA = (
void *)
GetProcAddress(hws2_32,
"WSAEnumNameSpaceProvidersA");
1309 pWSAEnumNameSpaceProvidersW = (
void *)
GetProcAddress(hws2_32,
"WSAEnumNameSpaceProvidersW");
1315 pGetIpForwardTable = (
void *)
GetProcAddress(hiphlpapi,
"GetIpForwardTable");
1316 pGetAdaptersInfo = (
void *)
GetProcAddress(hiphlpapi,
"GetAdaptersInfo");
1323 pNtSetInformationFile = (
void *)
GetProcAddress(ntdll,
"NtSetInformationFile");
1324 pNtQueryInformationFile = (
void *)
GetProcAddress(ntdll,
"NtQueryInformationFile");
1331static void Exit (
void)
1337 ok (
ret == 0,
"WSACleanup failed ret = %d GetLastError is %d\n",
ret,
err);
1345 ok (
thread[0] !=
NULL,
"Failed to create server thread\n" );
1357 ok (
thread[
i] !=
NULL,
"Failed to create client thread\n" );
1369 for (
i = 0;
i <=
n;
i++)
1378 "some threads have not completed: %x\n", wait );
1382 for (
i = 0;
i <=
n;
i++)
1392 for (
i = 0;
i <=
n;
i++)
1406#define SOCKTIMEOUT1 63000
1408#define SOCKTIMEOUT2 997000
1413 int i,
err, lasterr;
1454 ok(
timeout == 0,
"getsockopt(SO_RCVTIMEO) returned wrong value %d\n",
timeout);
1487 size =
sizeof(lingval);
1496 ,
"getsockopt(SO_LINGER #%d) returned wrong value %d,%d not %d,%d\n",
i,
1497 lingval.l_onoff, lingval.l_linger,
1501 size =
sizeof(lingval);
1521 "instead of failing.\n");
1523 ok(lasterr ==
WSAEFAULT,
"setsockopt with optval being a value "
1524 "returned 0x%08x, not WSAEFAULT(0x%08x)\n",
1533 "got %d with %d (expected SOCKET_ERROR with WSAEINVAL)\n",
1540 "got %d with %d (expected SOCKET_ERROR with WSAEINVAL)\n",
1549 "got %d with %d (expected 0 with 0)\n",
1557 "got %d with %d (expected 0 with 0)\n",
1560 ok (
i == 1234,
"got %d (expected 1234)\n",
i);
1568 "got %d with %d (expected SOCKET_ERROR with WSAEFAULT)\n",
1579 "got %d with %d (expected SOCKET_ERROR with WSAENOTSOCK)\n",
1581 ok (
i == 1234,
"expected 1234, got %d\n",
i);
1591 for (
i = 0;
i < 4;
i++)
1594 const int tests[] = {0xffffff0a, 0xffff000b, 0xff00000c, 0x0000000d};
1596 ok(!
err,
"Test [%d] Expected 0, got %d\n",
i,
err);
1598 ok(!
err,
"Test [%d] Expected 0, got %d\n",
i,
err);
1600 ok(
k ==
j,
"Test [%d] Expected 0x%x, got 0x%x\n",
i,
j,
k);
1604 win_skip(
"IP_MULTICAST_TTL is unsupported\n");
1609 "getsockopt should have failed\n");
1614 "getsockopt should have failed\n");
1620 "getsockopt should have failed\n");
1624 "getsockopt should have failed\n");
1628 "getsockopt should have failed\n");
1633 "getsockopt should have failed\n");
1645 for (
i = 0;
i <
sizeof(prottest) /
sizeof(prottest[0]);
i++)
1656 infoA.szProtocol[0] = 0;
1662 infoW.szProtocol[0] = 0;
1668 trace(
"provider name '%s', family %d, type %d, proto %d\n",
1669 infoA.szProtocol, prottest[
i].family, prottest[
i].type, prottest[
i].proto);
1671 ok(
infoA.szProtocol[0],
"WSAPROTOCOL_INFOA was not filled\n");
1672 ok(
infoW.szProtocol[0],
"WSAPROTOCOL_INFOW was not filled\n");
1675 providername,
sizeof(providername),
NULL,
NULL);
1677 "different provider names '%s' != '%s'\n",
infoA.szProtocol, providername);
1680 "SO_PROTOCOL_INFO[A/W] comparison failed\n");
1684 ok(
infoA.iAddressFamily == prottest[
i].family,
"socket family invalid, expected %d received %d\n",
1685 prottest[
i].family,
infoA.iAddressFamily);
1686 ok(
infoA.iSocketType == prottest[
i].type,
"socket type invalid, expected %d received %d\n",
1687 prottest[
i].type,
infoA.iSocketType);
1688 ok(
infoA.iProtocol == prottest[
i].proto,
"socket protocol invalid, expected %d received %d\n",
1689 prottest[
i].proto,
infoA.iProtocol);
1703 ok(
err == -1,
"Expected -1, got %d\n",
err);
1705 ok(
k == 99,
"Expected 99, got %d\n",
k);
1712 ok(
err == -1,
"Expected -1, got %d\n",
err);
1718 ok(
err == -1,
"Expected -1, got %d\n",
err);
1720 ok(
k == 99,
"Expected 99, got %d\n",
k);
1730 ok(
err == 0,
"Expected 0, got %d\n",
err);
1731 ok(
k == 1,
"Expected 1, got %d\n",
k);
1736 ok(
err == -1,
"Expected -1, got %d\n",
err);
1738 ok(
k == 0,
"Expected 0, got %d\n",
k);
1743 ok(
err == 0,
"Expected 0, got %d\n",
err);
1749 ok(
err == 0,
"Expected 0, got %d\n",
err);
1750 ok(
k == 0,
"Expected 0, got %d\n",
k);
1755 ok(
err == -1,
"Expected -1, got %d\n",
err);
1757 ok(
k == 0,
"Expected 0, got %d\n",
k);
1771 size =
sizeof(csinfoA);
1776 memset(&saddr, 0,
sizeof(saddr));
1781 ok(!csinfoA.cs.LocalAddr.iSockaddrLength,
"Expected 0, got %d\n", csinfoA.cs.LocalAddr.iSockaddrLength);
1782 ok(csinfoA.cs.LocalAddr.lpSockaddr ==
NULL,
"Expected NULL, got %p\n", csinfoA.cs.LocalAddr.lpSockaddr);
1784 ok(!csinfoA.cs.RemoteAddr.iSockaddrLength,
"Expected 0, got %d\n", csinfoA.cs.RemoteAddr.iSockaddrLength);
1785 ok(csinfoA.cs.RemoteAddr.lpSockaddr ==
NULL,
"Expected NULL, got %p\n", csinfoA.cs.RemoteAddr.lpSockaddr);
1788 ok(!
err,
"Expected 0, got %d\n",
err);
1789 size =
sizeof(csinfoA);
1791 ok(!
err,
"Expected 0, got %d\n",
err);
1794 ok(csinfoA.cs.LocalAddr.iSockaddrLength,
"Expected non-zero\n");
1795 ok(csinfoA.cs.LocalAddr.lpSockaddr !=
NULL,
"Expected non-null\n");
1797 ok(!csinfoA.cs.RemoteAddr.iSockaddrLength,
"Expected 0, got %d\n", csinfoA.cs.RemoteAddr.iSockaddrLength);
1798 ok(csinfoA.cs.RemoteAddr.lpSockaddr ==
NULL,
"Expected NULL, got %p\n", csinfoA.cs.RemoteAddr.lpSockaddr);
1801 ok(!
err,
"Expected 0, got %d\n",
err);
1803 ok(!
err,
"Expected 0, got %d\n",
err);
1805 ok(!
err,
"Expected 0, got %d\n",
err);
1807 ok(!
err,
"Expected 0, got %d\n",
err);
1808 size =
sizeof(saddr);
1814 size =
sizeof(csinfoA);
1816 ok(!
err,
"Expected 0, got %d\n",
err);
1818 ok(!
err,
"Expected 0, got %d\n",
err);
1819 ok(
size ==
sizeof(csinfoA),
"Got %d\n",
size);
1820 size =
sizeof(saddr);
1821 ok(
size == csinfoA.cs.LocalAddr.iSockaddrLength,
"Expected %d, got %d\n",
size,
1822 csinfoA.cs.LocalAddr.iSockaddrLength);
1823 ok(
size == csinfoA.cs.RemoteAddr.iSockaddrLength,
"Expected %d, got %d\n",
size,
1824 csinfoA.cs.RemoteAddr.iSockaddrLength);
1825 ok(!
memcmp(csinfoA.cs.LocalAddr.lpSockaddr, csinfoB.cs.RemoteAddr.lpSockaddr,
size),
1826 "Expected matching addresses\n");
1827 ok(!
memcmp(csinfoB.cs.LocalAddr.lpSockaddr, csinfoA.cs.RemoteAddr.lpSockaddr,
size),
1828 "Expected matching addresses\n");
1829 ok(csinfoA.cs.iSocketType ==
SOCK_STREAM,
"Wrong socket type\n");
1830 ok(csinfoB.cs.iSocketType ==
SOCK_STREAM,
"Wrong socket type\n");
1831 ok(csinfoA.cs.iProtocol ==
IPPROTO_TCP,
"Wrong socket protocol\n");
1832 ok(csinfoB.cs.iProtocol ==
IPPROTO_TCP,
"Wrong socket protocol\n");
1835 ok(!
err,
"Expected 0, got %d\n",
err);
1836 ok(!
memcmp(&saddr, csinfoA.cs.RemoteAddr.lpSockaddr,
size),
"Expected matching addresses\n");
1837 ok(!
memcmp(&saddr, csinfoB.cs.LocalAddr.lpSockaddr,
size),
"Expected matching addresses\n");
1839 ok(!
err,
"Expected 0, got %d\n",
err);
1840 ok(!
memcmp(&saddr, csinfoB.cs.RemoteAddr.lpSockaddr,
size),
"Expected matching addresses\n");
1841 ok(!
memcmp(&saddr, csinfoA.cs.LocalAddr.lpSockaddr,
size),
"Expected matching addresses\n");
1843 ok(!
err,
"Expected 0, got %d\n",
err);
1844 ok(!
memcmp(&saddr, csinfoA.cs.LocalAddr.lpSockaddr,
size),
"Expected matching addresses\n");
1845 ok(!
memcmp(&saddr, csinfoB.cs.RemoteAddr.lpSockaddr,
size),
"Expected matching addresses\n");
1847 ok(!
err,
"Expected 0, got %d\n",
err);
1848 ok(!
memcmp(&saddr, csinfoB.cs.LocalAddr.lpSockaddr,
size),
"Expected matching addresses\n");
1849 ok(!
memcmp(&saddr, csinfoA.cs.RemoteAddr.lpSockaddr,
size),
"Expected matching addresses\n");
1854 ok(
err,
"Expected non-zero\n");
1859 size =
sizeof(*csinfoA.cs.LocalAddr.lpSockaddr) * 2 +
sizeof(csinfoA.cs);
1861 ok(!
err,
"Expected 0, got %d\n",
err);
1865 ok(
err,
"Expected non-zero\n");
1874 for (
i = 0;
i < 2;
i++)
1881 level = IPPROTO_IPV6;
1892 skip(
"IPv6 is not supported\n");
1930 unsigned int rc,reuse;
1949 ok(rc==0 && reuse==0,
"wrong result in getsockopt(SO_REUSEADDR): rc=%d reuse=%d\n",rc,reuse);
1965 trace(
"<= Win XP behavior of SO_REUSEADDR\n");
1979 size =
sizeof(saddr);
1983 ok(s4 !=
INVALID_SOCKET,
"none of the listening sockets could get the connection\n");
1991 trace(
">= Win 2003 behavior of SO_REUSEADDR\n");
2003#define IP_PKTINFO_LEN (sizeof(WSACMSGHDR) + WSA_CMSG_ALIGN(sizeof(struct in_pktinfo)))
2008 char recvbuf[10],
pktbuf[512],
msg[] =
"HELLO";
2010 GUID WSARecvMsg_GUID = WSAID_WSARECVMSG;
2011 LPFN_WSARECVMSG pWSARecvMsg =
NULL;
2012 unsigned int rc,
yes = 1;
2023 memset(&ov, 0,
sizeof(ov));
2027 skip(
"Could not create event object, some tests will be skipped. errno = %d\n",
GetLastError());
2035 iovec[0].buf = recvbuf;
2036 iovec[0].len =
sizeof(recvbuf);
2038 hdr.namelen =
sizeof(s3addr);
2040 hdr.dwBufferCount = 1;
2045 for (
i=0;
i<
sizeof(addresses)/
sizeof(
UINT32);
i++)
2059 &pWSARecvMsg,
sizeof(pWSARecvMsg), &dwBytes,
NULL,
NULL);
2062 win_skip(
"WSARecvMsg is unsupported, some tests will be skipped.\n");
2071 ok(rc == 0,
"failed to set IPPROTO_IP flag IP_PKTINFO!\n");
2074 addrlen =
sizeof(s2addr);
2081 s2addr.sin_addr.s_addr = addresses[0];
2103 hdr.Control.len = 1;
2107 "WSARecvMsg() failed error: %d (ret: %d, flags: %d)\n",
err, rc,
hdr.dwFlags);
2111 hdr.Control.len = 1;
2121 skip(
"Server side did not receive packet, some tests skipped.\n");
2129 "WSAGetOverlappedResult() returned unexpected flags %d!\n",
dwFlags);
2131 "WSARecvMsg() overlapped operation set unexpected flags %d.\n",
hdr.dwFlags);
2143 "WSARecvMsg() control length mismatch (%d != sizeof pktbuf).\n",
hdr.Control.len);
2148 skip(
"Server side did not receive packet, some tests skipped.\n");
2156 "WSARecvMsg() buffer length does not match transmitted data!\n");
2158 "WSARecvMsg() buffer does not match transmitted data!\n");
2160 "WSARecvMsg() control length mismatch (%d).\n",
hdr.Control.len);
2170 ok(
pi->ipi_addr.s_addr == s2addr.sin_addr.s_addr,
"destination ip mismatch!\n");
2174 ok(foundhdr,
"IP_PKTINFO header information was not returned!\n");
2186#define STD_STREAM_SOCKET \
2329 ok (
peer[
i].
addr.sin_port !=
htons ( 0 ),
"UDP: bind() did not associate port\n" );
2339 ok (
n_sent ==
sizeof(
buf),
"UDP: sendto() sent wrong amount of data or socket error: %d\n",
n_sent );
2344 ok ( n_recv ==
sizeof(
buf),
"UDP: recvfrom() received wrong amount of data or socket error: %d\n", n_recv );
2345 ok (
memcmp ( &
peer[0].
peer.sin_port,
buf,
sizeof(
peer[0].addr.sin_port) ) == 0,
"UDP: port numbers do not match\n" );
2355 } serv[2] = { {
"domain",
"udp", 53}, {
"telnet",
"tcp", 23} };
2362 "test_getservbyname: timeout waiting for start signal\n" );
2365 for (
j = 0;
j < 2;
j++) {
2370 for (
j = 0;
j < 2;
j++ ) {
2373 "getservbyname could not retrieve information for %s: %d\n", serv[
j].
name,
WSAGetLastError() );
2374 if ( !pserv[
j] )
continue;
2376 "getservbyname returned the wrong port for %s: %d\n", serv[
j].
name,
ntohs(pserv[
j]->
s_port) );
2378 "getservbyname returned the wrong protocol for %s: %s\n", serv[
j].
name, pserv[
j]->
s_proto );
2380 "getservbyname returned the wrong name for %s: %s\n", serv[
j].
name, pserv[
j]->
s_name );
2383 ok ( pserv[0] == pserv[1] ||
broken(pserv[0] != pserv[1]) ,
2384 "getservbyname: winsock resized servent buffer when not necessary\n" );
2422 "WSASocketA should have failed\n");
2436 "WSASocketA should have failed\n");
2442 "WSASocketA should have failed\n");
2448 "WSASocketA should have failed\n");
2454 "WSASocketA should have failed\n");
2460 "WSASocketA should have failed\n");
2466 "WSASocketA should have failed\n");
2472 "WSASocketA should have failed\n");
2482 "WSASocketA should have failed\n");
2488 "WSASocketA should have failed\n");
2494 "WSASocketA should have failed\n");
2500 "WSASocketA should have failed\n");
2511 "WSASocketA should have failed\n");
2518 "WSASocketA should have failed\n");
2530 ok(
err ==
WSAENOBUFS,
"WSAEnumProtocolsA error is %d, not WSAENOBUFS(%d)\n",
2534 ok(
pi !=
NULL,
"Failed to allocate memory\n");
2536 skip(
"Can't continue without memory.\n");
2545 skip(
"No protocols enumerated.\n");
2557 pi[0].iProtocol = -1;
2558 pi[0].iSocketType = -1;
2559 pi[0].iAddressFamily = -1;
2561 "WSASocketA should have failed\n");
2565 pi[0].iProtocol = 0;
2566 pi[0].iSocketType = 0;
2567 pi[0].iAddressFamily = 0;
2571 win_skip(
"must work only in OS <= 2003\n");
2586 size =
sizeof(socktype);
2590 ok(socktype ==
SOCK_DGRAM,
"Wrong socket type, expected %d received %d\n",
2597 size =
sizeof(socktype);
2601 ok(socktype ==
SOCK_STREAM,
"Wrong socket type, expected %d received %d\n",
2612 ok(
err ==
WSAENOBUFS,
"WSAEnumProtocolsA error is %d, not WSAENOBUFS(%d)\n",
2616 ok(
pi !=
NULL,
"Failed to allocate memory\n");
2618 skip(
"Can't continue without memory.\n");
2633 size =
sizeof(socktype);
2641 ok(socktype ==
pi[
i].iSocketType,
"Wrong socket type, expected %d received %d\n",
2642 pi[
i].iSocketType, socktype);
2646 ok(
i !=
items,
"Creating a socket without protocol and socket type didn't work\n");
2651 for (
i = 0;
i <
sizeof(autoprotocols) /
sizeof(autoprotocols[0]);
i++)
2657 size =
sizeof(socktype);
2664 if (
pi[
j].iProtocol == autoprotocols[
i])
2666 if (socktype ==
pi[
j].iSocketType)
2669 ok(0,
"Wrong socket type, expected %d received %d\n",
2670 pi[
j].iSocketType, socktype);
2674 ok(!
err,
"Protocol %d not found in WSAEnumProtocols\n", autoprotocols[
i]);
2689 skip(
"SOCK_RAW is not supported\n");
2693 trace(
"SOCK_RAW is supported\n");
2695 size =
sizeof(socktype);
2699 ok(socktype ==
SOCK_RAW,
"Wrong socket type, expected %d received %d\n",
2707 size =
sizeof(socktype);
2711 ok(socktype ==
SOCK_RAW,
"Wrong socket type, expected %d received %d\n",
2719 size =
sizeof(socktype);
2723 ok(socktype ==
SOCK_RAW,
"Wrong socket type, expected %d received %d\n",
2737 skip(
"IPX is not supported\n");
2744 trace(
"IPX is supported\n");
2750 size =
sizeof(socktype);
2754 ok(socktype ==
SOCK_DGRAM,
"Wrong socket type, expected %d received %d\n",
2763 ok(
info.iAddressFamily ==
AF_IPX,
"expected family %d, received %d\n",
2772 "WSASocketA should have failed\n");
2778 for(
i = 0;
i <= 255;
i += 17)
2789 ok(socktype ==
i,
"Wrong IPX packet type, expected %d received %d\n",
2803 int socktype,
size, addrsize,
ret;
2804 char teststr[] =
"TEST",
buffer[16];
2817 "WSADuplicateSocketA should have failed\n");
2823 "WSADuplicateSocketA should have failed\n");
2829 "WSADuplicateSocketA should have failed\n");
2835 "WSADuplicateSocketA should have failed\n");
2842 "WSADuplicateSocketA should have worked\n");
2846 ok(
info.iAddressFamily ==
AF_INET,
"expected family %d, received %d\n",
2864 "WSADuplicateSocketA should have worked\n");
2868 ok(
info.iAddressFamily ==
AF_INET,
"expected family %d, received %d\n",
2877 "bind should have worked\n");
2881 addrsize =
sizeof(
addr);
2883 "getsockname should have worked\n");
2884 ok(
addr.sin_port,
"socket port should be != 0\n");
2892 ok(socktype ==
SOCK_DGRAM,
"Wrong socket type, expected %d received %d\n",
2898 addrsize =
sizeof(
addr);
2903 addrsize =
sizeof(
addr);
2907 buffer[
sizeof(teststr) - 1] = 0;
2920 "WSADuplicateSocketA should have worked\n");
2929 "bind should have worked\n");
2933 addrsize =
sizeof(
addr);
2935 "getsockname should have worked\n");
2936 ok(
addr.sin_port,
"socket port should be != 0\n");
2940 addrsize =
sizeof(
addr);
2945 addrsize =
sizeof(
addr);
2949 "recvfrom should have failed\n");
2971 for (
l = 0;
l < 2;
l++)
2973 for (
i = 0;
i <
sizeof(sock_type) /
sizeof(sock_type[0]);
i++)
2984 ok (
event !=
NULL,
"Test[%d]: failed to create event\n",
i);
2985 for (
j = 0;
j < 5;
j++)
2994 memset(&net_events, 0xAB,
sizeof(net_events));
2996 "Test[%d]: WSAEnumNetworkEvents failed\n",
i);
2997 if (
i >= 1 &&
j == 0)
3001 i, net_events.lNetworkEvents);
3007 i, net_events.lNetworkEvents);
3013 ok (net_events.
iErrorCode[
k] == 0x0,
"Test[%d][%d]: expected 0x0, got 0x%x\n",
3019 ok (net_events.
iErrorCode[
k] == 0xABABABAB,
"Test[%d][%d]: expected 0xABABABAB, got 0x%x\n",
3040 CHAR expect1[] =
"0.0.0.0";
3042 CHAR expect3[] =
"0.0.0.0:65535";
3043 CHAR expect4[] =
"255.255.255.255:65535";
3048 CHAR addr6_1[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01};
3049 CHAR addr6_2[] = {0x20,0xab,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01};
3050 CHAR addr6_3[] = {0x20,0xab,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x01};
3052 CHAR expect6_1[] =
"::1";
3053 CHAR expect6_2[] =
"20ab::1";
3054 CHAR expect6_3[] =
"[20ab::2001]:33274";
3055 CHAR expect6_3_2[] =
"[20ab::2001%4660]:33274";
3056 CHAR expect6_3_3[] =
"20ab::2001%4660";
3067 "WSAAddressToStringA() failed unexpectedly: WSAGetLastError()=%d, ret=%d\n",
3080 ok(
len ==
sizeof( expect1 ),
"Got size %d\n",
len);
3086 sockaddr.sin_addr.s_addr = 0xffffffff;
3108 sockaddr.sin_addr.s_addr = 0xffffffff;
3114 ok(
len ==
sizeof( expect4 ),
"Got size %d\n",
len);
3119 skip(
"Could not create IPv6 socket (LastError: %d; %d expected if IPv6 not available).\n",
3124 len =
sizeof(address6);
3133 ok( !
strcmp( address6, expect6_1 ),
"Expected: %s, got: %s\n", expect6_1, address6 );
3134 ok(
len ==
sizeof(expect6_1),
"Got size %d\n",
len);
3137 len =
sizeof(address6);
3140 sockaddr6.sin6_port = 0x0000;
3141 sockaddr6.sin6_scope_id = 0;
3142 memcpy (sockaddr6.sin6_addr.s6_addr, addr6_2,
sizeof(addr6_2));
3146 ok( !
strcmp( address6, expect6_2 ),
"Expected: %s, got: %s\n", expect6_2, address6 );
3147 ok(
len ==
sizeof(expect6_2),
"Got size %d\n",
len);
3150 len =
sizeof(address6);
3153 sockaddr6.sin6_port = 0xfa81;
3154 sockaddr6.sin6_scope_id = 0;
3155 memcpy (sockaddr6.sin6_addr.s6_addr, addr6_3,
sizeof(addr6_3));
3159 ok( !
strcmp( address6, expect6_3 ),
"Expected: %s, got: %s\n", expect6_3, address6 );
3160 ok(
len ==
sizeof(expect6_3),
"Got size %d\n",
len );
3163 len =
sizeof(address6);
3166 sockaddr6.sin6_port = 0xfa81;
3167 sockaddr6.sin6_scope_id = 0x1234;
3168 memcpy (sockaddr6.sin6_addr.s6_addr, addr6_3,
sizeof(addr6_3));
3172 ok( !
strcmp( address6, expect6_3_2 ),
"Expected: %s, got: %s\n", expect6_3_2, address6 );
3173 ok(
len ==
sizeof(expect6_3_2),
"Got size %d\n",
len );
3176 len =
sizeof(address6);
3179 sockaddr6.sin6_port = 0x0000;
3180 sockaddr6.sin6_scope_id = 0x1234;
3181 memcpy (sockaddr6.sin6_addr.s6_addr, addr6_3,
sizeof(addr6_3));
3185 ok( !
strcmp( address6, expect6_3_3 ),
"Expected: %s, got: %s\n", expect6_3_3, address6 );
3186 ok(
len ==
sizeof(expect6_3_3),
"Got size %d\n",
len );
3202 WCHAR expect1[] = {
'0',
'.',
'0',
'.',
'0',
'.',
'0', 0 };
3203 WCHAR expect2[] = {
'2',
'5',
'5',
'.',
'2',
'5',
'5',
'.',
'2',
'5',
'5',
'.',
'2',
'5',
'5', 0 };
3204 WCHAR expect3[] = {
'0',
'.',
'0',
'.',
'0',
'.',
'0',
':',
'6',
'5',
'5',
'3',
'5', 0 };
3205 WCHAR expect4[] = {
'2',
'5',
'5',
'.',
'2',
'5',
'5',
'.',
'2',
'5',
'5',
'.',
'2',
'5',
'5',
':',
3206 '6',
'5',
'5',
'3',
'5', 0 };
3211 CHAR addr6_1[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01};
3212 CHAR addr6_2[] = {0x20,0xab,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01};
3213 CHAR addr6_3[] = {0x20,0xab,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x01};
3215 WCHAR expect6_1[] = {
':',
':',
'1',0};
3216 WCHAR expect6_2[] = {
'2',
'0',
'a',
'b',
':',
':',
'1',0};
3217 WCHAR expect6_3[] = {
'[',
'2',
'0',
'a',
'b',
':',
':',
'2',
'0',
'0',
'1',
']',
':',
'3',
'3',
'2',
'7',
'4',0};
3218 WCHAR expect6_3_2[] = {
'[',
'2',
'0',
'a',
'b',
':',
':',
'2',
'0',
'0',
'1',
'%',
'4',
'6',
'6',
'0',
']',
':',
'3',
'3',
'2',
'7',
'4',0};
3219 WCHAR expect6_3_3[] = {
'2',
'0',
'a',
'b',
':',
':',
'2',
'0',
'0',
'1',
'%',
'6',
'5',
'5',
'3',
'4',0};
3230 "WSAAddressToStringW() failed unexpectedly: WSAGetLastError()=%d, ret=%d\n",
3243 ok(
len ==
sizeof( expect1 )/
sizeof(
WCHAR ),
"Got size %d\n",
len);
3249 sockaddr.sin_addr.s_addr = 0xffffffff;
3271 sockaddr.sin_addr.s_addr = 0xffffffff;
3277 ok(
len ==
sizeof( expect4 )/
sizeof(
WCHAR ),
"Got %d\n",
len);
3282 skip(
"Could not create IPv6 socket (LastError: %d; %d expected if IPv6 not available).\n",
3288 len =
sizeof(address6)/
sizeof(
WCHAR);
3297 ok( !
lstrcmpW( address6, expect6_1 ),
"Wrong string returned\n" );
3298 ok(
len ==
sizeof(expect6_1)/
sizeof(
WCHAR),
"Got %d\n",
len);
3301 len =
sizeof(address6)/
sizeof(
WCHAR);
3304 sockaddr6.sin6_port = 0x0000;
3305 sockaddr6.sin6_scope_id = 0;
3306 memcpy (sockaddr6.sin6_addr.s6_addr, addr6_2,
sizeof(addr6_2));
3311 ok( !
lstrcmpW( address6, expect6_2 ),
"Wrong string returned\n" );
3312 ok(
len ==
sizeof(expect6_2)/
sizeof(
WCHAR),
"Got %d\n",
len);
3315 len =
sizeof(address6)/
sizeof(
WCHAR);
3318 sockaddr6.sin6_port = 0xfa81;
3319 sockaddr6.sin6_scope_id = 0;
3320 memcpy (sockaddr6.sin6_addr.s6_addr, addr6_3,
sizeof(addr6_3));
3326 ok(
len ==
sizeof(expect6_3)/
sizeof(
WCHAR),
"Got %d\n",
len );
3329 len =
sizeof(address6)/
sizeof(
WCHAR);
3332 sockaddr6.sin6_port = 0xfa81;
3333 sockaddr6.sin6_scope_id = 0x1234;
3334 memcpy (sockaddr6.sin6_addr.s6_addr, addr6_3,
sizeof(addr6_3));
3340 ok(
len ==
sizeof(expect6_3_2)/
sizeof(
WCHAR),
"Got %d\n",
len );
3343 len =
sizeof(address6)/
sizeof(
WCHAR);
3346 sockaddr6.sin6_port = 0x0000;
3347 sockaddr6.sin6_scope_id = 0xfffe;
3348 memcpy (sockaddr6.sin6_addr.s6_addr, addr6_3,
sizeof(addr6_3));
3354 ok(
len ==
sizeof(expect6_3_3)/
sizeof(
WCHAR),
"Got %d\n",
len );
3368 CHAR address1[] =
"0.0.0.0";
3369 CHAR address2[] =
"127.127.127.127";
3370 CHAR address3[] =
"255.255.255.255";
3371 CHAR address4[] =
"127.127.127.127:65535";
3372 CHAR address5[] =
"255.255.255.255:65535";
3373 CHAR address6[] =
"::1";
3374 CHAR address7[] =
"[::1]";
3375 CHAR address8[] =
"[::1]:65535";
3376 CHAR address9[] =
"2001::1";
3391 "WSAStringToAddressA() failed unexpectedly: %d\n",
WSAGetLastError() );
3399 "WSAStringToAddressA() failed unexpectedly: %d\n",
WSAGetLastError() );
3409 "WSAStringToAddressA() failed unexpectedly: %d\n",
GLE );
3417 "WSAStringToAddressA() failed unexpectedly: %d\n",
WSAGetLastError() );
3427 "WSAStringToAddressA() failed unexpectedly: %d\n",
GLE );
3434 "WSAStringToAddressA() should have failed with %d\n",
GLE );
3436 len =
sizeof(sockaddr6);
3449 ok(
ret == 0,
"WSAStringToAddressA() failed for IPv6 address: %d\n",
GLE);
3451 len =
sizeof(sockaddr6);
3458 ok(
ret == 0,
"WSAStringToAddressA() failed for IPv6 address: %d\n",
GLE);
3460 len =
sizeof(sockaddr6);
3468 "WSAStringToAddressA() failed for IPv6 address: %d\n",
GLE);
3470 len =
sizeof(sockaddr6);
3475 "WSAStringToAddressW() should have failed with %d\n",
GLE );
3477 len =
sizeof(sockaddr6);
3482 "WSAStringToAddressW() should have failed with %d\n",
GLE );
3493 WCHAR address1[] = {
'0',
'.',
'0',
'.',
'0',
'.',
'0', 0 };
3494 WCHAR address2[] = {
'1',
'2',
'7',
'.',
'1',
'2',
'7',
'.',
'1',
'2',
'7',
'.',
'1',
'2',
'7', 0 };
3495 WCHAR address3[] = {
'2',
'5',
'5',
'.',
'2',
'5',
'5',
'.',
'2',
'5',
'5',
'.',
'2',
'5',
'5', 0 };
3496 WCHAR address4[] = {
'1',
'2',
'7',
'.',
'1',
'2',
'7',
'.',
'1',
'2',
'7',
'.',
'1',
'2',
'7',
3497 ':',
'6',
'5',
'5',
'3',
'5', 0 };
3498 WCHAR address5[] = {
'2',
'5',
'5',
'.',
'2',
'5',
'5',
'.',
'2',
'5',
'5',
'.',
'2',
'5',
'5',
':',
3499 '6',
'5',
'5',
'3',
'5', 0 };
3500 WCHAR address6[] = {
':',
':',
'1',
'\0'};
3501 WCHAR address7[] = {
'[',
':',
':',
'1',
']',
'\0'};
3502 WCHAR address8[] = {
'[',
':',
':',
'1',
']',
':',
'6',
'5',
'5',
'3',
'5',
'\0'};
3503 WCHAR address9[] = {
'2',
'0',
'0',
'1',
':',
':',
'1',
'\0'};
3518 "WSAStringToAddressW() failed unexpectedly: %d\n",
WSAGetLastError() );
3526 "WSAStringToAddressW() failed unexpectedly: %d\n",
WSAGetLastError() );
3536 "WSAStringToAddressW() failed unexpectedly: %d\n",
GLE );
3544 "WSAStringToAddressW() failed unexpectedly: %d\n",
WSAGetLastError() );
3553 "WSAStringToAddressW() failed unexpectedly: %d\n",
GLE );
3559 sin->sin_addr.s_addr = 0;
3562 ok( (
ret == 0 &&
sin->sin_addr.s_addr == 0xffffffff &&
sin->sin_port == 0xffff) ||
3564 "WSAStringToAddressW() failed unexpectedly: %d\n",
GLE );
3572 "WSAStringToAddressW() should have failed with %d\n",
GLE );
3574 len =
sizeof(sockaddr6);
3587 ok(
ret == 0,
"WSAStringToAddressW() failed for IPv6 address: %d\n",
GLE);
3589 len =
sizeof(sockaddr6);
3596 ok(
ret == 0,
"WSAStringToAddressW() failed for IPv6 address: %d\n",
GLE);
3598 len =
sizeof(sockaddr6);
3606 "WSAStringToAddressW() failed for IPv6 address: %d\n",
GLE);
3608 len =
sizeof(sockaddr6);
3613 "WSAStringToAddressW() should have failed with %d\n",
GLE );
3615 len =
sizeof(sockaddr6);
3620 "WSAStringToAddressW() should have failed with %d\n",
GLE );
3629 struct timeval select_timeout;
3631 memset(&readfds, 0,
sizeof(readfds));
3667 memset(&SockAddr, 0,
sizeof(SockAddr));
3688 ok( (
ret == 0),
"expected 0 (timeout), got: %d\n",
ret );
3698 int ret, acceptc, olen =
sizeof(acceptc);
3747 ok (!
ret,
"getsockopt failed\n");
3748 ok (acceptc == 0,
"SO_ACCEPTCONN should be 0, received %d\n", acceptc);
3750 ok (!
listen(fdA, 0),
"listen failed\n");
3755 ok (!
ret,
"getsockopt failed\n");
3756 ok (acceptc == 1,
"SO_ACCEPTCONN should be 1, received %d\n", acceptc);
3764 ok (
ret == 0,
"closesocket failed unexpectedly: %d\n",
ret);
3775 ok (
ret == 0,
"closesocket failed unexpectedly: %d\n",
ret);
3777 ok (
ret == 0,
"closesocket failed unexpectedly: %d\n",
ret);
3780#define FD_ZERO_ALL() { FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds); }
3781#define FD_SET_ALL(s) { FD_SET(s, &readfds); FD_SET(s, &writefds); FD_SET(s, &exceptfds); }
3784 static char tmp_buf[1024];
3786 SOCKET fdListen, fdRead, fdWrite;
3787 fd_set readfds, writefds, exceptfds;
3791 struct timeval select_timeout;
3803 if (fdWrite > maxfd)
3813 ret =
select(maxfd+1, &readfds, &writefds, &exceptfds, &select_timeout);
3815 ok(
ret == 0,
"select should not return any socket handles\n");
3816 ok(ticks < 10,
"select was blocking for %u ms, expected < 10 ms\n", ticks);
3817 ok(!
FD_ISSET(fdRead, &readfds),
"FD should not be set\n");
3818 ok(!
FD_ISSET(fdWrite, &writefds),
"FD should not be set\n");
3819 ok(!
FD_ISSET(fdRead, &exceptfds),
"FD should not be set\n");
3820 ok(!
FD_ISSET(fdWrite, &exceptfds),
"FD should not be set\n");
3828 ret =
select(maxfd+1, &readfds, &writefds, &exceptfds, &select_timeout);
3829 ok(
ret == 0,
"select should not return any socket handles\n");
3830 ok(!
FD_ISSET(fdRead, &readfds),
"FD should not be set\n");
3831 ok(!
FD_ISSET(fdWrite, &writefds),
"FD should not be set\n");
3832 ok(!
FD_ISSET(fdRead, &exceptfds),
"FD should not be set\n");
3833 ok(!
FD_ISSET(fdWrite, &exceptfds),
"FD should not be set\n");
3837 ok ( (
ret == 0),
"closesocket failed unexpectedly: %d\n",
ret);
3839 thread_params.s = fdRead;
3840 thread_params.ReadKilled =
FALSE;
3843 ok ( (thread_handle !=
NULL),
"CreateThread failed unexpectedly: %d\n",
GetLastError());
3848 ok ( (
ret == 0),
"closesocket failed unexpectedly: %d\n",
ret);
3851 ok ( thread_params.ReadKilled,
"closesocket did not wake up select\n");
3853 ok( (
ret == -1),
"peek at closed socket expected -1 got %d\n",
ret);
3859 ret =
select(maxfd+1, 0, 0, 0, &select_timeout);
3864 ret =
select(maxfd+1, &readfds, &writefds, &exceptfds, &select_timeout);
3870 ret =
select(maxfd+1, &readfds, &writefds, &exceptfds, &select_timeout);
3873 ok ( !
FD_ISSET(fdRead, &readfds),
"FD should not be set\n");
3878 ret =
select(maxfd+1, &readfds, &writefds, &exceptfds, &select_timeout);
3881 ok ( !
FD_ISSET(fdRead, &writefds),
"FD should not be set\n");
3886 ret =
select(maxfd+1, &readfds, &writefds, &exceptfds, &select_timeout);
3889 ok ( !
FD_ISSET(fdRead, &exceptfds),
"FD should not be set\n");
3893 if(fdWrite > maxfd) maxfd = fdWrite;
3896 FD_SET(fdRead, &readfds);
3898 ok(!
ret,
"select returned %d\n",
ret);
3901 FD_SET(fdWrite, &writefds);
3903 ok(
ret == 1,
"select returned %d\n",
ret);
3904 ok(
FD_ISSET(fdWrite, &writefds),
"fdWrite socket is not in the set\n");
3908 FD_SET(fdWrite, &readfds);
3909 ret =
select(fdWrite+1, &readfds, &readfds,
NULL, &select_timeout);
3910 ok(
ret == 1,
"select returned %d\n",
ret);
3911 ok(
FD_ISSET(fdWrite, &readfds),
"fdWrite socket is not in the set\n");
3914 FD_SET(fdWrite, &readfds);
3915 FD_SET(fdRead, &readfds);
3916 ret =
select(maxfd+1, &readfds, &readfds,
NULL, &select_timeout);
3917 ok(
ret == 2,
"select returned %d\n",
ret);
3918 ok(
FD_ISSET(fdWrite, &readfds),
"fdWrite socket is not in the set\n");
3919 ok(
FD_ISSET(fdRead, &readfds),
"fdRead socket is not in the set\n");
3921 ok(
send(fdWrite,
"test", 4, 0) == 4,
"failed to send data\n");
3923 FD_SET(fdRead, &readfds);
3925 ok(
ret == 1,
"select returned %d\n",
ret);
3926 ok(
FD_ISSET(fdRead, &readfds),
"fdRead socket is not in the set\n");
3929 FD_SET(fdWrite, &readfds);
3930 FD_SET(fdRead, &readfds);
3931 ret =
select(maxfd+1, &readfds, &readfds,
NULL, &select_timeout);
3932 ok(
ret == 2,
"select returned %d\n",
ret);
3933 ok(
FD_ISSET(fdWrite, &readfds),
"fdWrite socket is not in the set\n");
3934 ok(
FD_ISSET(fdRead, &readfds),
"fdRead socket is not in the set\n");
3936#if ROSTESTS_233_IS_FIXED
3939 FD_SET(fdWrite, &writefds);
3942 ok(
send(fdWrite, tmp_buf,
sizeof(tmp_buf), 0) > 0,
"failed to send data\n");
3947 FD_SET(fdWrite, &readfds);
3948 FD_SET(fdRead, &readfds);
3949 ret =
select(maxfd+1, &readfds, &readfds,
NULL, &select_timeout);
3950 ok(
ret == 1,
"select returned %d\n",
ret);
3951 ok(!
FD_ISSET(fdWrite, &readfds),
"fdWrite socket is in the set\n");
3952 ok(
FD_ISSET(fdRead, &readfds),
"fdRead socket is not in the set\n");
3954 ok(
send(fdRead,
"test", 4, 0) == 4,
"failed to send data\n");
3957 FD_SET(fdWrite, &readfds);
3958 FD_SET(fdRead, &readfds);
3959 ret =
select(maxfd+1, &readfds, &readfds,
NULL, &select_timeout);
3960 ok(
ret == 2,
"select returned %d\n",
ret);
3961 ok(
FD_ISSET(fdWrite, &readfds),
"fdWrite socket is not in the set\n");
3962 ok(
FD_ISSET(fdRead, &readfds),
"fdRead socket is not in the set\n");
3979 select_timeout.
tv_sec = 1;
3980 select_timeout.
tv_usec = 250000;
3985 ret =
select(0, &readfds, &writefds, &exceptfds, &select_timeout);
3986 ok(
ret == 0,
"expected 0, got %d\n",
ret);
3992 ret =
select(0, &readfds, &writefds, &exceptfds, &select_timeout);
3993 ok(
ret == 1,
"expected 1, got %d\n",
ret);
3994 ok(
FD_ISSET(fdListen, &readfds),
"fdListen socket is not in the set\n");
4004 ret =
select(0, &readfds, &writefds, &exceptfds, &select_timeout);
4005 ok(
ret == 2,
"expected 2, got %d\n",
ret);
4006 ok(
FD_ISSET(fdWrite, &writefds),
"fdWrite socket is not in the set\n");
4007 ok(
FD_ISSET(fdRead, &writefds),
"fdRead socket is not in the set\n");
4012 ok(
id == 0,
"expected 0, got %d\n",
id);
4015 ret =
send(fdWrite,
"1234", 4, 0);
4016 ok(
ret == 4,
"expected 4, got %d\n",
ret);
4019 FD_SET(fdRead, &readfds);
4020 FD_SET(fdRead, &exceptfds);
4021 ret =
select(0, &readfds, &writefds, &exceptfds, &select_timeout);
4022 ok(
ret == 1,
"expected 1, got %d\n",
ret);
4023 ok(
FD_ISSET(fdRead, &readfds),
"fdRead socket is not in the set\n");
4024 ret =
recv(fdRead, tmp_buf,
sizeof(tmp_buf), 0);
4025 ok(
ret == 4,
"expected 4, got %d\n",
ret);
4026 ok(!
strcmp(tmp_buf,
"1234"),
"data received differs from sent\n");
4030 ok(
ret == 1,
"expected 1, got %d\n",
ret);
4033 FD_SET(fdRead, &readfds);
4034 FD_SET(fdRead, &exceptfds);
4035 ret =
select(0, &readfds, &writefds, &exceptfds, &select_timeout);
4036 ok(
ret == 1,
"expected 1, got %d\n",
ret);
4037 ok(
FD_ISSET(fdRead, &exceptfds),
"fdRead socket is not in the set\n");
4040 ok(
ret == 1,
"expected 1, got %d\n",
ret);
4041 ok(tmp_buf[0] ==
'A',
"expected 'A', got 0x%02X\n", tmp_buf[0]);
4046 ok(
ret == 0,
"expected 0, got %d\n",
ret);
4048 ok(
ret == 1,
"expected 1, got %d\n",
ret);
4051 FD_SET(fdRead, &readfds);
4052 FD_SET(fdRead, &exceptfds);
4053 ret =
select(0, &readfds, &writefds, &exceptfds, &select_timeout);
4054 ok(
ret == 1,
"expected 1, got %d\n",
ret);
4055 ok(
FD_ISSET(fdRead, &readfds),
"fdRead socket is not in the set\n");
4061 ret =
recv(fdRead, tmp_buf,
sizeof(tmp_buf), 0);
4062 ok(
ret == 1,
"expected 1, got %d\n",
ret);
4063 ok(tmp_buf[0] ==
'A',
"expected 'A', got 0x%02X\n", tmp_buf[0]);
4067 ok(
ret == 0,
"expected 0, got %d\n",
ret);
4070 FD_SET(fdWrite, &readfds);
4071 ret =
select(0, &readfds, &writefds, &exceptfds, &select_timeout);
4072 ok(
ret == 1,
"expected 1, got %d\n",
ret);
4073 ok(
FD_ISSET(fdWrite, &readfds),
"fdWrite socket is not in the set\n");
4074 ret =
recv(fdWrite, tmp_buf,
sizeof(tmp_buf), 0);
4075 ok(
ret == 0,
"expected 0, got %d\n",
ret);
4079 ok(
ret == 0,
"expected 0, got %d\n",
ret);
4081 ok(
ret == 0,
"expected 0, got %d\n",
ret);
4085 FD_SET(fdWrite, &writefds);
4086 FD_SET(fdWrite, &exceptfds);
4087 select_timeout.
tv_sec = 2;
4088 ret =
select(0, &readfds, &writefds, &exceptfds, &select_timeout);
4089 ok(
ret == 1,
"expected 1, got %d\n",
ret);
4095 ok(
FD_ISSET(fdWrite, &exceptfds),
"fdWrite socket is not in the set\n");
4096 ok(select_timeout.
tv_usec == 250000,
"select timeout should not have changed\n");
4106 ret =
select(0, &readfds,
NULL, &exceptfds, &select_timeout);
4115#if ROSTESTS_233_IS_FIXED
4123 ret =
select(0, &readfds,
NULL, &exceptfds, &select_timeout);
4124 ok(
ret == 1,
"expected 1, got %d\n",
ret);
4125 ok(
FD_ISSET(fdWrite, &readfds),
"fdWrite socket is not in the set\n");
4133 FD_SET(fdWrite, &exceptfds);
4146 select_timeout.
tv_sec = 0;
4147 select_timeout.
tv_usec = 250000;
4152 ret =
select(0, &readfds, &writefds, &exceptfds, &select_timeout);
4153 ok(
ret == 1,
"expected 1, got %d\n",
ret);
4154 ok(
FD_ISSET(fdWrite, &writefds),
"fdWrite socket is not in the set\n");
4247 "expected 10035 or 10036, got %d\n",
error);
4258 SOCKADDR_STORAGE
ss, ss_empty;
4279 trace(
"Blocking accept next\n");
4297 if (thread_handle ==
NULL)
4313 ok(thread_params.
ReadKilled,
"closesocket did not wake up accept\n");
4329 ok(!socklen,
"got %d\n", socklen);
4347 socklen =
sizeof(
ss);
4351 ok(socklen !=
sizeof(
ss),
"unexpected length\n");
4352 ok(
ss.ss_family,
"family not set\n");
4364 ok(!socklen,
"got %d\n", socklen);
4382 socklen =
sizeof(
ss);
4386 ok(socklen !=
sizeof(
ss),
"unexpected length\n");
4387 ok(
ss.ss_family,
"family not set\n");
4397 memset(&ss_empty, 0,
sizeof(ss_empty));
4400 ok(!
memcmp(&
ss, &ss_empty,
sizeof(
ss)),
"structure is different\n");
4407 if (thread_handle !=
NULL)
4421 int optval, optlen =
sizeof(
int),
ret;
4451 ok(
ret == 0,
"getsockopt failed to query SO_MAX_MSG_SIZE, return value is 0x%08x\n",
ret);
4452 ok((optval == 65507) || (optval == 65527),
4453 "SO_MAX_MSG_SIZE reported %d, expected 65507 or 65527\n", optval);
4457 optval = 0xdeadbeef;
4458 optlen =
sizeof(
int);
4461 "got %d with %d and optval: 0x%x/%d (expected SOCKET_ERROR with WSAEINVAL)\n",
4466 optval = 0xdeadbeef;
4467 optlen =
sizeof(
int);
4470 "got %d with %d and optval: 0x%x/%d (expected SOCKET_ERROR with WSAEINVAL)\n",
4474 optval = 0xdeadbeef;
4475 optlen =
sizeof(
int);
4478 "got %d with %d and optval: 0x%x/%d (expected SOCKET_ERROR with WSAEINVAL)\n",
4482 optval = 0xdeadbeef;
4483 optlen =
sizeof(
int);
4486 "got %d with %d and optval: 0x%x/%d (expected SOCKET_ERROR with WSAEINVAL)\n",
4490 optval = 0xdeadbeef;
4491 optlen =
sizeof(
int);
4494 "got %d with %d and optval: 0x%x/%d (expected SOCKET_ERROR with WSAEINVAL)\n",
4501 "getsockopt should fail for UDP sockets setting last error to WSAENOPROTOOPT, got %d with %d\n",
4519 ok(
ret == 0,
"getsockopt failed to query SO_LINGER, return value is 0x%08x\n",
ret);
4521 optlen =
sizeof(
BOOL);
4523 ok(
ret == 0,
"getsockopt failed to query SO_DONTLINGER, return value is 0x%08x\n",
ret);
4524 ok((linger_val.
l_onoff && !bool_opt_val) || (!linger_val.
l_onoff && bool_opt_val),
4525 "Return value of SO_DONTLINGER is %d, but SO_LINGER returned l_onoff == %d.\n",
4526 bool_opt_val, linger_val.
l_onoff);
4538 int sa_get_len = sa_set_len;
4539 static const unsigned char null_padding[] = {0,0,0,0,0,0,0,0};
4548 memset(&sa_set, 0, sa_set_len);
4562 ok(0,
"getsockname on unbound socket should fail\n");
4566 ok(
memcmp(&sa_get, &sa_set,
sizeof(sa_get)) == 0,
4567 "failed getsockname modified sockaddr when it shouldn't\n");
4584 ret =
memcmp(sa_get.sin_zero, null_padding, 8);
4585 ok(
ret == 0,
"getsockname did not zero the sockaddr_in structure\n");
4590 if (
h &&
h->h_length == 4)
4593 for (
i = 0;
h->h_addr_list[
i];
i++)
4597 ip.s_addr = *(
ULONG *)
h->h_addr_list[
i];
4602 memset(&sa_set, 0,
sizeof(sa_set));
4604 sa_set.sin_addr.s_addr =
ip.s_addr;
4608 sa_get_len =
sizeof(sa_get);
4612 trace(
"testing bind on interface %s\n", ipstr);
4613 ok(sa_get.sin_addr.s_addr == sa_set.sin_addr.s_addr,
4614 "address does not match: %s != %s\n", ipstr,
inet_ntoa(sa_set.sin_addr));
4641 skip(
"Can't test the hostent structure because gethostbyname failed\n");
4651 if(
h->h_addr_list ==
addr.mem)
4653 win_skip(
"Skipping hostent tests since this OS is unsupported\n");
4658 "hostent->h_aliases should be in %p, it is in %p\n",
addr.mem,
h->h_aliases);
4660 for(
ptr =
h->h_aliases, acount = 1; *
ptr;
ptr++) acount++;
4661 addr.chr +=
sizeof(*ptr) * acount;
4662 ok(
h->h_addr_list ==
addr.mem,
4663 "hostent->h_addr_list should be in %p, it is in %p\n",
addr.mem,
h->h_addr_list);
4665 for(
ptr =
h->h_addr_list, acount = 1; *
ptr;
ptr++) acount++;
4667 addr.chr +=
sizeof(*ptr) * acount;
4668 ok(
h->h_addr_list[0] ==
addr.mem,
4669 "hostent->h_addr_list[0] should be in %p, it is in %p\n",
addr.mem,
h->h_addr_list[0]);
4683 char name[256], first_ip[16];
4687 DWORD adap_size = 0, route_size = 0;
4704 trace(
"List of local IPs:\n");
4718 ok (
count == 1,
"expected 127.0.0.1 to be the only IP returned\n");
4719 skip(
"Only the loopback address is present, skipping tests\n");
4723 if (!pGetAdaptersInfo || !pGetIpForwardTable)
4725 win_skip(
"GetAdaptersInfo and/or GetIpForwardTable not found, skipping tests\n");
4729 ret = pGetAdaptersInfo(
NULL, &adap_size);
4737 ret = pGetAdaptersInfo(adapters, &adap_size);
4739 ret = pGetIpForwardTable(routes, &route_size,
FALSE);
4745 skip(
"Only one IP is present, skipping tests\n");
4754 for (
k = adapters;
k !=
NULL;
k =
k->Next)
4761 ip =
k->IpAddressList.IpAddress.String;
4764 found_default =
TRUE;
4769 ok (found_default,
"failed to find the first IP from gethostbyname!\n");
4780 static BYTE loopback[] = {127, 0, 0, 1};
4781 static BYTE magic_loopback[] = {127, 12, 34, 56};
4788 ok(he !=
NULL,
"gethostbyname(\"localhost\") failed: %d\n",
h_errno);
4793 skip(
"h_length is %d, not IPv4, skipping test.\n", he->
h_length);
4798 "gethostbyname(\"localhost\") returned %u.%u.%u.%u\n",
4805 skip(
"hostname seems to be \"localhost\", skipping test.\n");
4815 skip(
"h_length is %d, not IPv4, skipping test.\n", he->
h_length);
4822 "gethostbyname(\"%s\") returned %u.%u.%u.%u not 127.12.34.56\n",
4841 ok(
ret == -1,
"gethostname() returned %d\n",
ret);
4854 ok(
ret == -1,
"gethostname() returned %d\n",
ret);
4855 ok(!
strcmp(
name,
"deadbeef"),
"name changed unexpected!\n");
4882 u_long addr0_Num = 0x00000000;
4883 PCSTR addr0_Str =
"0.0.0.0";
4884 u_long addr1_Num = 0x20201015;
4885 PCSTR addr1_Str =
"21.16.32.32";
4886 u_char addr2_Num[16] = {0,0,0,0,0,0,0,0,0,0,0xff,0xfe,0xcC,0x98,0xbd,0x74};
4887 PCSTR addr2_Str =
"::fffe:cc98:bd74";
4888 u_char addr3_Num[16] = {0x20,0x30,0xa4,0xb1};
4889 PCSTR addr3_Str =
"2030:a4b1::";
4890 u_char addr4_Num[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0xcC,0x98,0xbd,0x74};
4891 PCSTR addr4_Str =
"::204.152.189.116";
4894 in.s_addr = addr0_Num;
4897 ok(pdst !=
NULL,
"inet_ntoa failed %s\n",
dst);
4898 ok(!
strcmp(pdst, addr0_Str),
"Address %s != %s\n", pdst, addr0_Str);
4901 in.S_un.S_addr = addr1_Num;
4903 ok(pdst !=
NULL,
"inet_ntoa failed %s\n",
dst);
4904 ok(!
strcmp(pdst, addr1_Str),
"Address %s != %s\n", pdst, addr1_Str);
4909 win_skip(
"InetNtop not present, not executing tests\n");
4915 ok(pdst !=
NULL,
"InetNtop failed %s\n",
dst);
4916 ok(!
strcmp(pdst, addr1_Str),
"Address %s != %s\n", pdst, addr1_Str);
4919 pdst = p_inet_ntop(1, (
void *)&
in.s_addr,
dst,
sizeof(
dst));
4920 ok(pdst ==
NULL,
"The pointer should not be returned (%p)\n", pdst);
4926 ok(pdst ==
NULL,
"The pointer should not be returned (%p)\n", pdst);
4928 "Should be STATUS_INVALID_PARAMETER or WSAEINVAL not 0x%x\n",
WSAGetLastError());
4934 ok(pdst ==
NULL,
"The pointer should not be returned (%p)\n", pdst);
4936 "Should be STATUS_INVALID_PARAMETER or WSAEINVAL not 0x%x\n",
WSAGetLastError());
4942 ok(pdst ==
NULL,
"The pointer should not be returned (%p)\n", pdst);
4944 "Should be STATUS_INVALID_PARAMETER or WSAEINVAL not 0x%x\n",
WSAGetLastError());
4950 ok(pdst !=
NULL,
"The pointer should be returned (%p)\n", pdst);
4951 ok(!
strcmp(pdst, addr1_Str),
"Address %s != %s\n", pdst, addr1_Str);
4957 pdst = p_inet_ntop(
AF_INET6, &in6.s6_addr, dst6,
sizeof(dst6));
4958 ok(pdst !=
NULL,
"InetNtop failed %s\n", dst6);
4959 ok(!
strcmp(pdst, addr2_Str),
"Address %s != %s\n", pdst, addr2_Str);
4962 memcpy(in6.s6_addr, addr3_Num,
sizeof(addr3_Num));
4963 pdst = p_inet_ntop(
AF_INET6, &in6.s6_addr, dst6,
sizeof(dst6));
4964 ok(pdst !=
NULL,
"InetNtop failed %s\n", dst6);
4965 ok(!
strcmp(pdst, addr3_Str),
"Address %s != %s\n", pdst, addr3_Str);
4968 memcpy(in6.s6_addr, addr4_Num,
sizeof(addr4_Num));
4969 pdst = p_inet_ntop(
AF_INET6, &in6.s6_addr, dst6,
sizeof(dst6));
4970 ok(pdst !=
NULL,
"InetNtop failed %s\n", dst6);
4971 ok(!
strcmp(pdst, addr4_Str),
"Address %s != %s\n", pdst, addr4_Str);
4978 pdst = p_inet_ntop(
AF_INET6, &in6.s6_addr,
NULL,
sizeof(dst6));
4979 ok(pdst ==
NULL,
"The pointer should not be returned (%p)\n", pdst);
4981 "Should be STATUS_INVALID_PARAMETER or WSAEINVAL not 0x%x\n",
WSAGetLastError());
4986 pdst = p_inet_ntop(
AF_INET6, &in6.s6_addr, dst6, 0);
4987 ok(pdst ==
NULL,
"The pointer should not be returned (%p)\n", pdst);
4989 "Should be STATUS_INVALID_PARAMETER or WSAEINVAL not 0x%x\n",
WSAGetLastError());
4994 pdst = p_inet_ntop(
AF_INET6, &in6.s6_addr, dst6, 16);
4995 ok(pdst ==
NULL,
"The pointer should not be returned (%p)\n", pdst);
4997 "Should be STATUS_INVALID_PARAMETER or WSAEINVAL not 0x%x\n",
WSAGetLastError());
5002 pdst = p_inet_ntop(
AF_INET6, &in6.s6_addr, dst6, 18);
5003 ok(pdst !=
NULL,
"The pointer should be returned (%p)\n", pdst);
5015 {
"", 0, 0xdeadbeef},
5016 {
" ", 0, 0xdeadbeef},
5017 {
"1.1.1.1", 1, 0x01010101},
5018 {
"0.0.0.0", 1, 0x00000000},
5019 {
"127.127.127.255", 1, 0xff7f7f7f},
5020 {
"127.127.127.255:123", 0, 0xff7f7f7f},
5021 {
"127.127.127.256", 0, 0xdeadbeef},
5022 {
"a", 0, 0xdeadbeef},
5023 {
"1.1.1.0xaA", 0, 0xdeadbeef},
5024 {
"1.1.1.0x", 0, 0xdeadbeef},
5025 {
"1.1.1.010", 0, 0xdeadbeef},
5026 {
"1.1.1.00", 0, 0xdeadbeef},
5027 {
"1.1.1.0a", 0, 0x00010101},
5028 {
"1.1.1.0o10", 0, 0x00010101},
5029 {
"1.1.1.0b10", 0, 0x00010101},
5030 {
"1.1.1.-2", 0, 0xdeadbeef},
5031 {
"1", 0, 0xdeadbeef},
5032 {
"1.2", 0, 0xdeadbeef},
5033 {
"1.2.3", 0, 0xdeadbeef},
5034 {
"203569230", 0, 0xdeadbeef},
5035 {
"3.4.5.6.7", 0, 0xdeadbeef},
5036 {
" 3.4.5.6", 0, 0xdeadbeef},
5037 {
"\t3.4.5.6", 0, 0xdeadbeef},
5038 {
"3.4.5.6 ", 0, 0x06050403},
5039 {
"3. 4.5.6", 0, 0xdeadbeef},
5040 {
"[0.1.2.3]", 0, 0xdeadbeef},
5041 {
"0x00010203", 0, 0xdeadbeef},
5042 {
"0x2134", 0, 0xdeadbeef},
5043 {
"1234BEEF", 0, 0xdeadbeef},
5044 {
"017700000001", 0, 0xdeadbeef},
5045 {
"0777", 0, 0xdeadbeef},
5046 {
"2607:f0d0:1002:51::4", 0, 0xdeadbeef},
5047 {
"::177.32.45.20", 0, 0xdeadbeef},
5048 {
"::1/128", 0, 0xdeadbeef},
5049 {
"::1", 0, 0xdeadbeef},
5050 {
":1", 0, 0xdeadbeef},
5057 unsigned short addr[8];
5063 {
"0000:0000:0000:0000:0000:0000:0000:0000", 1, {0, 0, 0, 0, 0, 0, 0, 0}},
5064 {
"0000:0000:0000:0000:0000:0000:0000:0001", 1, {0, 0, 0, 0, 0, 0, 0, 0x100}},
5065 {
"0:0:0:0:0:0:0:0", 1, {0, 0, 0, 0, 0, 0, 0, 0}},
5066 {
"0:0:0:0:0:0:0:1", 1, {0, 0, 0, 0, 0, 0, 0, 0x100}},
5067 {
"0:0:0:0:0:0:0::", 1, {0, 0, 0, 0, 0, 0, 0, 0}},
5068 {
"0:0:0:0:0:0:13.1.68.3", 1, {0, 0, 0, 0, 0, 0, 0x10d, 0x344}},
5069 {
"0:0:0:0:0:0::", 1, {0, 0, 0, 0, 0, 0, 0, 0}},
5070 {
"0:0:0:0:0::", 1, {0, 0, 0, 0, 0, 0, 0, 0}},
5071 {
"0:0:0:0:0:FFFF:129.144.52.38", 1, {0, 0, 0, 0, 0, 0xffff, 0x9081, 0x2634}},
5072 {
"0::", 1, {0, 0, 0, 0, 0, 0, 0, 0}},
5073 {
"0:1:2:3:4:5:6:7", 1, {0, 0x100, 0x200, 0x300, 0x400, 0x500, 0x600, 0x700}},
5074 {
"1080:0:0:0:8:800:200c:417a", 1, {0x8010, 0, 0, 0, 0x800, 0x8, 0x0c20, 0x7a41}},
5075 {
"0:a:b:c:d:e:f::", 1, {0, 0xa00, 0xb00, 0xc00, 0xd00, 0xe00, 0xf00, 0}},
5076 {
"1111:2222:3333:4444:5555:6666:123.123.123.123", 1, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7b7b, 0x7b7b}},
5077 {
"1111:2222:3333:4444:5555:6666:7777:8888", 1, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x8888}},
5078 {
"1111:2222:3333:4444:0x5555:6666:7777:8888", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0xabab, 0xabab, 0xabab, 0xabab}},
5079 {
"1111:2222:3333:4444:x555:6666:7777:8888", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0xabab, 0xabab, 0xabab, 0xabab}},
5080 {
"1111:2222:3333:4444:0r5555:6666:7777:8888", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0xabab, 0xabab, 0xabab, 0xabab}},
5081 {
"1111:2222:3333:4444:r5555:6666:7777:8888", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0xabab, 0xabab, 0xabab, 0xabab}},
5082 {
"1111:2222:3333:4444:5555:6666:7777::", 1, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0}},
5083 {
"1111:2222:3333:4444:5555:6666::", 1, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0, 0}},
5084 {
"1111:2222:3333:4444:5555:6666::8888", 1, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0, 0x8888}},
5085 {
"1111:2222:3333:4444:5555:6666::7777:8888", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0, 0x7777}},
5086 {
"1111:2222:3333:4444:5555:6666:7777::8888", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0}},
5087 {
"1111:2222:3333:4444:5555::", 1, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0, 0}},
5088 {
"1111:2222:3333:4444:5555::123.123.123.123", 1, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0x7b7b, 0x7b7b}},
5089 {
"1111:2222:3333:4444:5555::0x1.123.123.123", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0, 0x100}},
5090 {
"1111:2222:3333:4444:5555::0x88", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0, 0x8800}},
5091 {
"1111:2222:3333:4444:5555::0X88", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0, 0x8800}},
5092 {
"1111:2222:3333:4444:5555::0X", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0, 0}},
5093 {
"1111:2222:3333:4444:5555::0X88:7777", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0, 0x8800}},
5094 {
"1111:2222:3333:4444:5555::0x8888", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0, 0x8888}},
5095 {
"1111:2222:3333:4444:5555::0x80000000", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0, 0xffff}},
5096 {
"1111:2222:3333:4444::5555:0x012345678", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0, 0, 0x5555, 0x7856}},
5097 {
"1111:2222:3333:4444::5555:0x123456789", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0, 0, 0x5555, 0xffff}},
5098 {
"1111:2222:3333:4444:5555:6666:0x12345678", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0xabab, 0xabab}},
5099 {
"1111:2222:3333:4444:5555:6666:7777:0x80000000", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0xffff}},
5100 {
"1111:2222:3333:4444:5555:6666:7777:0x012345678", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x7856}},
5101 {
"1111:2222:3333:4444:5555:6666:7777:0x123456789", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0xffff}},
5102 {
"111:222:333:444:555:666:777:0x123456789abcdef0", 0, {0x1101, 0x2202, 0x3303, 0x4404, 0x5505, 0x6606, 0x7707, 0xffff}},
5103 {
"1111:2222:3333:4444:5555::08888", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0xabab, 0xabab, 0xabab}},
5104 {
"1111:2222:3333:4444:5555::08888::", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0xabab, 0xabab, 0xabab}},
5105 {
"1111:2222:3333:4444:5555:6666:7777:fffff:", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0xabab}},
5106 {
"1111:2222:3333:4444:5555:6666::fffff:", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0xabab, 0xabab}},
5107 {
"1111:2222:3333:4444:5555::fffff", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0xabab, 0xabab, 0xabab}},
5108 {
"1111:2222:3333:4444::fffff", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0xabab, 0xabab, 0xabab, 0xabab}},
5109 {
"1111:2222:3333::fffff", 0, {0x1111, 0x2222, 0x3333, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5110 {
"1111:2222:3333:4444:5555::7777:8888", 1, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0x7777, 0x8888}},
5111 {
"1111:2222:3333:4444:5555::8888", 1, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0, 0x8888}},
5112 {
"1111::", 1, {0x1111, 0, 0, 0, 0, 0, 0, 0}},
5113 {
"1111::123.123.123.123", 1, {0x1111, 0, 0, 0, 0, 0, 0x7b7b, 0x7b7b}},
5114 {
"1111::3333:4444:5555:6666:123.123.123.123", 1, {0x1111, 0, 0x3333, 0x4444, 0x5555, 0x6666, 0x7b7b, 0x7b7b}},
5115 {
"1111::3333:4444:5555:6666:7777:8888", 1, {0x1111, 0, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x8888}},
5116 {
"1111::4444:5555:6666:123.123.123.123", 1, {0x1111, 0, 0, 0x4444, 0x5555, 0x6666, 0x7b7b, 0x7b7b}},
5117 {
"1111::4444:5555:6666:7777:8888", 1, {0x1111, 0, 0, 0x4444, 0x5555, 0x6666, 0x7777, 0x8888}},
5118 {
"1111::5555:6666:123.123.123.123", 1, {0x1111, 0, 0, 0, 0x5555, 0x6666, 0x7b7b, 0x7b7b}},
5119 {
"1111::5555:6666:7777:8888", 1, {0x1111, 0, 0, 0, 0x5555, 0x6666, 0x7777, 0x8888}},
5120 {
"1111::6666:123.123.123.123", 1, {0x1111, 0, 0, 0, 0, 0x6666, 0x7b7b, 0x7b7b}},
5121 {
"1111::6666:7777:8888", 1, {0x1111, 0, 0, 0, 0, 0x6666, 0x7777, 0x8888}},
5122 {
"1111::7777:8888", 1, {0x1111, 0, 0, 0, 0, 0, 0x7777, 0x8888}},
5123 {
"1111::8888", 1, {0x1111, 0, 0, 0, 0, 0, 0, 0x8888}},
5124 {
"1:2:3:4:5:6:1.2.3.4", 1, {0x100, 0x200, 0x300, 0x400, 0x500, 0x600, 0x201, 0x403}},
5125 {
"1:2:3:4:5:6:7:8", 1, {0x100, 0x200, 0x300, 0x400, 0x500, 0x600, 0x700, 0x800}},
5126 {
"1:2:3:4:5:6::", 1, {0x100, 0x200, 0x300, 0x400, 0x500, 0x600, 0, 0}},
5127 {
"1:2:3:4:5:6::8", 1, {0x100, 0x200, 0x300, 0x400, 0x500, 0x600, 0, 0x800}},
5128 {
"2001:0000:1234:0000:0000:C1C0:ABCD:0876", 1, {0x120, 0, 0x3412, 0, 0, 0xc0c1, 0xcdab, 0x7608}},
5129 {
"2001:0000:4136:e378:8000:63bf:3fff:fdd2", 1, {0x120, 0, 0x3641, 0x78e3, 0x80, 0xbf63, 0xff3f, 0xd2fd}},
5130 {
"2001:0db8:0:0:0:0:1428:57ab", 1, {0x120, 0xb80d, 0, 0, 0, 0, 0x2814, 0xab57}},
5131 {
"2001:0db8:1234:ffff:ffff:ffff:ffff:ffff", 1, {0x120, 0xb80d, 0x3412, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}},
5132 {
"2001::CE49:7601:2CAD:DFFF:7C94:FFFE", 1, {0x120, 0, 0x49ce, 0x176, 0xad2c, 0xffdf, 0x947c, 0xfeff}},
5133 {
"2001:db8:85a3::8a2e:370:7334", 1, {0x120, 0xb80d, 0xa385, 0, 0, 0x2e8a, 0x7003, 0x3473}},
5134 {
"3ffe:0b00:0000:0000:0001:0000:0000:000a", 1, {0xfe3f, 0xb, 0, 0, 0x100, 0, 0, 0xa00}},
5135 {
"::", 1, {0, 0, 0, 0, 0, 0, 0, 0}},
5136 {
"::%16", 0, {0, 0, 0, 0, 0, 0, 0, 0}},
5137 {
"::/16", 0, {0, 0, 0, 0, 0, 0, 0, 0}},
5138 {
"::01234", 0, {0, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5139 {
"::0", 1, {0, 0, 0, 0, 0, 0, 0, 0}},
5140 {
"::0:0", 1, {0, 0, 0, 0, 0, 0, 0, 0}},
5141 {
"::0:0:0", 1, {0, 0, 0, 0, 0, 0, 0, 0}},
5142 {
"::0:0:0:0", 1, {0, 0, 0, 0, 0, 0, 0, 0}},
5143 {
"::0:0:0:0:0", 1, {0, 0, 0, 0, 0, 0, 0, 0}},
5144 {
"::0:0:0:0:0:0", 1, {0, 0, 0, 0, 0, 0, 0, 0}},
5145 {
"::0:0:0:0:0:0:0", 1, {0, 0, 0, 0, 0, 0, 0, 0}, 1},
5146 {
"::0:a:b:c:d:e:f", 1, {0, 0, 0xa00, 0xb00, 0xc00, 0xd00, 0xe00, 0xf00}, 1},
5147 {
"::123.123.123.123", 1, {0, 0, 0, 0, 0, 0, 0x7b7b, 0x7b7b}},
5148 {
"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", 1, {0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}},
5149 {
"':10.0.0.1", 0, {0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5150 {
"-1", 0, {0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5151 {
"02001:0000:1234:0000:0000:C1C0:ABCD:0876", 0, {0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5152 {
"2001:00000:1234:0000:0000:C1C0:ABCD:0876", 0, {0x120, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5153 {
"2001:0000:01234:0000:0000:C1C0:ABCD:0876", 0, {0x120, 0, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5154 {
"2001:0000::01234.0", 0, {0x120, 0, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5155 {
"2001:0::b.0", 0, {0x120, 0, 0, 0, 0, 0, 0, 0xb00}},
5156 {
"2001::0:b.0", 0, {0x120, 0, 0, 0, 0, 0, 0, 0xb00}},
5157 {
"1.2.3.4", 0, {0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5158 {
"1.2.3.4:1111::5555", 0, {0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5159 {
"1.2.3.4::5555", 0, {0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5160 {
"11112222:3333:4444:5555:6666:1.2.3.4", 0, {0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5161 {
"11112222:3333:4444:5555:6666:7777:8888", 0, {0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5162 {
"1111", 0, {0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5163 {
"0x1111", 0, {0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5164 {
"1111:22223333:4444:5555:6666:1.2.3.4", 0, {0x1111, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5165 {
"1111:22223333:4444:5555:6666:7777:8888", 0, {0x1111, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5166 {
"1111:123456789:4444:5555:6666:7777:8888", 0, {0x1111, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5167 {
"1111:1234567890abcdef0:4444:5555:6666:7777:888", 0, {0x1111, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5168 {
"1111:2222:", 0, {0x1111, 0x2222, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5169 {
"1111:2222:1.2.3.4", 0, {0x1111, 0x2222, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab}},
5170 {
"1111:2222:3333", 0, {0x1111, 0x2222, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5171 {
"1111:2222:3333:4444:5555:6666::1.2.3.4", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0, 0x100}},
5172 {
"1111:2222:3333:4444:5555:6666:7777:1.2.3.4", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x100}},
5173 {
"1111:2222:3333:4444:5555:6666:7777:8888:", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x8888}},
5174 {
"1111:2222:3333:4444:5555:6666:7777:8888:1.2.3.4",0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x8888}},
5175 {
"1111:2222:3333:4444:5555:6666:7777:8888:9999", 0, {0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x8888}},
5176 {
"1111:2222:::", 0, {0x1111, 0x2222, 0, 0, 0, 0, 0, 0}},
5177 {
"1111::5555:", 0, {0x1111, 0x5555, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5178 {
"1111::3333:4444:5555:6666:7777::", 0, {0x1111, 0, 0, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777}},
5179 {
"1111:2222:::4444:5555:6666:1.2.3.4", 0, {0x1111, 0x2222, 0, 0, 0, 0, 0, 0}},
5180 {
"1111::3333::5555:6666:1.2.3.4", 0, {0x1111, 0, 0, 0, 0, 0, 0, 0x3333}},
5181 {
"12345::6:7:8", 0, {0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5182 {
"1::001.2.3.4", 1, {0x100, 0, 0, 0, 0, 0, 0x201, 0x403}},
5183 {
"1::1.002.3.4", 1, {0x100, 0, 0, 0, 0, 0, 0x201, 0x403}},
5184 {
"1::0001.2.3.4", 0, {0x100, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5185 {
"1::1.0002.3.4", 0, {0x100, 0xab01, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5186 {
"1::1.2.256.4", 0, {0x100, 0x201, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5187 {
"1::1.2.4294967296.4", 0, {0x100, 0x201, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5188 {
"1::1.2.18446744073709551616.4", 0, {0x100, 0x201, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5189 {
"1::1.2.3.256", 0, {0x100, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5190 {
"1::1.2.3.4294967296", 0, {0x100, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5191 {
"1::1.2.3.18446744073709551616", 0, {0x100, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5192 {
"1::1.2.3.300", 0, {0x100, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5193 {
"1::1.2.3.300.", 0, {0x100, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5194 {
"1::1.2::1", 0, {0x100, 0xab01, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5195 {
"1::1.2.3.4::1", 0, {0x100, 0, 0, 0, 0, 0, 0x201, 0x403}},
5196 {
"1::1.", 0, {0x100, 0xab01, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5197 {
"1::1.2", 0, {0x100, 0xab01, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5198 {
"1::1.2.", 0, {0x100, 0x201, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5199 {
"1::1.2.3", 0, {0x100, 0x201, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5200 {
"1::1.2.3.", 0, {0x100, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5201 {
"1::1.2.3.4", 1, {0x100, 0, 0, 0, 0, 0, 0x201, 0x403}},
5202 {
"1::1.2.3.900", 0, {0x100, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5203 {
"1::1.2.300.4", 0, {0x100, 0x201, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5204 {
"1::1.256.3.4", 0, {0x100, 0xab01, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5205 {
"1::1.256:3.4", 0, {0x100, 0xab01, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5206 {
"1::1.2a.3.4", 0, {0x100, 0xab01, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5207 {
"1::256.2.3.4", 0, {0x100, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5208 {
"1::1a.2.3.4", 0, {0x100, 0, 0, 0, 0, 0, 0, 0x1a00}},
5209 {
"1::2::3", 0, {0x100, 0, 0, 0, 0, 0, 0, 0x200}},
5210 {
"2001:0000:1234: 0000:0000:C1C0:ABCD:0876", 0, {0x120, 0, 0x3412, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5211 {
"2001:0000:1234:0000:0000:C1C0:ABCD:0876 0", 0, {0x120, 0, 0x3412, 0, 0, 0xc0c1, 0xcdab, 0x7608}},
5212 {
"2001:1:1:1:1:1:255Z255X255Y255", 0, {0x120, 0x100, 0x100, 0x100, 0x100, 0x100, 0xabab, 0xabab}},
5213 {
"2001::FFD3::57ab", 0, {0x120, 0, 0, 0, 0, 0, 0, 0xd3ff}},
5214 {
":", 0, {0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5215 {
":1111:2222:3333:4444:5555:6666:1.2.3.4", 0, {0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5216 {
":1111:2222:3333:4444:5555:6666:7777:8888", 0, {0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5217 {
":1111::", 0, {0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5218 {
"::-1", 0, {0, 0, 0, 0, 0, 0, 0, 0}},
5219 {
"::12345678", 0, {0, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5220 {
"::123456789", 0, {0, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5221 {
"::1234567890abcdef0", 0, {0, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5222 {
"::0x80000000", 0, {0, 0, 0, 0, 0, 0, 0, 0xffff}},
5223 {
"::0x012345678", 0, {0, 0, 0, 0, 0, 0, 0, 0x7856}},
5224 {
"::0x123456789", 0, {0, 0, 0, 0, 0, 0, 0, 0xffff}},
5225 {
"::0x1234567890abcdef0", 0, {0, 0, 0, 0, 0, 0, 0, 0xffff}},
5226 {
"::.", 0, {0, 0, 0, 0, 0, 0, 0, 0}},
5227 {
"::..", 0, {0, 0, 0, 0, 0, 0, 0, 0}},
5228 {
"::...", 0, {0, 0, 0, 0, 0, 0, 0, 0}},
5229 {
"XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:1.2.3.4", 0, {0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5230 {
"[::]", 0, {0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}},
5239 win_skip(
"inet_ntop is not available\n");
5305 unsigned short addr[8];
5320 "address didn't match\n");
5335 "address didn't match\n");
5359 skip(
"Can't continue without a socket.\n");
5377 ok(
arg,
"SIOCATMARK expected a non-zero value\n");
5386 ok(
arg,
"SIOCATMARK expected a non-zero value\n");
5395 ok(
arg,
"SIOCATMARK expected a non-zero value\n");
5409 ok(
ret == 0,
"WSAIoctl failed unexpectedly\n");
5413 ok(
ret == 0,
"WSAIoctl failed unexpectedly\n");
5417 ok(
ret == 0,
"WSAIoctl failed unexpectedly\n");
5421 ok(
ret == 0,
"WSAIoctl failed unexpectedly\n");
5425 ok(
ret == 0,
"WSAIoctl failed unexpectedly\n");
5429 ok(
ret == 0,
"WSAIoctl failed unexpectedly\n");
5437 skip(
"Can't continue without a socket.\n");
5445 ok(
arg == 0,
"expected 0, got %u\n",
arg);
5461 ok(
arg == 0,
"expected 0, got %u\n",
arg);
5467 ok(0,
"creating socket pair failed, skipping test\n");
5472 optval = 0xdeadbeef;
5475 ok(optval == 0,
"FIONREAD should have returned 0 bytes, got %d instead\n", optval);
5477 optval = 0xdeadbeef;
5478 ok(
send(
src,
"TEST", 4, 0) == 4,
"failed to send test data\n");
5482 ok(optval == 4,
"FIONREAD should have returned 4 bytes, got %d instead\n", optval);
5515 optval = 0xdeadbeef;
5518 ok(optval == 0xdeadbeef,
"FIONREAD should not have changed last error, got %d instead\n", optval);
5554 const int buflen = 1024*1024;
5561 DWORD expected_time, connect_time;
5564 memset(&ov, 0,
sizeof(ov));
5568 ok(0,
"creating socket pair failed, skipping test\n");
5593 for (
i = 0;
i < buflen; ++
i)
5600 ok(
ret == buflen,
"send should have sent %d bytes, but it only sent %d\n", buflen,
ret);
5616 "Failed to start overlapped send %d - %d - %d/%d\n",
ret,
WSAGetLastError(), bytes_sent, buflen);
5620 for (
i = 0;
i < buflen; ++
i)
5636 ok(
buffer[0] == (
char)
i,
"Received bad data at position %d\n",
i);
5644 ok(bret && bytes_sent == buflen,
5645 "Got %d instead of %d (%d - %d)\n", bytes_sent, buflen, bret,
GetLastError());
5658 expected_time = (
GetTickCount() - expected_time) / 1000;
5660 connect_time = 0xdeadbeef;
5661 optlen =
sizeof(connect_time);
5664 ok(connect_time >= expected_time && connect_time <= expected_time + 1,
5665 "unexpected connect time %u, expected %u\n", connect_time, expected_time);
5667 connect_time = 0xdeadbeef;
5668 optlen =
sizeof(connect_time);
5671 ok(connect_time >= expected_time && connect_time <= expected_time + 1,
5672 "unexpected connect time %u, expected %u\n", connect_time, expected_time);
5699#define WM_SOCKET (WM_USER+100)
5837 ok(0,
"WSAEnumNetworkEvents failed, error %d\n",
ret);
5844 if (curr->socket ==
s)
5846 if (prev) prev->
next = curr->next;
5851 if (prev) curr = prev->
next;
5897 if (!*seq)
return 0;
5898 if (*seq != curr->
lparam)
return 0;
5932 memset(netEvents, 0,
sizeof(*netEvents));
5953 for (; *broken_seqs; broken_seqs++)
5969#define ok_event_seq (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : ok_event_sequence
5986 DWORD bytesReturned;
5993 const LPARAM *broken_seq[3];
6008 memset(&ov, 0,
sizeof(ov));
6009 memset(&ov2, 0,
sizeof(ov2));
6015 ok(0,
"creating socket pair failed (%d), skipping test\n",
GetLastError());
6025 ok(0,
"creating socket pair failed (%d), skipping test\n",
GetLastError());
6038 ok(bret ==
FALSE,
"OOB not inline\n");
6042 trace(
"Event test using messages\n");
6044 wndclass.
cbSize =
sizeof(wndclass);
6069 ok(0,
"WSAAsyncSelect failed, error %d\n",
ret);
6079 ok(0,
"WSAAsyncSelect failed, error %d\n",
ret);
6088 trace(
"Event test using events\n");
6107 ok(0,
"WSAEventSelect failed, error %d\n",
ret);
6117 ok(0,
"WSAEventSelect failed, error %d\n",
ret);
6128 ok(0,
"creating socket pair failed (%d), skipping test\n",
GetLastError());
6138 ok(0,
"creating socket pair failed (%d), skipping test\n",
GetLastError());
6146 ok(0,
"creating socket pair failed (%d), skipping test\n",
GetLastError());
6153 ok(0,
"creating socket pair failed (%d), skipping test\n",
GetLastError());
6165 ok(0,
"creating socket pair failed (%d), skipping test\n",
GetLastError());
6172 ok(0,
"creating socket pair failed (%d), skipping test\n",
GetLastError());
6180 ok(0,
"creating socket pair failed (%d), skipping test\n",
GetLastError());
6188 ok(0,
"creating socket pair failed (%d), skipping test\n",
GetLastError());
6209 ok(0,
"could not allocate memory for test\n");
6216 ok(0,
"could not create event object, errno = %d\n",
GetLastError());
6223 ok(0,
"could not create event object, errno = %d\n",
GetLastError());
6266 broken_seq[1] =
NULL;
6293 broken_seq[0] = read_read_seq;
6294 broken_seq[1] =
NULL;
6303 "Got %d instead of 1 (%d - %d)\n", bytesReturned, bret,
GetLastError());
6313 "Got %d instead of 1 (%d - %d)\n", bytesReturned, bret,
GetLastError());
6346 broken_seq[0] = read_seq;
6347 broken_seq[1] =
NULL;
6352 "Failed to wait for recv message: %d - %d\n", dwRet,
GetLastError());
6357 "Got %d instead of 1 (%d - %d)\n", bytesReturned, bret,
GetLastError());
6393 broken_seq[0] = read_write_seq;
6394 broken_seq[1] =
NULL;
6414 broken_seq[0] = read_seq;
6415 broken_seq[1] =
NULL;
6425 broken_seq[0] = close_seq;
6426 broken_seq[1] =
NULL;
6440 broken_seq[0] = read_close_seq;
6441 broken_seq[1] = close_seq;
6442 broken_seq[2] =
NULL;
6447 broken_seq[0] = close_seq;
6448 broken_seq[1] =
NULL;
6454 broken_seq[1] =
NULL;
6470 ok(0,
"WSAAsyncSelect failed, error %d\n",
ret);
6480 ok(0,
"WSAAsyncSelect failed, error %d\n",
ret);
6492 ok(0,
"WSAAsyncSelect failed, error %d\n",
ret);
6502 ok(0,
"WSAAsyncSelect failed, error %d\n",
ret);
6534 if (hEvent2 !=
NULL)
6549 memset(&sin4, 0,
sizeof(sin4));
6553 memset(&sin6, 0,
sizeof(sin6));
6639 ok(v6 !=
INVALID_SOCKET,
"Could not create IPv6 socket (LastError: %d; %d expected if IPv6 not available).\n",
6661 ok(!
ret,
"Could not set SO_EXCLUSIVEADDRUSE on IPv6 socket (LastError: %d)\n",
WSAGetLastError());
6670 ok(!
enabled,
"IPV6_V6ONLY is enabled after bind\n");
6681 ok(
ret,
"bind succeeded unexpectedly for the IPv4 socket\n");
6695 GUID WSASendMsg_GUID = WSAID_WSASENDMSG;
6696 LPFN_WSASENDMSG pWSASendMsg =
NULL;
6697 char teststr[12] =
"hello world",
buffer[32];
6710 &pWSASendMsg,
sizeof(pWSASendMsg), &
err,
NULL,
NULL);
6714 win_skip(
"WSASendMsg is unsupported, some tests will be skipped.\n");
6724 iovec[0].buf = teststr;
6725 iovec[0].len =
sizeof(teststr);
6726 iovec[1].buf = teststr;
6727 iovec[1].len =
sizeof(teststr) / 2;
6729 msg.namelen =
sizeof(sendaddr);
6731 msg.dwBufferCount = 1;
6769 "bind should have worked\n");
6772 memset(&sendaddr, 0,
sizeof(sendaddr));
6773 addrlen =
sizeof(sendaddr);
6775 "getsockname should have worked\n");
6776 ok(sendaddr.
sin_port,
"socket port should be != 0\n");
6791 ok(!
ret,
"WSASendMsg should have worked\n");
6794 ok(bytesSent ==
iovec[0].
len,
"incorret bytes sent, expected %d, sent %d\n",
6802 ok(
ret == bytesSent,
"got %d, expected %d\n",
6811 ok(!
ret,
"getsockname should have worked\n");
6814 ok(
sockaddr.sin_port,
"sin_port should be != 0\n");
6816 msg.dwBufferCount = 2;
6821 ok(!
ret,
"WSASendMsg should have worked\n");
6822 ok(bytesSent ==
iovec[0].
len +
iovec[1].
len,
"incorret bytes sent, expected %d, sent %d\n",
6832 ok(
ret == bytesSent,
"got %d, expected %d\n",
6850 ok(
sockaddr.sin_port,
"sin_port should be > 0\n");
6880 char buf[12] =
"hello world";
6888 data_buf.
len =
sizeof(
buf);
6912 "a successful call to WSASendTo()\n");
6957 skip(
"failed to create sockets\n");
6961 memset(&ov, 0,
sizeof(ov));
6968 iret =
send(
src,
"test", 4, 0);
6969 ok(iret == 4,
"Expected 4, got %d\n", iret);
6972 bytesReturned = 0xdeadbeef;
6974 ok(!iret,
"Expected 0, got %d\n", iret);
6975 ok(bytesReturned == 2,
"Expected 2, got %d\n", bytesReturned);
6978 bytesReturned = 0xdeadbeef;
6980 ok(!iret,
"Expected 0, got %d\n", iret);
6981 ok(bytesReturned == 2,
"Expected 2, got %d\n", bytesReturned);
6986 iret =
send(
src,
"test", 4, 0);
6987 ok(iret == 4,
"Expected 4, got %d\n", iret);
6990 bytesReturned = 0xdeadbeef;
6992 ok(!iret,
"Expected 0, got %d\n", iret);
6993 ok(bytesReturned == 4,
"Expected 4, got %d\n", bytesReturned);
7001 iret =
send(
src,
"deadbeefs", 9, 0);
7002 ok(iret == 9,
"Expected 9, got %d\n", iret);
7005 bytesReturned = 0xdeadbeef;
7007 ok(!iret,
"Expected 0, got %d\n", iret);
7008 ok(bytesReturned == 9,
"Expected 9, got %d\n", bytesReturned);
7009 bufs[0].buf[4] =
'\0';
7010 bufs[1].buf[5] =
'\0';
7040 "Did not get disconnect event: %d, error %d\n", bret,
GetLastError());
7041 ok(bytesReturned == 0,
"Bytes received is %d\n", bytesReturned);
7074 send(
src,
"test message",
sizeof(
"test message"), 0);
7079 memset(&ov, 0,
sizeof(ov));
7084 send(
src,
"test message",
sizeof(
"test message"), 0);
7098 memset(&ov, 0,
sizeof(ov));
7130 int addr_len =
sizeof(
addr),
ret;
7183 if (!pGetWriteWatch)
7185 win_skip(
"write watched not supported\n" );
7192 skip(
"failed to create sockets\n");
7196 memset(&ov, 0,
sizeof(ov));
7209 skip(
"VirtualAlloc(MEM_WRITE_WATCH) is not supported yet on ReactOS\n");
7210 skip(
"Skipping tests due to hang. See ROSTESTS-385\n");
7223 bufs[1].len = 0x8000;
7234 ok( !
base[0],
"data set\n" );
7236 send(
src,
"test message",
sizeof(
"test message"), 0);
7240 ok( bytesReturned ==
sizeof(
"test message"),
"wrong size %u\n", bytesReturned );
7242 ok( !
memcmp(
base + 0x4000,
"message", 8 ),
"wrong data %s\n",
base + 0x4000 );
7255 bufs[1].len = 0x4000;
7265 ok( !
base[0],
"data set\n" );
7267 send(
src,
"test message",
sizeof(
"test message"), 0);
7271 ok( bytesReturned ==
sizeof(
"test message"),
"wrong size %u\n", bytesReturned );
7273 ok( !
memcmp(
base + 0x2000,
"message", 8 ),
"wrong data %s\n",
base + 0x2000 );
7289 args.expect =
"test message";
7300 send(
src,
"test message",
sizeof(
"test message"), 0);
7315#define POLL_CLEAR() ix = 0
7316#define POLL_SET(s, ev) {fds[ix].fd = s; fds[ix++].events = ev;}
7317#define POLL_ISSET(s, rev) poll_isset(fds, ix, s, rev)
7321 for (
k = 0;
k <
max;
k++)
7322 if (fds[
k].
fd ==
s && (fds[
k].revents ==
rev))
return TRUE;
7328 int ix,
ret,
err, poll_timeout;
7329 SOCKET fdListen, fdRead, fdWrite;
7332 static char tmp_buf[1024];
7339 skip(
"WSAPoll is unsupported, some tests will be skipped.\n");
7380 ret = pWSAPoll(fds, ix, poll_timeout);
7381 ok(
ret == 0,
"expected 0, got %d\n",
ret);
7387 ret = pWSAPoll(fds, ix, poll_timeout);
7388 ok(
ret == 1,
"expected 1, got %d\n",
ret);
7399 ret = pWSAPoll(fds, ix, poll_timeout);
7400 ok(
ret == 2,
"expected 2, got %d\n",
ret);
7407 ok(
id == 0,
"expected 0, got %d\n",
id);
7410 ret =
send(fdWrite,
"1234", 4, 0);
7411 ok(
ret == 4,
"expected 4, got %d\n",
ret);
7415 ret = pWSAPoll(fds, ix, poll_timeout);
7416 ok(
ret == 1,
"expected 1, got %d\n",
ret);
7418 ret =
recv(fdRead, tmp_buf,
sizeof(tmp_buf), 0);
7419 ok(
ret == 4,
"expected 4, got %d\n",
ret);
7420 ok(!
strcmp(tmp_buf,
"1234"),
"data received differs from sent\n");
7424 ok(
ret == 1,
"expected 1, got %d\n",
ret);
7428 ret = pWSAPoll(fds, ix, poll_timeout);
7429 ok(
ret == 1,
"expected 1, got %d\n",
ret);
7433 ok(
ret == 1,
"expected 1, got %d\n",
ret);
7434 ok(tmp_buf[0] ==
'A',
"expected 'A', got 0x%02X\n", tmp_buf[0]);
7439 ok(
ret == 0,
"expected 0, got %d\n",
ret);
7441 ok(
ret == 1,
"expected 1, got %d\n",
ret);
7445 ret = pWSAPoll(fds, ix, poll_timeout);
7446 ok(
ret == 1,
"expected 1, got %d\n",
ret);
7452 ret =
recv(fdRead, tmp_buf,
sizeof(tmp_buf), 0);
7453 ok(
ret == 1,
"expected 1, got %d\n",
ret);
7454 ok(tmp_buf[0] ==
'A',
"expected 'A', got 0x%02X\n", tmp_buf[0]);
7458 ok(
ret == 0,
"expected 0, got %d\n",
ret);
7462 ret = pWSAPoll(fds, ix, poll_timeout);
7463 ok(
ret == 1,
"expected 1, got %d\n",
ret);
7465 ret =
recv(fdWrite, tmp_buf,
sizeof(tmp_buf), 0);
7466 ok(
ret == 0,
"expected 0, got %d\n",
ret);
7473 ok(
ret == 0,
"expected 0, got %d\n",
ret);
7475 ok(
ret == 0,
"expected 0, got %d\n",
ret);
7480 poll_timeout = 2000;
7481 ret = pWSAPoll(fds, ix, poll_timeout);
7483 ok(
ret == 0,
"expected 0, got %d\n",
ret);
7497 ret = pWSAPoll(fds, ix, poll_timeout);
7498 ok(
ret == 1,
"expected 1, got %d\n",
ret);
7502 ret = pWSAPoll(fds, ix, poll_timeout);
7503 ok(
ret == 1,
"expected 1, got %d\n",
ret);
7506 "fdWrite socket events incorrect\n");
7515 ret = pWSAPoll(fds, ix, poll_timeout);
7516 ok(
ret == 1,
"expected 1, got %d\n",
ret);
7526 ret = pWSAPoll(fds, ix, poll_timeout);
7527 ok(
ret == 1,
"expected 1, got %d\n",
ret);
7538 static const WCHAR port[] = {
'8',
'0',0};
7540 static const WCHAR localhost[] = {
'l',
'o',
'c',
'a',
'l',
'h',
'o',
's',
't',0};
7541 static const WCHAR nxdomain[] =
7542 {
'n',
'x',
'd',
'o',
'm',
'a',
'i',
'n',
'.',
'c',
'o',
'd',
'e',
'w',
'e',
'a',
'v',
'e',
'r',
's',
'.',
'c',
'o',
'm',0};
7549 static const WCHAR idn_domain[] =
7550 {0x30C6,0x30B9,0x30C8,
'.',
'w',
'i',
'n',
'e',
'h',
'q',
'.',
'o',
'r',
'g',0};
7551 static const WCHAR idn_punycode[] =
7552 {
'x',
'n',
'-',
'-',
'z',
'c',
'k',
'z',
'a',
'h',
'.',
'w',
'i',
'n',
'e',
'h',
'q',
'.',
'o',
'r',
'g',0};
7554 if (!pGetAddrInfoW || !pFreeAddrInfoW)
7556 win_skip(
"GetAddrInfoW and/or FreeAddrInfoW not present\n");
7586 ok(result2 !=
NULL,
"GetAddrInfoW failed\n");
7589 pFreeAddrInfoW(result2);
7600 ok(result2 !=
NULL,
"GetAddrInfoW failed\n");
7603 pFreeAddrInfoW(result2);
7646 ok(result2 !=
NULL,
"GetAddrInfoW failed\n");
7652 pFreeAddrInfoW(result2);
7661 ok(result2 !=
NULL,
"GetAddrInfoW failed\n");
7667 pFreeAddrInfoW(result2);
7674 skip(
"nxdomain returned success. Broken ISP redirects?\n");
7686 skip(
"nxdomain returned success. Broken ISP redirects?\n");
7705 ok(0,
"test %d: GetAddrInfoW succeeded unexpectedly\n",
i);
7714 "test %d: expected AF_INET or AF_INET6, got %d\n",
7718 "test %d: expected family %d, got %d\n",
7722 "test %d: expected type %d, got %d\n",
7725 "test %d: expected protocol %d, got %d\n",
7740 ok(0,
"test %d: GetAddrInfoW failed with %d (err %d)\n",
i,
ret,
err);
7748 ok(!
ret,
"got %d expected success\n",
ret);
7753 hint.ai_socktype = 0;
7754 hint.ai_protocol = 0;
7759 ok(!
ret,
"got %d expected success\n",
ret);
7764 ret = pGetAddrInfoW(idn_domain,
NULL,
NULL, &result2);
7768 win_skip(
"IDN resolution not supported in Win <= 7\n");
7772 ok(!
ret,
"got %d expected success\n",
ret);
7773 ok(result2 !=
NULL,
"got %p\n", result2);
7774 pFreeAddrInfoW(result2);
7777 hint.ai_socktype = 0;
7778 hint.ai_protocol = 0;
7782 ret = pGetAddrInfoW(idn_domain,
NULL, &
hint, &result2);
7783 ok(!
ret,
"got %d expected success\n",
ret);
7784 ok(result2 !=
NULL,
"got %p\n", result2);
7790 pFreeAddrInfoW(result2);
7793 hint.ai_socktype = 0;
7794 hint.ai_protocol = 0;
7798 ret = pGetAddrInfoW(idn_domain,
NULL, &
hint, &result2);
7799 ok(!
ret,
"got %d expected success\n",
ret);
7800 ok(result2 !=
NULL,
"got %p\n", result2);
7801 pFreeAddrInfoW(result2);
7805 hint.ai_socktype = 0;
7806 hint.ai_protocol = 0;
7811 ret = pGetAddrInfoW(idn_domain,
NULL, &
hint, &result2);
7814 ok(result2 ==
NULL,
"got %p\n", result2);
7820 static const WCHAR localhost[] = {
'l',
'o',
'c',
'a',
'l',
'h',
'o',
's',
't',0};
7821 static const WCHAR winehq[] = {
't',
'e',
's',
't',
'.',
'w',
'i',
'n',
'e',
'h',
'q',
'.',
'o',
'r',
'g',0};
7827 if (!pGetAddrInfoExW || !pGetAddrInfoExOverlappedResult)
7829 win_skip(
"GetAddrInfoExW and/or GetAddrInfoExOverlappedResult not present\n");
7835 result = (ADDRINFOEXW *)0xdeadbeef;
7848 pFreeAddrInfoExW(
result);
7853 pFreeAddrInfoExW(
result);
7855 result = (
void*)0xdeadbeef;
7864 ok(!
ret,
"overlapped result is %d\n",
ret);
7865 pFreeAddrInfoExW(
result);
7867 result = (
void*)0xdeadbeef;
7879 ok(!
ret,
"overlapped result is %d\n",
ret);
7886 ok(!
result->ai_blob,
"ai_blob != NULL\n");
7887 ok(!
result->ai_bloblen,
"ai_bloblen != 0\n");
7889 pFreeAddrInfoExW(
result);
7892 result = (
void*)0xdeadbeef;
7928 ok(
strcmp(ipBuffer, expectedIp) == 0,
"ai_addr->sin6_addr == '%s' (expected '%s')\n", ipBuffer, expectedIp);
7940 if (!pgetaddrinfo || !pfreeaddrinfo)
7942 win_skip(
"getaddrinfo and/or freeaddrinfo not present\n");
7971 ok(result2 !=
NULL,
"getaddrinfo failed\n");
7974 pfreeaddrinfo(result2);
7984 ret = pgetaddrinfo(
"",
"",
NULL, &result2);
7986 ok(result2 !=
NULL,
"getaddrinfo failed\n");
7989 pfreeaddrinfo(result2);
8024 result = (
void*)0xdeadbeef;
8044 ok(result2 !=
NULL,
"getaddrinfo failed\n");
8050 pfreeaddrinfo(result2);
8060 ret = pgetaddrinfo(
"",
"",
NULL, &result2);
8063 ok(result2 !=
NULL,
"getaddrinfo failed\n");
8069 pfreeaddrinfo(result2);
8076 skip(
"nxdomain returned success. Broken ISP redirects?\n");
8086 ok(!
ret,
"getaddrinfo failed with %d\n",
ret);
8095 ok(
strcmp(
ip,
"192.168.1.253") == 0,
"sockaddr->ai_addr == '%s'\n",
ip);
8113 ok(!
ret,
"getaddrinfo failed with %d\n",
ret);
8120 ok(!
ret,
"getaddrinfo failed with %d\n",
ret);
8130 ok(!
ret,
"getaddrinfo failed with %d\n",
ret);
8144 ok(!
ret,
"getaddrinfo failed with %d\n",
ret);
8160 win_skip(
"getaddrinfo does not support IPV6\n");
8177 ok(0,
"test %d: getaddrinfo succeeded unexpectedly\n",
i);
8186 "test %d: expected AF_INET or AF_INET6, got %d\n",
8190 "test %d: expected family %d, got %d\n",
8194 "test %d: expected type %d, got %d\n",
8197 "test %d: expected protocol %d, got %d\n",
8212 ok(0,
"test %d: getaddrinfo failed with %d (err %d)\n",
i,
ret,
err);
8225 LPFN_CONNECTEX pConnectEx;
8226 GUID connectExGuid = WSAID_CONNECTEX;
8227 DWORD bytesReturned;
8268 bytesReturned = 0xdeadbeef;
8270 &pConnectEx,
sizeof(pConnectEx), &bytesReturned,
NULL,
NULL);
8276 ok(bytesReturned ==
sizeof(pConnectEx),
"expected sizeof(pConnectEx), got %u\n", bytesReturned);
8302 memset(&conaddress, 0,
sizeof(conaddress));
8305 iret =
bind(connector, (
struct sockaddr*)&conaddress,
sizeof(conaddress));
8321 iret =
listen(listener, 1);
8335 ok(bytesReturned == 0,
"Bytes sent is %d\n", bytesReturned);
8344 memset(&conaddress, 0,
sizeof(conaddress));
8345 conaddress.sin_family =
AF_INET;
8346 conaddress.sin_addr.s_addr =
inet_addr(
"127.0.0.1");
8347 iret =
bind(connector, (
struct sockaddr*)&conaddress,
sizeof(conaddress));
8369 ok(bytesReturned == 3,
"Bytes sent is %d\n", bytesReturned);
8374 bytesReturned =
recv(acceptor,
buffer, 3, 0);
8376 ok(bytesReturned == 3,
"Didn't get all sent data, got only %d\n", bytesReturned);
8378 "Failed to get the right data, expected '123', got '%s'\n",
buffer);
8387 memset(&conaddress, 0,
sizeof(conaddress));
8388 conaddress.sin_family =
AF_INET;
8389 conaddress.sin_addr.s_addr =
inet_addr(
"127.0.0.1");
8390 iret =
bind(connector, (
struct sockaddr*)&conaddress,
sizeof(conaddress));
8415 "Connecting to a disconnected host returned error %d - %d\n", bret,
WSAGetLastError());
8434 struct sockaddr_in bindAddress, peerAddress, *readBindAddress, *readRemoteAddress;
8435 int socklen, optlen;
8437 LPFN_ACCEPTEX pAcceptEx =
NULL;
8438 LPFN_GETACCEPTEXSOCKADDRS pGetAcceptExSockaddrs =
NULL;
8439 fd_set fds_accept, fds_send;
8442 DWORD bytesReturned, connect_time;
8443 char buffer[1024], ipbuffer[32];
8445 int iret, localSize =
sizeof(
struct sockaddr_in), remoteSize = localSize;
8469 memset(&bindAddress, 0,
sizeof(bindAddress));
8472 iret =
bind(listener, (
struct sockaddr*)&bindAddress,
sizeof(bindAddress));
8478 socklen =
sizeof(bindAddress);
8491 &pAcceptEx,
sizeof(pAcceptEx), &bytesReturned,
NULL,
NULL);
8493 skip(
"WSAIoctl failed to get AcceptEx with ret %d + errno %d\n", iret,
WSAGetLastError());
8498 &pGetAcceptExSockaddrs,
sizeof(pGetAcceptExSockaddrs), &bytesReturned,
NULL,
NULL);
8500 skip(
"WSAIoctl failed to get GetAcceptExSockaddrs with ret %d + errno %d\n", iret,
WSAGetLastError());
8517 iret =
listen(listener, 5);
8533 "AcceptEx on NULL buffer returned %d + errno %d\n", bret,
WSAGetLastError());
8535 bret = pAcceptEx(listener, acceptor,
buffer, 0, 0,
sizeof(
struct sockaddr_in) + 16,
8538 "AcceptEx on too small local address size returned %d + errno %d\n",
8541 ok(bret,
"Failed to cancel pending accept socket\n");
8543 bret = pAcceptEx(listener, acceptor,
buffer, 0,
sizeof(
struct sockaddr_in) + 15,
8546 "size returned %d + errno %d\n",
8549 ok(bret,
"Failed to cancel pending accept socket\n");
8551 bret = pAcceptEx(listener, acceptor,
buffer, 0,
sizeof(
struct sockaddr_in) + 16, 0,
8554 "AcceptEx on too small remote address size returned %d + errno %d\n", bret,
WSAGetLastError());
8556 bret = pAcceptEx(listener, acceptor,
buffer, 0,
sizeof(
struct sockaddr_in) + 16,
8559 "AcceptEx on too small remote address size returned %d + errno %d\n", bret,
WSAGetLastError());
8561 ok(bret,
"Failed to cancel pending accept socket\n");
8563 bret = pAcceptEx(listener, acceptor,
buffer, 0,
8565 &bytesReturned,
NULL);
8569 bret = pAcceptEx(listener, acceptor,
buffer, 0, 0, 0, &bytesReturned,
NULL);
8579 bret = pAcceptEx(listener, acceptor,
buffer, 0,
8584 bret = pAcceptEx(listener, acceptor,
buffer, 0,
8588 "AcceptEx on already pending socket returned %d + errno %d\n", bret,
WSAGetLastError());
8592 ok(bret,
"Failed to cancel failed test. Bailing...\n");
8596 bret = pAcceptEx(listener, acceptor,
buffer, 0,
8602 iret =
connect(acceptor, (
struct sockaddr*)&bindAddress,
sizeof(bindAddress));
8604 "connecting to acceptex acceptor succeeded? return %d + errno %d\n", iret,
WSAGetLastError());
8615 ok(bret,
"Failed to cancel failed test. Bailing...\n");
8618 bret = pAcceptEx(listener, acceptor,
buffer, 0,
8624 iret =
connect(connector, (
struct sockaddr*)&bindAddress,
sizeof(bindAddress));
8625 ok(iret == 0,
"connecting to accepting socket failed, error %d\n",
WSAGetLastError());
8631 ok(bret,
"GetOverlappedResult failed, error %d\n",
GetLastError());
8632 ok(bytesReturned == 0,
"bytesReturned isn't supposed to be %d\n", bytesReturned);
8650 bret = pAcceptEx(listener, acceptor,
buffer, 2,
8655 connect_time = 0xdeadbeef;
8656 optlen =
sizeof(connect_time);
8659 ok(connect_time == ~0
u,
"unexpected connect time %u\n", connect_time);
8662 iret =
connect(connector, (
struct sockaddr*)&bindAddress,
sizeof(bindAddress));
8663 ok(iret == 0,
"connecting to accepting socket failed, error %d\n",
WSAGetLastError());
8665 connect_time = 0xdeadbeef;
8666 optlen =
sizeof(connect_time);
8669 ok(connect_time < 0xdeadbeef,
"unexpected connect time %u\n", connect_time);
8675 ok( !iret,
"getsockname failed.\n");
8679 ok(iret == 1,
"could not send 1 byte: send %d errno %d\n", iret,
WSAGetLastError());
8686 (
struct sockaddr **)&readBindAddress, &localSize,
8687 (
struct sockaddr **)&readRemoteAddress, &remoteSize);
8689 ok( readBindAddress->sin_addr.s_addr == bindAddress.sin_addr.s_addr,
8690 "Local socket address is different %s != %s\n",
8691 ipbuffer,
inet_ntoa(bindAddress.sin_addr));
8692 ok( readBindAddress->sin_port == bindAddress.sin_port,
8693 "Local socket port is different: %d != %d\n",
8694 readBindAddress->sin_port, bindAddress.sin_port);
8697 "Remote socket address is different %s != %s\n",
8700 "Remote socket port is different: %d != %d\n",
8704 ok(bret,
"GetOverlappedResult failed, error %d\n",
GetLastError());
8705 ok(bytesReturned == 1,
"bytesReturned isn't supposed to be %d\n", bytesReturned);
8740 iret =
connect(connector, (
struct sockaddr*)&bindAddress,
sizeof(bindAddress));
8746 FD_SET ( listener, &fds_accept );
8747 FD_SET ( connector, &fds_send );
8753 for (
i = 0;
i < 4000; ++
i)
8755 fd_set fds_openaccept = fds_accept, fds_opensend = fds_send;
8758 "acceptex test(%d): could not select on socket, errno %d\n" );
8761 if (
FD_ISSET ( listener, &fds_openaccept ) ) {
8766 bret = pAcceptEx(listener, acceptor,
buffer, 0,
8771 else if (got == 2) {
8778 ok(
FALSE,
"Got more than 2 connections?\n");
8781 if ( conn1 &&
FD_ISSET ( connector2, &fds_opensend ) ) {
8783 send(connector2,
"2", 1, 0);
8784 FD_CLR ( connector2, &fds_send );
8788 if (
FD_ISSET ( connector, &fds_opensend ) ) {
8792 send(connector,
"1", 1, 0);
8793 FD_CLR ( connector, &fds_send );
8795 iret =
connect(connector2, (
struct sockaddr*)&bindAddress,
sizeof(bindAddress));
8797 FD_SET ( connector2, &fds_send );
8802 "Did not get both connections, got %d\n", got);
8808 ok(bret,
"GetOverlappedResult failed, error %d\n",
GetLastError());
8809 ok(bytesReturned == 0,
"bytesReturned isn't supposed to be %d\n", bytesReturned);
8815 ok(
buffer[0] ==
'1',
"The wrong first client was accepted by acceptex: %c != 1\n",
buffer[0]);
8842 iret =
connect(connector, (
struct sockaddr*)&bindAddress,
sizeof(bindAddress));
8843 ok(iret == 0,
"connecting to accepting socket failed, error %d\n",
WSAGetLastError());
8851 bytesReturned = 123456;
8853 ok(bret,
"GetOverlappedResult failed, error %d\n",
GetLastError());
8854 ok(bytesReturned == 0,
"bytesReturned isn't supposed to be %d\n", bytesReturned);
8874 "Waiting for accept event failed with %d + errno %d\n", dwret,
GetLastError());
8882 ok(bret,
"Failed to cancel failed test. Bailing...\n");
8938 SOCKET listener, acceptor, connector;
8939 LPFN_DISCONNECTEX pDisconnectEx;
8940 GUID disconnectExGuid = WSAID_DISCONNECTEX;
8951 &pDisconnectEx,
sizeof(pDisconnectEx), &num_bytes,
NULL,
NULL);
8972 iret =
listen(listener, 1);
8979 ok(bret ==
FALSE,
"DisconnectEx unexpectedly succeeded\n");
8983 bret = pDisconnectEx(connector, &
overlapped, 0, 0);
8984 ok(bret ==
FALSE,
"DisconnectEx unexpectedly succeeded\n");
8996 bret = pDisconnectEx(connector, &
overlapped, 0, 0);
9005 ok(iret != 0,
"connect unexpectedly succeeded\n");
9020 bret = pDisconnectEx(connector,
NULL, 0, 0);
9024 ok(iret != 0,
"connect unexpectedly succeeded\n");
9032#define compare_file(h,s,o) compare_file2(h,s,o,__FILE__,__LINE__)
9036 char buf1[256], buf2[256];
9062 LPFN_TRANSMITFILE pTransmitFile =
NULL;
9064 char header_msg[] =
"hello world";
9065 char footer_msg[] =
"goodbye!!!";
9075 memset( &ov, 0,
sizeof(ov) );
9086 &pTransmitFile,
sizeof(pTransmitFile), &num_bytes,
NULL,
NULL);
9089 skip(
"WSAIoctl failed to get TransmitFile with ret %d + errno %d\n", iret,
WSAGetLastError());
9093 strcat(system_ini_path,
"\\system.ini");
9097 skip(
"Unable to open a file to transmit.\n");
9105 ok(!bret,
"TransmitFile succeeded unexpectedly.\n");
9111 ok(!bret,
"TransmitFile succeeded unexpectedly.\n");
9115 memset(&bindAddress, 0,
sizeof(bindAddress));
9137 len =
sizeof(bindAddress);
9152 ok(bret,
"TransmitFile failed unexpectedly.\n");
9154 ok(iret == -1,
"Returned an unexpected buffer from TransmitFile (%d != -1).\n", iret);
9157 buffers.Head = &header_msg[0];
9158 buffers.HeadLength =
sizeof(header_msg);
9159 buffers.Tail = &footer_msg[0];
9160 buffers.TailLength =
sizeof(footer_msg);
9162 ok(bret,
"TransmitFile failed unexpectedly.\n");
9164 ok(iret ==
sizeof(header_msg)+
sizeof(footer_msg),
9165 "Returned an unexpected buffer from TransmitFile: %d\n", iret );
9166 ok(
memcmp(&
buf[0], &header_msg[0],
sizeof(header_msg)) == 0,
9167 "TransmitFile header buffer did not match!\n");
9168 ok(
memcmp(&
buf[
sizeof(header_msg)], &footer_msg[0],
sizeof(footer_msg)) == 0,
9169 "TransmitFile footer buffer did not match!\n");
9173 ok(bret,
"TransmitFile failed unexpectedly.\n");
9177 buffers.Head = &header_msg[0];
9178 buffers.HeadLength =
sizeof(header_msg);
9179 buffers.Tail = &footer_msg[0];
9180 buffers.TailLength =
sizeof(footer_msg);
9183 ok(bret,
"TransmitFile failed unexpectedly.\n");
9185 ok(
memcmp(
buf, &header_msg[0],
sizeof(header_msg)) == 0,
9186 "TransmitFile header buffer did not match!\n");
9189 ok(
memcmp(
buf, &footer_msg[0],
sizeof(footer_msg)) == 0,
9190 "TransmitFile footer buffer did not match!\n");
9196 skip(
"Could not create event object, some tests will be skipped. errno = %d\n",
9203 ok(!bret,
"TransmitFile succeeded unexpectedly.\n");
9210 "Overlapped TransmitFile sent an unexpected number of bytes (%d != %d).\n",
9218 skip(
"Could not create event object, some tests will be skipped. errno = %d\n",
GetLastError());
9225 ok(!bret,
"TransmitFile succeeded unexpectedly.\n");
9231 "Overlapped TransmitFile sent an unexpected number of bytes (%d != %d).\n",
9239 skip(
"Could not create event object, some tests will be skipped. errno = %d\n",
GetLastError());
9242 buffers.Head = &header_msg[0];
9243 buffers.HeadLength =
sizeof(header_msg);
9244 buffers.Tail = &footer_msg[0];
9245 buffers.TailLength =
sizeof(footer_msg);
9250 ok(!bret,
"TransmitFile succeeded unexpectedly.\n");
9256 "Overlapped TransmitFile sent an unexpected number of bytes (%d != %d).\n",
9259 ok(
memcmp(
buf, &header_msg[0],
sizeof(header_msg)) == 0,
9260 "TransmitFile header buffer did not match!\n");
9263 ok(
memcmp(
buf, &footer_msg[0],
sizeof(footer_msg)) == 0,
9264 "TransmitFile footer buffer did not match!\n");
9269 ok(bret,
"TransmitFile failed unexpectedly.\n");
9272 ok(
send(
client,
"test", 4, 0) == -1,
"send() after TF_DISCONNECT succeeded unexpectedly.\n");
9281 ok(!bret,
"TransmitFile succeeded unexpectedly.\n");
9295 SOCKADDR_STORAGE
ss;
9297 const char buf[] =
"hello world";
9304 "Expected WSAGetLastError() to return WSAENOTSOCK, got %d\n",
WSAGetLastError());
9317 "Expected WSAGetLastError() to return WSAENOTCONN, got %d\n",
WSAGetLastError());
9327 "Expected sendto to succeed, WSAGetLastError() = %d\n",
WSAGetLastError());
9332 "Expected WSAGetLastError() to return WSAENOTCONN, got %d\n",
WSAGetLastError());
9336 "Expected connect to succeed, WSAGetLastError() = %d\n",
WSAGetLastError());
9341 "Expected WSAGetLastError() to return WSAEFAULT, got %d\n",
WSAGetLastError());
9349 "Expected WSAGetLastError() to return WSAEFAULT, got %d\n",
WSAGetLastError());
9355 "Expected WSAGetLastError() to return WSAEFAULT, got %d\n",
WSAGetLastError());
9361 "Expected WSAGetLastError() to return WSAEFAULT, got %d\n",
WSAGetLastError());
9362 ok(!sa_len,
"got %d\n", sa_len);
9368 "Expected WSAGetLastError() to return WSAEFAULT, got %d\n",
WSAGetLastError());
9369 ok(!sa_len,
"got %d\n", sa_len);
9371 sa_len =
sizeof(
ss);
9373 ok(
ret == 0,
"Expected getpeername to return 0, got %d\n",
ret);
9375 "Expected the returned structure to be identical to the connect structure\n");
9376 ok(sa_len ==
sizeof(
sa),
"got %d\n", sa_len);
9386 DWORD bytesReturned;
9418 &sout,
sizeof(sout), &bytesReturned,
NULL,
NULL);
9420 ok(sout.sin_family ==
AF_INET,
"expected AF_INET, got %d\n", sout.sin_family);
9448 skip(
"Cannot test SIO_ADDRESS_LIST_CHANGE, gethostbyname failed with %u\n",
9452 for (acount = 0;
h->h_addr_list[acount]; acount++);
9455 skip(
"Cannot test SIO_ADDRESS_LIST_CHANGE, test requires a network card.\n");
9464 memset(&bindAddress, 0,
sizeof(bindAddress));
9569 ok(!bret,
"failed to get completion status %u\n", bret);
9571 ok(!olp,
"Overlapped structure is at %p\n", olp);
9577 ok(!bret,
"failed to get completion status %u\n", bret);
9579 ok(olp == &
overlapped,
"Overlapped structure is at %p\n", olp);
9601 skip(
"Cannot test SIO_ADDRESS_LIST_CHANGE, interactive tests must be enabled\n");
9614 ok(!
ret,
"bind failed unexpectedly\n");
9615 ret =
bind(sock2, (
struct sockaddr*)&bindAddress,
sizeof(bindAddress));
9616 ok(!
ret,
"bind failed unexpectedly\n");
9617 ret =
bind(sock3, (
struct sockaddr*)&bindAddress,
sizeof(bindAddress));
9618 ok(!
ret,
"bind failed unexpectedly\n");
9642 trace(
"Testing socket-based ipv4 address list change notification. Please connect/disconnect or"
9643 " change the ipv4 address of any of the local network interfaces (15 second timeout).\n");
9667 HANDLE previous_port, io_port;
9677 ok( previous_port !=
NULL,
"failed to create completion port %u\n",
GetLastError() );
9698#define WM_ASYNCCOMPLETE (WM_USER + 100)
9701 static const char class_name[] =
"ws2_32 async message window class";
9706 wndclass.
cbSize =
sizeof(wndclass);
9744 ok(
ret,
"did not expect WM_QUIT message\n");
9761 ok(
ret !=
NULL,
"WSAAsyncGetServByPort returned NULL\n");
9764 ok(
ret !=
NULL,
"WSAAsyncGetServByPort returned NULL\n");
9768 ok(
ret !=
NULL,
"WSAAsyncGetServByPort returned NULL\n");
9772 ok(
ret !=
NULL,
"WSAAsyncGetServByPort returned NULL\n");
9791 ok(
ret !=
NULL,
"WSAAsyncGetServByName returned NULL\n");
9795 ok(
ret !=
NULL,
"WSAAsyncGetServByName returned NULL\n");
9799 ok(
ret !=
NULL,
"WSAAsyncGetServByName returned NULL\n");
9803 ok(
ret !=
NULL,
"WSAAsyncGetServByName returned NULL\n");
9824 memset(bindAddress, 0,
sizeof(*bindAddress));
9827 iret =
bind(
src, (
struct sockaddr*)bindAddress,
sizeof(*bindAddress));
9834 socklen =
sizeof(*bindAddress);
9864 HANDLE previous_port, io_port;
9879 LPFN_ACCEPTEX pAcceptEx =
NULL;
9886 memset(&ov, 0,
sizeof(ov));
9891 skip(
"failed to create sockets\n");
9920 num_bytes = 0xdeadbeef;
9924 todo_wine ok(bret ==
FALSE,
"GetQueuedCompletionStatus returned %d\n", bret);
9926 ok(
key == 125,
"Key is %lu\n",
key);
9927 ok(num_bytes == 0,
"Number of bytes received is %u\n", num_bytes);
9928 ok(olp == &ov,
"Overlapped structure is at %p\n", olp);
9932 num_bytes = 0xdeadbeef;
9936 ok(bret ==
FALSE,
"GetQueuedCompletionStatus returned %d\n", bret );
9938 ok(
key == 0xdeadbeef,
"Key is %lu\n",
key);
9939 ok(num_bytes == 0xdeadbeef,
"Number of bytes transferred is %u\n", num_bytes);
9940 ok(!olp,
"Overlapped structure is at %p\n", olp);
9945 memset(&ov, 0,
sizeof(ov));
9950 skip(
"failed to create sockets\n");
9973 num_bytes = 0xdeadbeef;
9979 ok(num_bytes == 0xdeadbeef,
"Managed to send %d\n", num_bytes);
9983 num_bytes = 0xdeadbeef;
9987 ok(bret ==
FALSE,
"GetQueuedCompletionStatus returned %u\n", bret );
9989 ok(
key == 0xdeadbeef,
"Key is %lu\n",
key);
9990 ok(num_bytes == 0xdeadbeef,
"Number of bytes transferred is %u\n", num_bytes);
9991 ok(!olp,
"Overlapped structure is at %p\n", olp);
10000 skip(
"failed to create sockets\n");
10010 ok(!iret,
"WSASend failed - %d, last error %u\n", iret,
GetLastError());
10011 ok(num_bytes ==
sizeof(
buf),
"Managed to send %d\n", num_bytes);
10021 num_bytes = 0xdeadbeef;
10025 ok(!iret,
"WSARecv failed - %d, last error %u\n", iret,
GetLastError());
10026 ok(num_bytes ==
sizeof(
buf),
"Managed to read %d\n", num_bytes);
10030 num_bytes = 0xdeadbeef;
10034 ok(bret ==
TRUE,
"failed to get completion status %u\n", bret);
10036 ok(
key == 125,
"Key is %lu\n",
key);
10037 ok(num_bytes ==
sizeof(
buf),
"Number of bytes transferred is %u\n", num_bytes);
10038 ok(olp == &ov,
"Overlapped structure is at %p\n", olp);
10047 num_bytes = 0xdeadbeef;
10049 memset(&ov, 0,
sizeof(ov));
10052 ok(!iret,
"WSARecv failed - %d, last error %u\n", iret,
GetLastError());
10053 ok(!num_bytes,
"Managed to read %d\n", num_bytes);
10057 num_bytes = 0xdeadbeef;
10061 ok(bret ==
TRUE,
"failed to get completion status %u\n", bret);
10063 ok(
key == 125,
"Key is %lu\n",
key);
10064 ok(!num_bytes,
"Number of bytes transferred is %u\n", num_bytes);
10065 ok(olp == &ov,
"Overlapped structure is at %p\n", olp);
10077 skip(
"failed to create sockets\n");
10084 memset(&ov, 0,
sizeof(ov));
10102 num_bytes = 0xdeadbeef;
10109 todo_wine ok(num_bytes == 0xdeadbeef,
"Managed to read %d\n", num_bytes);
10113 num_bytes = 0xdeadbeef;
10117 todo_wine ok(bret ==
FALSE,
"GetQueuedCompletionStatus returned %u\n", bret );
10120 todo_wine ok(num_bytes == 0xdeadbeef,
"Number of bytes transferred is %u\n", num_bytes);
10121 todo_wine ok(!olp,
"Overlapped structure is at %p\n", olp);
10133 num_bytes = 0xdeadbeef;
10135 memset(&ov, 0,
sizeof(ov));
10140 ok(num_bytes == 0xdeadbeef,
"Managed to read %d\n", num_bytes);
10144 num_bytes = 0xdeadbeef;
10148 ok(bret ==
FALSE,
"GetQueuedCompletionStatus returned %u\n", bret );
10150 ok(
key == 0xdeadbeef,
"Key is %lu\n",
key);
10151 ok(num_bytes == 0xdeadbeef,
"Number of bytes transferred is %u\n", num_bytes);
10152 ok(!olp,
"Overlapped structure is at %p\n", olp);
10154 num_bytes = 0xdeadbeef;
10165 &pAcceptEx,
sizeof(pAcceptEx), &num_bytes,
NULL,
NULL);
10168 skip(
"WSAIoctl failed to get AcceptEx with ret %d + errno %d\n", iret,
WSAGetLastError());
10182 ok(bret ==
FALSE,
"AcceptEx returned %d\n", bret);
10193 num_bytes = 0xdeadbeef;
10197 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10199 ok(
key == 125,
"Key is %lu\n",
key);
10200 ok(num_bytes == 0,
"Number of bytes transferred is %u\n", num_bytes);
10201 ok(olp == &ov,
"Overlapped structure is at %p\n", olp);
10206 num_bytes = 0xdeadbeef;
10209 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10211 ok(
key == 0xdeadbeef,
"Key is %lu\n",
key);
10212 ok(num_bytes == 0xdeadbeef,
"Number of bytes transferred is %u\n", num_bytes);
10213 ok(!olp,
"Overlapped structure is at %p\n", olp);
10228 ok(bret ==
FALSE,
"AcceptEx returned %d\n", bret);
10236 num_bytes = 0xdeadbeef;
10240 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10242 ok(
key == 125,
"Key is %lu\n",
key);
10243 ok(num_bytes == 0,
"Number of bytes transferred is %u\n", num_bytes);
10244 ok(olp == &ov,
"Overlapped structure is at %p\n", olp);
10249 num_bytes = 0xdeadbeef;
10252 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10254 ok(
key == 0xdeadbeef,
"Key is %lu\n",
key);
10255 ok(num_bytes == 0xdeadbeef,
"Number of bytes transferred is %u\n", num_bytes);
10256 ok(!olp,
"Overlapped structure is at %p\n", olp);
10275 ok(bret ==
FALSE,
"AcceptEx returned %d\n", bret);
10280 num_bytes = 0xdeadbeef;
10283 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10285 ok(
key == 0xdeadbeef,
"Key is %lu\n",
key);
10286 ok(num_bytes == 0xdeadbeef,
"Number of bytes transferred is %u\n", num_bytes);
10287 ok(!olp,
"Overlapped structure is at %p\n", olp);
10296 num_bytes = 0xdeadbeef;
10299 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10301 ok(
key == 125,
"Key is %lu\n",
key);
10302 ok(num_bytes == 0,
"Number of bytes transferred is %u\n", num_bytes);
10303 ok(olp == &ov,
"Overlapped structure is at %p\n", olp);
10308 num_bytes = 0xdeadbeef;
10311 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10313 ok(
key == 0xdeadbeef,
"Key is %lu\n",
key);
10314 ok(num_bytes == 0xdeadbeef,
"Number of bytes transferred is %u\n", num_bytes);
10315 ok(!olp,
"Overlapped structure is at %p\n", olp);
10334 ok(bret ==
FALSE,
"AcceptEx returned %d\n", bret);
10342 num_bytes = 0xdeadbeef;
10345 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10347 ok(
key == 0xdeadbeef,
"Key is %lu\n",
key);
10348 ok(num_bytes == 0xdeadbeef,
"Number of bytes transferred is %u\n", num_bytes);
10349 ok(!olp,
"Overlapped structure is at %p\n", olp);
10353 num_bytes = 0xdeadbeef;
10356 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10358 ok(
key == 0xdeadbeef,
"Key is %lu\n",
key);
10359 ok(num_bytes == 0xdeadbeef,
"Number of bytes transferred is %u\n", num_bytes);
10360 ok(!olp,
"Overlapped structure is at %p\n", olp);
10366 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10368 ok(
key == 125,
"Key is %lu\n",
key);
10369 ok(num_bytes == 0,
"Number of bytes transferred is %u\n", num_bytes);
10370 ok(olp == &ov,
"Overlapped structure is at %p\n", olp);
10375 num_bytes = 0xdeadbeef;
10378 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10380 ok(
key == 0xdeadbeef,
"Key is %lu\n",
key);
10381 ok(num_bytes == 0xdeadbeef,
"Number of bytes transferred is %u\n", num_bytes);
10382 ok(!olp,
"Overlapped structure is at %p\n", olp);
10401 ok(bret ==
FALSE,
"AcceptEx returned %d\n", bret);
10409 num_bytes = 0xdeadbeef;
10412 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10414 ok(
key == 0xdeadbeef,
"Key is %lu\n",
key);
10415 ok(num_bytes == 0xdeadbeef,
"Number of bytes transferred is %u\n", num_bytes);
10416 ok(!olp,
"Overlapped structure is at %p\n", olp);
10422 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10424 ok(
key == 125,
"Key is %lu\n",
key);
10425 ok(num_bytes == 0,
"Number of bytes transferred is %u\n", num_bytes);
10426 ok(olp == &ov,
"Overlapped structure is at %p\n", olp);
10431 num_bytes = 0xdeadbeef;
10434 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10436 ok(
key == 0xdeadbeef,
"Key is %lu\n",
key);
10437 ok(num_bytes == 0xdeadbeef,
"Number of bytes transferred is %u\n", num_bytes);
10438 ok(!olp,
"Overlapped structure is at %p\n", olp);
10455 num_bytes = 0xdeadbeef;
10458 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10460 ok(
key == 0xdeadbeef,
"Key is %lu\n",
key);
10461 ok(num_bytes == 0xdeadbeef,
"Number of bytes transferred is %u\n", num_bytes);
10462 ok(!olp,
"Overlapped structure is at %p\n", olp);
10484 ok(bret ==
FALSE,
"AcceptEx returned %d\n", bret);
10487 iret =
connect(connector, (
struct sockaddr*)&bindAddress,
sizeof(bindAddress));
10488 ok(iret == 0,
"connecting to accepting socket failed, error %d\n",
GetLastError());
10495 num_bytes = 0xdeadbeef;
10499 ok(bret ==
TRUE,
"failed to get completion status %u\n", bret);
10501 ok(
key == 125,
"Key is %lu\n",
key);
10502 ok(num_bytes == 0,
"Number of bytes transferred is %u\n", num_bytes);
10503 ok(olp == &ov,
"Overlapped structure is at %p\n", olp);
10508 num_bytes = 0xdeadbeef;
10511 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10513 ok(
key == 0xdeadbeef,
"Key is %lu\n",
key);
10514 ok(num_bytes == 0xdeadbeef,
"Number of bytes transferred is %u\n", num_bytes);
10515 ok(!olp,
"Overlapped structure is at %p\n", olp);
10549 "expected STATUS_SUCCESS, got %08x\n",
status);
10554 "expected STATUS_SUCCESS, got %08x\n",
status);
10559 ok(bret ==
FALSE,
"AcceptEx returned %d\n", bret);
10562 iret =
connect(connector, (
struct sockaddr*)&bindAddress,
sizeof(bindAddress));
10563 ok(iret == 0,
"connecting to accepting socket failed, error %d\n",
GetLastError());
10565 iret =
send(connector,
buf, 1, 0);
10566 ok(iret == 1,
"could not send 1 byte: send %d errno %d\n", iret,
WSAGetLastError());
10575 num_bytes = 0xdeadbeef;
10579 ok(bret ==
TRUE,
"failed to get completion status %u\n", bret);
10581 ok(
key == 125,
"Key is %lu\n",
key);
10582 ok(num_bytes == 1,
"Number of bytes transferred is %u\n", num_bytes);
10583 ok(olp == &ov,
"Overlapped structure is at %p\n", olp);
10589 "expected STATUS_SUCCESS, got %08x\n",
status);
10595 num_bytes = 0xdeadbeef;
10598 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10600 ok(
key == 0xdeadbeef,
"Key is %lu\n",
key);
10601 ok(num_bytes == 0xdeadbeef,
"Number of bytes transferred is %u\n", num_bytes);
10602 ok(!olp,
"Overlapped structure is at %p\n", olp);
10636 ok(bret ==
FALSE,
"AcceptEx returned %d\n", bret);
10639 iret =
connect(connector, (
struct sockaddr*)&bindAddress,
sizeof(bindAddress));
10640 ok(iret == 0,
"connecting to accepting socket failed, error %d\n",
GetLastError());
10647 num_bytes = 0xdeadbeef;
10651 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10657 ok(
key == 125,
"Key is %lu\n",
key);
10658 ok(num_bytes == 0,
"Number of bytes transferred is %u\n", num_bytes);
10659 ok(olp == &ov,
"Overlapped structure is at %p\n", olp);
10664 "Internal status is %lx\n", olp ? olp->
Internal : 0);
10668 num_bytes = 0xdeadbeef;
10671 ok(bret ==
FALSE,
"failed to get completion status %u\n", bret);
10673 ok(
key == 0xdeadbeef,
"Key is %lu\n",
key);
10674 ok(num_bytes == 0xdeadbeef,
"Number of bytes transferred is %u\n", num_bytes);
10675 ok(!olp,
"Overlapped structure is at %p\n", olp);
10699 bytes_returned = 0;
10704 "Got unexpected bytes_returned %u.\n", bytes_returned);
10706 size = bytes_returned;
10707 bytes_returned = 0;
10711 ok(bytes_returned ==
size,
"Got unexpected bytes_returned %u, expected %u.\n", bytes_returned,
size);
10718 ok(
size == bytes_returned,
"Got unexpected size %u, expected %u.\n",
size, bytes_returned);
10724 bytes_returned = 0xdeadbeef;
10728 ok(bytes_returned ==
size,
"Got unexpected bytes_returned %u, expected %u.\n", bytes_returned,
size);
10733 ok(bytes_returned == 0,
"Got unexpected bytes_returned %u.\n", bytes_returned);
10739 ok(bytes_returned ==
size,
"Got unexpected bytes_returned %u, expected %u.\n", bytes_returned,
size);
10752 ok(
addr ==
htonl(0x04030201),
"expected 0x04030201, got %08x\n",
addr);
10770 ok(
addr ==
htonl(0x01020304),
"expected 0x01020304, got %08x\n",
addr);
10792 char buffer[4096], strbuff[128];
10799 if (!pWSALookupServiceBeginW || !pWSALookupServiceEnd || !pWSALookupServiceNextW)
10801 win_skip(
"WSALookupServiceBeginW or WSALookupServiceEnd or WSALookupServiceNextW not found\n");
10806 memset(qs, 0,
sizeof(*qs));
10809 ret = pWSALookupServiceBeginW(
NULL, 0, &hnd);
10815 ret = pWSALookupServiceBeginW(qs, 0,
NULL);
10821 ret = pWSALookupServiceBeginW(qs, 0, &hnd);
10829 "expected 10022, got %d\n",
error);
10831 ret = pWSALookupServiceEnd(
NULL);
10839 qs->dwSize =
sizeof(*qs);
10840 hnd = (
HANDLE)0xdeadbeef;
10845 win_skip(
"the current WSALookupServiceBeginW test is not supported in win <= 2000\n");
10850 ok(!
ret,
"WSALookupServiceBeginW failed unexpectedly with error %d\n",
error);
10852 ok(hnd != (
HANDLE)0xdeadbeef,
"Handle was not filled\n");
10857 memset(qs, 0,
sizeof(*qs));
10860 if (pWSALookupServiceNextW(hnd, 0, &bsize, qs) ==
SOCKET_ERROR)
10864 ok(0,
"Error %d happened while listing services\n",
error);
10869 strbuff,
sizeof(strbuff),
NULL,
NULL);
10870 trace(
"Network Name: %s\n", strbuff);
10878 netdata = (PNLA_BLOB) &qs->lpBlob->pBlobData[
offset];
10879 switch (netdata->header.type)
10882 trace(
"\tNLA Data Type: NLA_RAW_DATA\n");
10884 case NLA_INTERFACE:
10885 trace(
"\tNLA Data Type: NLA_INTERFACE\n");
10886 trace(
"\t\tType: %d\n", netdata->data.interfaceData.dwType);
10887 trace(
"\t\tSpeed: %d\n", netdata->data.interfaceData.dwSpeed);
10888 trace(
"\t\tAdapter Name: %s\n", netdata->data.interfaceData.adapterName);
10890 case NLA_802_1X_LOCATION:
10891 trace(
"\tNLA Data Type: NLA_802_1X_LOCATION\n");
10892 trace(
"\t\tInformation: %s\n", netdata->data.locationData.information);
10894 case NLA_CONNECTIVITY:
10895 switch (netdata->data.connectivity.type)
10897 case NLA_NETWORK_AD_HOC:
10898 trace(
"\t\tNetwork Type: AD HOC\n");
10900 case NLA_NETWORK_MANAGED:
10901 trace(
"\t\tNetwork Type: Managed\n");
10903 case NLA_NETWORK_UNMANAGED:
10904 trace(
"\t\tNetwork Type: Unmanaged\n");
10906 case NLA_NETWORK_UNKNOWN:
10907 trace(
"\t\tNetwork Type: Unknown\n");
10909 switch (netdata->data.connectivity.internet)
10911 case NLA_INTERNET_NO:
10912 trace(
"\t\tInternet connectivity: No\n");
10914 case NLA_INTERNET_YES:
10915 trace(
"\t\tInternet connectivity: Yes\n");
10917 case NLA_INTERNET_UNKNOWN:
10918 trace(
"\t\tInternet connectivity: Unknown\n");
10923 trace(
"\tNLA Data Type: NLA_ICS\n");
10924 trace(
"\t\tSpeed: %d\n",
10925 netdata->data.ICS.remote.speed);
10926 trace(
"\t\tType: %d\n",
10927 netdata->data.ICS.remote.type);
10928 trace(
"\t\tState: %d\n",
10929 netdata->data.ICS.remote.state);
10931 strbuff,
sizeof(strbuff),
NULL,
NULL);
10932 trace(
"\t\tMachine Name: %s\n", strbuff);
10934 strbuff,
sizeof(strbuff),
NULL,
NULL);
10935 trace(
"\t\tShared Adapter Name: %s\n", strbuff);
10938 trace(
"\tNLA Data Type: Unknown\n");
10947 ret = pWSALookupServiceEnd(hnd);
10948 ok(!
ret,
"WSALookupServiceEnd failed unexpectedly\n");
10955 if (!pWSAEnumNameSpaceProvidersA)
10957 win_skip(
"WSAEnumNameSpaceProvidersA not found\n");
10962 ret = pWSAEnumNameSpaceProvidersA(&blen,
name);
10987 ret = pWSAEnumNameSpaceProvidersA(&blen,
NULL);
10997 skip(
"Failed to get length needed for name space providers.\n");
11005 skip(
"Failed to alloc memory\n");
11009 ret = pWSAEnumNameSpaceProvidersA(&blen,
name);
11011 ok(
ret > 0,
"Expected more than zero name space providers\n");
11013 for (
i = 0;
i <
ret;
i++)
11015 trace(
"Name space Identifier (%p): %s\n",
name[
i].lpszIdentifier,
11016 name[
i].lpszIdentifier);
11017 switch (
name[
i].dwNameSpace)
11020 trace(
"\tName space ID: NS_DNS (%u)\n",
name[
i].dwNameSpace);
11023 trace(
"\tName space ID: NS_NLA (%u)\n",
name[
i].dwNameSpace);
11026 trace(
"\tName space ID: Unknown (%u)\n",
name[
i].dwNameSpace);
11040 if (!pWSAEnumNameSpaceProvidersW)
11042 win_skip(
"WSAEnumNameSpaceProvidersW not found\n");
11047 ret = pWSAEnumNameSpaceProvidersW(&blen,
name);
11072 ret = pWSAEnumNameSpaceProvidersW(&blen,
NULL);
11082 skip(
"Failed to get length needed for name space providers.\n");
11090 skip(
"Failed to alloc memory\n");
11094 ret = pWSAEnumNameSpaceProvidersW(&blen,
name);
11096 ok(
ret > 0,
"Expected more than zero name space providers\n");
11098 for (
i = 0;
i <
ret;
i++)
11100 trace(
"Name space Identifier (%p): %s\n",
name[
i].lpszIdentifier,
11102 switch (
name[
i].dwNameSpace)
11105 trace(
"\tName space ID: NS_DNS (%u)\n",
name[
i].dwNameSpace);
11108 trace(
"\tName space ID: NS_NLA (%u)\n",
name[
i].dwNameSpace);
11111 trace(
"\tName space ID: Unknown (%u)\n",
name[
i].dwNameSpace);
11127 ok(
ret == 12,
"send returned %d\n",
ret);
11131 ok(
ret == 12,
"expected 12, got %d\n",
ret);
11146 memset(&ovl, 0,
sizeof(ovl));
11153 bytes = 0xdeadbeef;
11161 bytes = 0xdeadbeef;
11163 ovl_iocp = (
void *)0xdeadbeef;
11169 ok(
key == 0xdeadbeef,
"got key %#lx\n",
key);
11170 ok(!ovl_iocp,
"got ovl %p\n", ovl_iocp);
11173 ok(
ret == 12,
"send returned %d\n",
ret);
11175 bytes = 0xdeadbeef;
11182 ok(
key == 0x12345678,
"got key %#lx\n",
key);
11183 ok(ovl_iocp == &ovl,
"got ovl %p\n", ovl_iocp);
11191 bytes = 0xdeadbeef;
11193 ovl_iocp = (
void *)0xdeadbeef;
11199 ok(
key == 0xdeadbeef,
"got key %#lx\n",
key);
11200 ok(!ovl_iocp,
"got ovl %p\n", ovl_iocp);
11219 ok(
hwnd != 0,
"CreateWindowEx failed\n");
11230 ok(
msg.wParam ==
src,
"got %08lx\n",
msg.wParam);
11231 ok(
msg.lParam == 2,
"got %08lx\n",
msg.lParam);
11234 memset(&ovl, 0,
sizeof(ovl));
11241 ok(!
ret,
"got %04x,%08lx,%08lx\n",
msg.message,
msg.wParam,
msg.lParam);
11245 bytes = 0xdeadbeef;
11255 ok(!
ret,
"got %04x,%08lx,%08lx\n",
msg.message,
msg.wParam,
msg.lParam);
11257 bytes = 0xdeadbeef;
11259 ovl_iocp = (
void *)0xdeadbeef;
11265 ok(
key == 0xdeadbeef,
"got key %#lx\n",
key);
11266 ok(!ovl_iocp,
"got ovl %p\n", ovl_iocp);
11270 ok(!
ret,
"got %04x,%08lx,%08lx\n",
msg.message,
msg.wParam,
msg.lParam);
11272 switch (how_to_close)
11284 ok(0,
"wrong value %d\n", how_to_close);
11291 switch (how_to_close)
11294 ok(!
ret,
"got %04x,%08lx,%08lx\n",
msg.message,
msg.wParam,
msg.lParam);
11303 ok(
msg.wParam ==
src,
"got %08lx\n",
msg.wParam);
11304 ok(
msg.lParam == 0x20,
"got %08lx\n",
msg.lParam);
11308 ok(0,
"wrong value %d\n", how_to_close);
11312 bytes = 0xdeadbeef;
11321 ok(
key == 0x12345678,
"got key %#lx\n",
key);
11322 ok(ovl_iocp == &ovl,
"got ovl %p\n", ovl_iocp);
11330 bytes = 0xdeadbeef;
11332 ovl_iocp = (
void *)0xdeadbeef;
11338 ok(
key == 0xdeadbeef,
"got key %#lx\n",
key);
11339 ok(!ovl_iocp,
"got ovl %p\n", ovl_iocp);
11358 ok(
hwnd != 0,
"CreateWindowEx failed\n");
11369 ok(
msg.wParam ==
src,
"got %08lx\n",
msg.wParam);
11370 ok(
msg.lParam == 2,
"got %08lx\n",
msg.lParam);
11377 ok(!
ret,
"got %04x,%08lx,%08lx\n",
msg.message,
msg.wParam,
msg.lParam);
11379 bytes = 0xdeadbeef;
11381 ovl_iocp = (
void *)0xdeadbeef;
11387 ok(
key == 0xdeadbeef,
"got key %lu\n",
key);
11388 ok(!ovl_iocp,
"got ovl %p\n", ovl_iocp);
11392 ok(!
ret,
"got %04x,%08lx,%08lx\n",
msg.message,
msg.wParam,
msg.lParam);
11399 ok(!
ret,
"got %04x,%08lx,%08lx\n",
msg.message,
msg.wParam,
msg.lParam);
11401 bytes = 0xdeadbeef;
11403 ovl_iocp = (
void *)0xdeadbeef;
11409 ok(
key == 0xdeadbeef,
"got key %lu\n",
key);
11410 ok(!ovl_iocp,
"got ovl %p\n", ovl_iocp);
11447 bytes = 0xdeadbeef;
11473 ok(
hwnd != 0,
"CreateWindowEx failed\n");
11488 ok(
msg.wParam ==
src,
"got %08lx\n",
msg.wParam);
11489 ok(
msg.lParam == 2,
"got %08lx\n",
msg.lParam);
11496 ok(!
ret,
"got %04x,%08lx,%08lx\n",
msg.message,
msg.wParam,
msg.lParam);
11510 ok(!
ret,
"got %04x,%08lx,%08lx\n",
msg.message,
msg.wParam,
msg.lParam);
11512 bytes = 0xdeadbeef;
11514 ovl_iocp = (
void *)0xdeadbeef;
11523 ok(
key == 0xdeadbeef,
"got key %lx\n",
key);
11524 ok(!ovl_iocp,
"got ovl %p\n", ovl_iocp);
11529 ok(
key == 0x12345678,
"got key %#lx\n",
key);
11530 ok(ovl_iocp == &recv_info.
ovl,
"got ovl %p\n", ovl_iocp);
11543 ok(!
ret,
"got %04x,%08lx,%08lx\n",
msg.message,
msg.wParam,
msg.lParam);
11549 ok(!
ret,
"got %04x,%08lx,%08lx\n",
msg.message,
msg.wParam,
msg.lParam);
11551 bytes = 0xdeadbeef;
11560 ok(
key == 0x12345678,
"got key %#lx\n",
key);
11561 ok(ovl_iocp == &recv_info.
ovl,
"got ovl %p\n", ovl_iocp);
11570 bytes = 0xdeadbeef;
11572 ovl_iocp = (
void *)0xdeadbeef;
11578 ok(
key == 0xdeadbeef,
"got key %lu\n",
key);
11579 ok(!ovl_iocp,
"got ovl %p\n", ovl_iocp);
11601 ok(
hwnd != 0,
"CreateWindowEx failed\n");
11616 ok(
msg.wParam ==
src,
"got %08lx\n",
msg.wParam);
11617 ok(
msg.lParam == 2,
"got %08lx\n",
msg.lParam);
11624 ok(!
ret,
"got %04x,%08lx,%08lx\n",
msg.message,
msg.wParam,
msg.lParam);
11638 ok(!
ret,
"got %04x,%08lx,%08lx\n",
msg.message,
msg.wParam,
msg.lParam);
11640 bytes = 0xdeadbeef;
11642 ovl_iocp = (
void *)0xdeadbeef;
11650 ok(
key == 0xdeadbeef,
"got key %lu\n",
key);
11651 ok(!ovl_iocp,
"got ovl %p\n", ovl_iocp);
11656 ok(
key == 0x12345678,
"got key %#lx\n",
key);
11657 ok(ovl_iocp == &recv_info.
ovl,
"got ovl %p\n", ovl_iocp);
11672 ok(
msg.wParam ==
src,
"got %08lx\n",
msg.wParam);
11673 ok(
msg.lParam == 1,
"got %08lx\n",
msg.lParam);
11677 ok(
ret == 12,
"send returned %d\n",
ret);
11687 ok(
msg.wParam ==
src,
"got %08lx\n",
msg.wParam);
11688 ok(
msg.lParam == 1,
"got %08lx\n",
msg.lParam);
11691 bytes = 0xdeadbeef;
11693 ovl_iocp = (
void *)0xdeadbeef;
11700 ok(
key == 0x12345678,
"got key %#lx\n",
key);
11701 ok(ovl_iocp == &recv_info.
ovl,
"got ovl %p\n", ovl_iocp);
11712 ok(
key == 0xdeadbeef,
"got key %lu\n",
key);
11713 ok(!ovl_iocp,
"got ovl %p\n", ovl_iocp);
11727 ok(!
ret,
"creating socket pair failed\n");
11734 ok(!
ret,
"creating socket pair failed\n");
11739 for (
i = 0;
i <= 2;
i++)
11742 ok(!
ret,
"creating socket pair failed\n");
11748 ok(!
ret,
"creating socket pair failed\n");
11753 ok(!
ret,
"creating socket pair failed\n");
11778 trace (
" **** STARTING TEST %d ****\n",
i );
11780 trace (
" **** TEST %d COMPLETE ****\n",
i );
11829 skip(
"WSPAcceptEx(), WSPConnectEx() and WSPDisconnectEx() are UNIMPLEMENTED on ReactOS\n");
11830 skip(
"Skipping tests due to hang. See ROSTESTS-385\n");
static struct _test_info results[8]
static const CHAR s_name[]
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
static TCHAR test_buffer[TEST_BUFFER_SIZE]
char * strcat(char *DstString, const char *SrcString)
int strcmp(const char *String1, const 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)
char * strcpy(char *DstString, const char *SrcString)
CHAR FAR *WSAAPI inet_ntoa(IN IN_ADDR in)
ULONG WSAAPI inet_addr(IN CONST CHAR FAR *cp)
static int nonblock(int fd, int isnonblock)
static unsigned char bytes[4]
static struct sockaddr_in sa
static const WCHAR szClassName[]
BOOL WINAPI GetComputerNameExW(COMPUTER_NAME_FORMAT NameType, LPWSTR lpBuffer, LPDWORD nSize)
#define ERROR_INSUFFICIENT_BUFFER
BOOL WINAPI CancelIo(IN HANDLE hFile)
static WCHAR yes[MAX_STRING_RESOURCE_LEN]
static const WCHAR empty[]
#define ERROR_INVALID_PARAMETER
#define ReadFile(a, b, c, d, e)
#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 WideCharToMultiByte
#define MultiByteToWideChar
static const WCHAR version[]
static void cleanup(void)
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
UINT WINAPI GetSystemWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
LPVOID WINAPI TlsGetValue(IN DWORD Index)
DWORD WINAPI TlsAlloc(VOID)
VOID WINAPI ExitThread(IN DWORD uExitCode)
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
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)
BOOL WINAPI TerminateThread(IN HANDLE hThread, IN DWORD dwExitCode)
BOOL WINAPI TlsFree(IN DWORD Index)
DWORD WINAPI GetTickCount(VOID)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
VOID WSAAPI WSASetLastError(IN INT iError)
BOOL WSAAPI WSACloseEvent(IN WSAEVENT hEvent)
INT WSAAPI WSAEnumNetworkEvents(IN SOCKET s, IN WSAEVENT hEventObject, OUT LPWSANETWORKEVENTS lpNetworkEvents)
INT WSAAPI WSAIoctl(IN SOCKET s, IN DWORD dwIoControlCode, IN LPVOID lpvInBuffer, IN DWORD cbInBuffer, OUT LPVOID lpvOutBuffer, IN DWORD cbOutBuffer, OUT LPDWORD lpcbBytesReturned, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
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 WSARecvFrom(IN SOCKET s, IN OUT LPWSABUF lpBuffers, IN DWORD dwBufferCount, OUT LPDWORD lpNumberOfBytesRecvd, IN OUT LPDWORD lpFlags, OUT LPSOCKADDR lpFrom, IN OUT LPINT lpFromlen, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
INT WSAAPI WSARecv(IN SOCKET s, IN OUT LPWSABUF lpBuffers, IN DWORD dwBufferCount, OUT LPDWORD lpNumberOfBytesRecvd, IN OUT LPDWORD lpFlags, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
INT WSAAPI recv(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags)
INT WSAAPI select(IN INT s, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST struct timeval *timeout)
INT WSAAPI WSAEventSelect(IN SOCKET s, IN WSAEVENT hEventObject, IN LONG lNetworkEvents)
INT WSAAPI WSAAsyncSelect(IN SOCKET s, IN HWND hWnd, IN UINT wMsg, IN LONG lEvent)
INT WSAAPI sendto(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags, IN CONST struct sockaddr *to, IN INT tolen)
INT WSAAPI WSASend(IN SOCKET s, IN LPWSABUF lpBuffers, IN DWORD dwBufferCount, OUT LPDWORD lpNumberOfBytesSent, IN DWORD dwFlags, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
INT WSAAPI WSASendTo(IN SOCKET s, IN LPWSABUF lpBuffers, IN DWORD dwBufferCount, OUT LPDWORD lpNumberOfBytesSent, IN DWORD dwFlags, IN CONST struct sockaddr *lpTo, IN INT iToLen, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
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)
INT WSAAPI WSADuplicateSocketA(IN SOCKET s, IN DWORD dwProcessId, OUT LPWSAPROTOCOL_INFOA lpProtocolInfo)
INT WSAAPI WSAEnumProtocolsA(IN LPINT lpiProtocols, OUT LPWSAPROTOCOL_INFOA lpProtocolBuffer, IN OUT LPDWORD lpdwBufferLength)
@ FileIoCompletionNotificationInformation
static void do_test(void)
static u8_t pktbuf[200000]
HANDLE WSAAPI WSAAsyncGetServByName(IN HWND hWnd, IN UINT wMsg, IN CONST CHAR FAR *Name, IN CONST CHAR FAR *Protocol, OUT CHAR FAR *Buffer, IN INT BufferLength)
PHOSTENT WSAAPI gethostbyname(IN const char FAR *name)
PSERVENT WSAAPI getservbyname(IN const char FAR *name, IN const char FAR *proto)
HANDLE WSAAPI WSAAsyncGetServByPort(IN HWND hWnd, IN UINT wMsg, IN INT Port, IN CONST CHAR FAR *Protocol, OUT CHAR FAR *Buffer, IN INT BufferLength)
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum const GLvoid * addr
GLboolean GLboolean GLboolean GLboolean a
GLenum GLenum GLenum input
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
static const WCHAR inputW[]
HANDLE WINAPI CreateIoCompletionPort(IN HANDLE FileHandle, IN HANDLE ExistingCompletionPort, IN ULONG_PTR CompletionKey, IN DWORD NumberOfConcurrentThreads)
#define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS
BOOL WINAPI GetOverlappedResult(IN HANDLE hFile, IN LPOVERLAPPED lpOverlapped, OUT LPDWORD lpNumberOfBytesTransferred, IN BOOL bWait)
BOOL WINAPI GetQueuedCompletionStatus(IN HANDLE CompletionHandle, IN LPDWORD lpNumberOfBytesTransferred, OUT PULONG_PTR lpCompletionKey, OUT LPOVERLAPPED *lpOverlapped, IN DWORD dwMilliseconds)
BOOL WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT, LPSTR, LPDWORD)
struct _MIB_IPFORWARDTABLE * PMIB_IPFORWARDTABLE
struct _IP_ADAPTER_INFO * PIP_ADAPTER_INFO
int jpeg_marker_parser_method routine
static const SecPkgInfoW infoW
static const SecPkgInfoA infoA
#define memcpy(s1, s2, n)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
#define sprintf(buf, format,...)
static const struct message empty_seq[]
#define expect2(expected1, expected2, got1, got2)
static void test_events(void)
static const BYTE localhost[]
#define todo_wine_if(is_todo)
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK io
static const struct @1696 ipv6_tests[]
static struct @1695 ipv4_tests[]
#define SIO_KEEPALIVE_VALS
#define WSAID_GETACCEPTEXSOCKADDRS
#define WSAID_TRANSMITFILE
#define STATUS_PIPE_DISCONNECTED
#define STATUS_CONNECTION_ABORTED
#define STATUS_INVALID_INFO_CLASS
#define STATUS_LOCAL_DISCONNECT
#define WS_OVERLAPPEDWINDOW
static unsigned int file_size
INT WSAAPI WSAStringToAddressW(IN LPWSTR AddressString, IN INT AddressFamily, IN LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPSOCKADDR lpAddress, IN OUT LPINT lpAddressLength)
INT WSAAPI WSAAddressToStringA(IN LPSOCKADDR lpsaAddress, IN DWORD dwAddressLength, IN LPWSAPROTOCOL_INFOA lpProtocolInfo, OUT LPSTR lpszAddressString, IN OUT LPDWORD lpdwAddressStringLength)
INT WSAAPI WSAStringToAddressA(IN LPSTR AddressString, IN INT AddressFamily, IN LPWSAPROTOCOL_INFOA lpProtocolInfo, OUT LPSOCKADDR lpAddress, IN OUT LPINT lpAddressLength)
INT WSAAPI WSAAddressToStringW(IN LPSOCKADDR lpsaAddress, IN DWORD dwAddressLength, IN LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPWSTR lpszAddressString, IN OUT LPDWORD lpdwAddressStringLength)
static void accepted(enum accept_stat, struct rpc_err *)
static __inline const char * wine_dbgstr_guid(const GUID *id)
void __winetest_cdecl winetest_push_context(const char *fmt,...)
void __winetest_cdecl winetest_ok(int condition, const char *msg,...)
void winetest_pop_context(void)
static void test_WSAAddressToStringW(void)
static HANDLE server_ready
static void test_WithWSAStartup(void)
static int tcp_socketpair(SOCKET *src, SOCKET *dst)
static void test_WSAAsyncGetServByName(void)
static void test_send(void)
static void test_WSAStringToAddressA(void)
static DWORD WINAPI drain_socket_thread(LPVOID arg)
namespace GUID const ADDRINFOEXW * hints
static void test_UDP(void)
static void test_GetAddrInfoExW(void)
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval * timeout
static void test_inet_pton(void)
static DWORD WINAPI recv_thread(LPVOID arg)
static void verify_ipv6_addrinfo(ADDRINFOA *result, const char *expectedIp)
static DWORD WINAPI AcceptKillThread(void *param)
static void test_getpeername(void)
static void read_zero_bytes(SOCKET s)
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE completion_routine
static void iocp_async_read(SOCKET src, SOCKET dst)
static char * dbgstr_event_seq_result(SOCKET s, WSANETWORKEVENTS *netEvents)
static void wait_for_async_message(HWND hwnd, HANDLE handle)
static void test_write_watch(void)
namespace GUID const ADDRINFOEXW ADDRINFOEXW ** result
static const char * dbgstr_event_seq(const LPARAM *seq)
static void test_gethostbyname_hack(void)
static VOID WINAPI select_server(server_params *par)
static void test_WSADuplicateSocket(void)
static DWORD WINAPI wsa_recv_thread(void *param)
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
static VOID WINAPI simple_mixed_client(client_params *par)
static BOOL poll_isset(WSAPOLLFD *fds, int max, SOCKET s, int rev)
static void test_TransmitFile(void)
static void test_WSAStringToAddressW(void)
static void test_ipv6only(void)
static struct async_message * messages_received
static int tcp_socketpair_ovl(SOCKET *src, SOCKET *dst)
static void compare_addrinfo(ADDRINFO *a, ADDRINFO *b)
static void iocp_async_read_thread(SOCKET src, SOCKET dst)
static void test_GetAddrInfoW(void)
static void do_bind(SOCKET s, struct sockaddr *addr, int addrlen)
#define make_keepalive(k, enable, time, interval)
static int do_synchronous_send(SOCKET s, char *buf, int buflen, int flags, int sendlen)
static const LINGER linger_testvals[]
static void test_synchronous_WSAIoctl(void)
static void test_inet_ntoa(void)
static DWORD WINAPI SelectCloseThread(void *param)
static void test_dns(void)
static void client_stop(void)
static void test_WSAEnumNetworkEvents(void)
static DWORD WINAPI do_getservbyname(void *param)
static VOID WINAPI oob_client(client_params *par)
static void WINAPI event_client(client_params *par)
static void test_completion_port(void)
static void test_gethostbyname(void)
static int set_blocking(SOCKET s, BOOL blocking)
static void test_listen(void)
static void test_WithoutWSAStartup(void)
static void test_so_reuseaddr(void)
static void compare_addrinfow(ADDRINFOW *a, ADDRINFOW *b)
static void test_getsockname(void)
static int CALLBACK AlwaysDeferConditionFunc(LPWSABUF lpCallerId, LPWSABUF lpCallerData, LPQOS pQos, LPQOS lpGQOS, LPWSABUF lpCalleeId, LPWSABUF lpCalleeData, GROUP *g, DWORD_PTR dwCallbackData)
static HANDLE client_ready[MAX_CLIENTS]
#define compare_file(h, s, o)
static void test_WSAPoll(void)
static DWORD thread_id[1+MAX_CLIENTS]
static void fill_buffer(char *buf, int chunk_size, int n_chunks)
static void test_WSAEnumNameSpaceProvidersW(void)
static VOID WINAPI oob_server(server_params *par)
static const ADDRINFOW PADDRINFOW *static const WCHAR * servname
static DWORD WINAPI inet_ntoa_thread_proc(void *param)
static LPWSANAMESPACE_INFOA
static void test_select(void)
static int do_synchronous_recvfrom(SOCKET s, char *buf, int buflen, int flags, struct sockaddr *from, int *fromlen, int recvlen)
static LRESULT CALLBACK ws2_test_WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
static void check_so_opentype(void)
static void test_accept(void)
static void iocp_async_read_closesocket(SOCKET src, int how_to_close)
static void client_start(client_params *par)
static void test_inet_addr(void)
static void server_stop(void)
static void test_iocp(void)
static void test_DisconnectEx(void)
static int completion_called
static void get_event_details(int event, int *bit, char *name)
static void test_WSAEnumNameSpaceProvidersA(void)
static void ok_event_sequence(SOCKET s, HANDLE hEvent, const LPARAM *seq, const LPARAM **broken_seqs, int completelyBroken)
static void test_WSARecv(void)
static void WINAPI io_completion(DWORD error, DWORD transferred, WSAOVERLAPPED *overlapped, DWORD flags)
static SOCKET setup_connector_socket(struct sockaddr_in *addr, int len, BOOL nonblock)
static HWND create_async_message_window(void)
namespace GUID * namespace_id
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED * overlapped
static void test_WSASocket(void)
static HANDLE thread[1+MAX_CLIENTS]
static void test_ioctlsocket(void)
static void test_set_getsockopt(void)
static void test_WSAAddressToStringA(void)
static SOCKET setup_server_socket(struct sockaddr_in *addr, int *len)
static void test_WSALookupService(void)
static void test_ip_pktinfo(void)
static test_setup tests[]
static DWORD WINAPI wsa_async_select_thread(void *param)
static void test_errors(void)
static void compare_file2(HANDLE handle, SOCKET sock, int offset, const char *file, int line)
static const struct addr_hint_tests hinttests[]
static LPWSANAMESPACE_INFOW
static FILE_INFORMATION_CLASS
static void test_sioAddressListChange(void)
static VOID WINAPI simple_server(server_params *par)
static int match_event_sequence(SOCKET s, WSANETWORKEVENTS *netEvents, const LPARAM *seq)
static void test_getaddrinfo(void)
#define POLL_ISSET(s, rev)
static void test_WSASendTo(void)
static void test_AcceptEx(void)
static void sync_read(SOCKET src, SOCKET dst)
static void test_getservbyname(void)
static void test_gethostname(void)
static void StartClients(LPTHREAD_START_ROUTINE routine, test_params *general, client_params *par)
static void StartServer(LPTHREAD_START_ROUTINE routine, test_params *general, server_params *par)
static SOCKET setup_iocp_src(struct sockaddr_in *bindAddress)
static void test_extendedSocketOptions(void)
#define STD_STREAM_SOCKET
#define wsa_ok(op, cond, msg)
static void test_addr_to_print(void)
static void test_ConnectEx(void)
static void iocp_async_closesocket(SOCKET src)
static void server_start(server_params *par)
static DWORD CALLBACK write_watch_thread(void *arg)
static void test_address_list_query(void)
static void set_so_opentype(BOOL overlapped)
int WINAPI gethostname(char *name, int namelen)
static void test_WSASendMsg(void)
static void test_WSAAsyncGetServByPort(void)
static int do_synchronous_recv(SOCKET s, char *buf, int buflen, int flags, int recvlen)
static VOID WINAPI simple_client(client_params *par)
static void iocp_async_read_thread_closesocket(SOCKET src)
static DWORD WINAPI SelectReadThread(void *param)
static void test_sioRoutingInterfaceQuery(void)
INT WSAAPI getpeername(IN SOCKET s, OUT LPSOCKADDR name, IN OUT INT FAR *namelen)
INT WSAAPI getsockname(IN SOCKET s, OUT LPSOCKADDR name, IN OUT INT FAR *namelen)
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 getsockopt(IN SOCKET s, IN INT level, IN INT optname, OUT CHAR FAR *optval, IN OUT INT FAR *optlen)
INT WSAAPI shutdown(IN SOCKET s, IN INT how)
BOOL WSAAPI WSAGetOverlappedResult(IN SOCKET s, IN LPWSAOVERLAPPED lpOverlapped, OUT LPDWORD lpcbTransfer, IN BOOL fWait, OUT LPDWORD lpdwFlags)
SOCKET WSAAPI WSASocketA(IN INT af, IN INT type, IN INT protocol, IN LPWSAPROTOCOL_INFOA lpProtocolInfo, IN GROUP g, IN DWORD dwFlags)
SOCKET WSAAPI WSASocketW(IN INT af, IN INT type, IN INT protocol, IN LPWSAPROTOCOL_INFOW lpProtocolInfo, IN GROUP g, IN DWORD dwFlags)
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
SOCKET WSAAPI WSAAccept(IN SOCKET s, OUT LPSOCKADDR addr, IN OUT LPINT addrlen, IN LPCONDITIONPROC lpfnCondition, IN DWORD_PTR dwCallbackData)
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)
struct _IP_ADAPTER_INFO * Next
IF_INDEX dwForwardIfIndex
MIB_IPFORWARDROW table[1]
SOCKET_ADDRESS Address[1]
int iErrorCode[FD_MAX_EVENTS]
struct async_message * next
ADDRESS_FAMILY sin6_family
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
DWORD WINAPI SleepEx(IN DWORD dwMilliseconds, IN BOOL bAlertable)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
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)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
#define FIELD_OFFSET(t, f)
#define STATUS_INVALID_PARAMETER
static rfbScreenInfoPtr server
LPVOID NTAPI VirtualAlloc(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
BOOL NTAPI VirtualFree(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD dwFreeType)
#define success(from, fromstr, to, tostr)
DWORD WINAPI GetLastError(void)
DWORD WINAPI GetCurrentThreadId(void)
#define WAIT_IO_COMPLETION
DWORD WINAPI GetCurrentProcessId(void)
DWORD(WINAPI * LPTHREAD_START_ROUTINE)(LPVOID)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define ERROR_BUFFER_OVERFLOW
#define ERROR_IO_INCOMPLETE
#define WSANOTINITIALISED
#define WSAHOST_NOT_FOUND
#define WSAEPROTONOSUPPORT
#define ERROR_CONNECTION_REFUSED
#define ERROR_PIPE_NOT_CONNECTED
#define WSASERVICE_NOT_FOUND
#define WSAESOCKTNOSUPPORT
#define ERROR_OPERATION_ABORTED
#define ERROR_CONNECTION_ABORTED
#define ERROR_NETNAME_DELETED
#define WRITE_WATCH_FLAG_RESET
#define FROM_PROTOCOL_INFO
#define WSA_FLAG_OVERLAPPED
#define FD_ADDRESS_LIST_CHANGE
WINSOCK_API_LINKAGE WSAEVENT WSAAPI WSACreateEvent(void)
#define PFL_MATCHES_PROTOCOL_ZERO
struct _WSAPROTOCOL_INFOW WSAPROTOCOL_INFOW
#define WSA_INVALID_EVENT
struct _WSAPROTOCOL_INFOA WSAPROTOCOL_INFOA
#define SO_PROTOCOL_INFOW
#define SO_PROTOCOL_INFOA
int(CALLBACK * LPCONDITIONPROC)(IN LPWSABUF lpCallerId, IN LPWSABUF lpCallerData, IN OUT LPQOS lpSQOS, IN OUT LPQOS lpGQOS, IN LPWSABUF lpCalleeId, IN LPWSABUF lpCalleeData, OUT GROUP FAR *g, IN DWORD_PTR dwCallbackData)
#define FD_ISSET(fd, set)
int PASCAL FAR WSAGetLastError(void)
int PASCAL FAR WSACleanup(void)
#define WSAGETSELECTERROR(l)
#define WSAGETSELECTEVENT(l)
#define WSAMAKESELECTREPLY(e, error)
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
ATOM WINAPI RegisterClassExA(_In_ CONST WNDCLASSEXA *)
HICON WINAPI LoadIconA(_In_opt_ HINSTANCE hInstance, _In_ LPCSTR lpIconName)
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
BOOL WINAPI DestroyWindow(_In_ HWND)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
#define SO_EXCLUSIVEADDRUSE
#define WSA_CMSG_DATA(cmsg)
#define SIO_ADDRESS_LIST_QUERY
#define AI_DISABLE_IDN_ENCODING
#define WSA_CMSG_FIRSTHDR(msg)
#define SIO_ADDRESS_LIST_CHANGE
struct _CSADDR_INFO CSADDR_INFO
#define SIO_ROUTING_INTERFACE_QUERY
#define WSA_CMSG_NXTHDR(msg, cmsg)
struct addrinfoW * PADDRINFOW
#define SIO_GET_EXTENSION_FUNCTION_POINTER
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList