Commit Graph

528 Commits

Author SHA1 Message Date
Alex Henrie cade5944be ws2_32: Hook up IPV6_PKTINFO.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 23:20:40 +02:00
Alex Henrie 71d1bb60f1 ws2_32: Hook up IPV6_HOPLIMIT.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 22:06:11 +02:00
Alex Henrie 0e76a54aae ws2_32/tests: Add tests for IPv6 control messages.
Namely IPV6_HOPLIMIT and IPV6_PKTINFO.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 22:05:51 +02:00
Zebediah Figura e58405000c ws2_32: Move getaddrinfo() support to a new Unix library.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 11:33:24 +02:00
Zebediah Figura 671cf16f77 ws2_32: Reimplement inet_addr() on top of inet_pton().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-03 23:41:05 +02:00
Zebediah Figura b159f6e256 ws2_32/tests: Add tests for inet_addr().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-03 23:41:05 +02:00
Zebediah Figura 53fe477d82 ws2_32/tests: Expand tests for inet_pton().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-03 23:41:05 +02:00
Zebediah Figura 4ed061f458 ws2_32/tests: Expand tests for WSAStringToAddress().
Adapted from RtlIpv4StringToAddress() tests.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-03 23:41:05 +02:00
Zebediah Figura 86e521d5bb ntdll: Fill the I/O status block with the results of the recv_socket call in sock_recv().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-26 20:14:20 +02:00
Zebediah Figura 4c639d6926 ntdll: Fill the I/O status block with the results of the send_socket call in sock_send().
The server might change the status. In particular, if we got a short but nonzero
write on a nonblocking socket, try_send() would return STATUS_DEVICE_NOT_READY
and hence leave the I/O status block unfilled. The server subsequently massages
this into STATUS_SUCECSS, causing a garbage size to be eventually returned from
ws2_32 send().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51439
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-26 20:14:18 +02:00
Zebediah Figura a9ddbc0cbc server: Also return STATUS_PIPE_DISCONNECTED for shutdown nonblocking sockets.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-26 20:14:09 +02:00
Zebediah Figura d04c5f4b1b server: Do not accept sizeof(struct WS_sockaddr_in6_old).
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-23 19:03:13 +02:00
Zebediah Figura c06e5693cb server: Validate the output size of IOCTL_AFD_BIND against the input address size rather than sizeof(struct sockaddr).
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-23 19:02:55 +02:00
Zebediah Figura 06dd08ee44 server: Map ENODEV to STATUS_INVALID_ADDRESS_COMPONENT.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-22 13:16:27 +02:00
Zebediah Figura 9b257ed63f server: Support passing to bind a zero sin6_scope_id.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-22 13:16:20 +02:00
Zebediah Figura cd34be062c ws2_32: Validate address length in bind().
bind() returns WSAEFAULT for short length, but IOCTL_AFD_BIND returns
STATUS_INVALID_ADDRESS, which translates to WSAEADDRNOTAVAIL.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-22 13:15:26 +02:00
Zebediah Figura 2e0cb6d4de ws2_32/tests: Add more tests for bind() and getsockname().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-22 13:15:24 +02:00
Zebediah Figura f0533d9a5a ws2_32: Move the setsockopt(IP_HDRINCL) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 10:49:49 +02:00
Zebediah Figura 3b33a6b487 server: Explicitly forbid connecting a listening or connected socket.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51381
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-07 11:33:17 +02:00
Zebediah Figura 34e3301b19 ws2_32/tests: Add more tests for invalid calls to connect() and ConnectEx().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-07 11:33:11 +02:00
Zebediah Figura ddb9223915 server: Clear the connection error after a successful connection.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-07 11:33:04 +02:00
Zebediah Figura 53e69130cc server: Report AFD_POLL_CONNECT_ERR if a previous connection attempt failed.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51331
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51366
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 09:57:28 +02:00
Zebediah Figura 026b192018 server: Return a Win32 error code from IOCTL_AFD_WINE_GET_SO_ERROR.
Fixes: fb3956fcf9
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 09:56:57 +02:00
Zebediah Figura 91e4596b9e ws2_32/tests: Add more tests for connection failure.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 09:56:51 +02:00
Zebediah Figura 65dee2d28c ws2_32/tests: Fix some connection timeout tests.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 09:56:45 +02:00
Zebediah Figura b9bf00605d ws2_32/tests: Add tests for options which can only be set.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 08:37:45 +02:00
Zebediah Figura 35288d6537 ws2_32: Use IOCTL_AFD_WINE_GET_SO_SNDBUF.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=8606
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-30 09:19:40 +02:00
Zebediah Figura f4df896e06 ws2_32: Handle SO_RCVTIMEO in the server.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-29 19:55:22 +02:00
Zebediah Figura 8312539efe ws2_32: Use IOCTL_AFD_WINE_GET_SO_RCVBUF.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-28 19:43:28 +02:00
Zebediah Figura fb3956fcf9 ws2_32: Use IOCTL_AFD_WINE_GET_SO_ERROR.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-24 10:26:45 +02:00
Zebediah Figura d8dfce3edc ws2_32: Make getsockopt(SO_DEBUG) into a stub.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-23 20:44:58 +02:00
Zebediah Figura 75fe1064f7 ws2_32/tests: Add some tests for SO_DEBUG.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-23 20:44:58 +02:00
Zebediah Figura 5d11333593 ws2_32/tests: Test setting SO_TYPE.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-22 17:57:47 +02:00
Zebediah Figura 2f0e8c084e ws2_32/tests: Test setting SO_ACCEPTCONN.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-22 17:57:47 +02:00
Zebediah Figura 414b31bc0b ws2_32: Reimplement select() on top of IOCTL_AFD_POLL.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-21 10:45:01 +02:00
Zebediah Figura 639a4cab1d ws2_32: Use IOCTL_AFD_POLL in WSAPoll().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-21 10:44:58 +02:00
Zebediah Figura b3e9d0f88c ws2_32/tests: Avoid some more test failures on Vista.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-21 10:44:55 +02:00
Zebediah Figura 569f1ac018 ws2_32: Move the getpeername() implementation to ntdll.
This adds todo_wine to a couple of tests; however, these are overly zealous
invalid parameter tests, and fixing them is nontrivial.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-17 09:19:31 +02:00
Zebediah Figura 5c009c17b3 ws2_32: Reimplement bind() and getsockname() on top of IOCTL_AFD_BIND and IOCTL_AFD_GETSOCKNAME respectively.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-16 09:03:20 +02:00
Zebediah Figura a997c3980f server: Return STATUS_ADDRESS_ALREADY_ASSOCIATED from IOCTL_AFD_BIND if the socket is already bound.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-16 09:03:20 +02:00
Zebediah Figura 10bfe80ad5 ws2_32/tests: Add some tests for IOCTL_AFD_BIND and IOCTL_AFD_GETSOCKNAME.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-16 09:03:20 +02:00
Zebediah Figura 533fd1b127 ws2_32/tests: Add a couple more tests for getsockname().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-16 09:02:24 +02:00
Zebediah Figura 0272f19049 ws2_32/tests: Add some tests for IOCTL_AFD_GET_EVENTS.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-15 20:43:03 +02:00
Zebediah Figura fd9a521c61 ws2_32/tests: Add some tests for IOCTL_AFD_EVENT_SELECT.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-14 10:08:03 +02:00
Zebediah Figura 8698083dd0 ws2_32: Implement SIO_BASE_HANDLE.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50520
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-10 20:50:54 +02:00
Zebediah Figura 9344a490a4 server: Fail with WSAEINVAL or WSAEALREADY when trying to connect a socket that is already connecting via nonblocking connect().
Fixes connection in Mortal Kombat 11; reported by Thomas Crider.

Fixes: a891713f48
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-10 20:50:32 +02:00
Zebediah Figura 7326b21241 server: Return STATUS_INVALID_PARAMETER when trying to call connect() on a socket with an active ConnectEx() async.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-10 20:50:22 +02:00
Zebediah Figura 5b981c72c3 ws2_32/tests: Add more tests for calling functions on a connecting socket.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-10 20:50:13 +02:00
Zebediah Figura 0a4a7c4345 ws2_32: Return WSAEOPNOTSUPP in FIOASYNC.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-09 08:57:41 +02:00
Zebediah Figura b8bb6bae8f ws2_32: Return WSAEOPNOTSUPP in SIO_FLUSH.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-09 08:57:36 +02:00