Commit Graph

779 Commits

Author SHA1 Message Date
Zebediah Figura ecc790ad47 ws2_32/tests: Avoid ok(0, ...) where the condition can be checked directly.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-06 11:56:28 +02:00
Zebediah Figura 94ea4252cf ws2_32/tests: Link directly to more functions.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-06 11:56:25 +02:00
Zebediah Figura ee38e167d1 ws2_32/tests: Make the tests less verbose by default.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-06 11:56:21 +02:00
Zebediah Figura f65340704f ws2_32/tests: Avoid using skip() or trace() for tests that should not fail.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-06 11:56:16 +02:00
Zebediah Figura 2600ccf27f ws2_32: Use IOCTL_AFD_ACCEPT_INTO.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-02 10:01:51 +02:00
Zebediah Figura c46ab05e55 ws2_32: Use IOCTL_AFD_ACCEPT.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-02 10:01:04 +02:00
Zebediah Figura b1f2b61be0 server: Return Win32 socket types from get_socket_info.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-01 11:50:40 +02:00
Zebediah Figura ac36b8ff01 ws2_32: Set default socket options in the server.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-01 11:50:22 +02:00
Zebediah Figura abcc75cbcf ws2_32: Pass Win32 socket types to the server.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-01 11:49:27 +02:00
Zebediah Figura 0c2f556afe ws2_32: Reimplement ws_protocol_info() using the supported_protocols array.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-29 12:03:12 +02:00
Zebediah Figura 9498f9625a ws2_32: Add protocol information for TCP and UDP over IPv6.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-29 12:03:10 +02:00
Zebediah Figura 02a764e702 ws2_32: Look for supported socket parameters if any parameters to WSASocket() are zero.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-29 12:03:08 +02:00
Zebediah Figura f4d376ea07 ws2_32: Reimplement WSAEnumProtocols() using a flat array of WSA_PROTOCOLINFO structures.
Looking up protocol information by protocol number is not reliable, as protocol
numbers for different families may overlap.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-29 12:03:06 +02:00
Alexandre Julliard 9fff80d876 ws2_32: Retrieve the FQDN only when necessary in getaddrinfo().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-28 17:03:58 +02:00
Zebediah Figura 2a573c6f48 ws2_32: Always return WSAEINVAL if AF_UNSPEC is used with a zero protocol.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-25 10:51:15 +02:00
Zebediah Figura 088b7c5814 ws2_32/tests: Add more tests for WSASocket() parameters.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-25 10:51:12 +02:00
Zebediah Figura c6806e3f20 ws2_32: Translate SIO_ADDRESS_LIST_CHANGE into a proper NT ioctl.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-25 10:51:08 +02:00
Zebediah Figura 8fb897a571 ws2_32: Translate WSA_FLAG_OVERLAPPED to NT overlapped flags.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-25 10:51:05 +02:00
Zebediah Figura 18df4912f4 ws2_32: Reimplement WSASocketW() on top of NtOpenFile() and IOCTL_AFD_CREATE.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 14:04:45 +02:00
Haidong Yu 1e198e17de ws2_32: Add missing LeaveCriticalSection.
Signed-off-by: Haidong Yu <yuhaidong@uniontech.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-21 21:42:13 +02:00
Alistair Leslie-Hughes 0f515c8ebe ws2_32: Map AI ALL_option in getaddrinfo().
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-14 19:42:40 +02:00
Zebediah Figura 470b9d0379 ws2_32: Close all open sockets in WSACleanup().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=18670
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-11 16:57:42 +02:00
Zebediah Figura 23dbfaadbb ws2_32: Keep a list of open sockets.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-11 16:57:42 +02:00
Aaro Altonen 652f1f9642 ws2_32: Improve WSCGetProviderPath() stub.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45801
Signed-off-by: Aaro Altonen <a.altonen@hotmail.com>
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-31 22:05:01 +02:00
Hans Leidekker a6d9f46b25 ws2_32: Avoid a crash in WS_getaddrinfo when the specified service doesn't exist.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49656
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-11 18:08:13 +02:00
Alistair Leslie-Hughes 587732acb7 ws2_32: Correct returned error code for an invalid socket.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-27 23:28:16 +02:00
Alex Henrie 046475d88e ws2_32/tests: Allow ESP and AH protocols to be missing on Windows.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-27 23:28:16 +02:00
Alex Henrie a16f91ae36 ws2_32: Avoid depending on system getprotoby(name|number) functions.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 23:16:52 +02:00
Alistair Leslie-Hughes da6386df8b ws2_32: Trace SIO_IDEAL_SEND_BACKLOG_* calls.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-14 09:39:35 +02:00
Paul Gofman d888f3ba36 ws2_32: Consider socket with zero ifindex unbound.
Real interface index can't be zero.
getsockopt(..., IP_UNICAST_IF, ...) may return success and zero
interface index if IP_UNICAST_IF was never set.

Avoids error output which doesn't inidcate a real error condition
for such case.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-03 19:44:15 +02:00
Louis Lenders 6d1fea9711 ws2_32: Add FreeAddrInfoEx.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48256
Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-18 09:00:31 +02:00
Paul Gofman 60c8c78015 ws2_32: Optimize interface_bind_check() by caching adapter addresses.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48668
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-18 09:00:30 +02:00
Alex Henrie 73ef942c65 ws2_32/tests: Put WSAAddressToString tests in tables.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-27 16:18:46 +02:00
Alex Henrie a294f755ce ws2_32: Reimplement inet_ntop on top of ntdll functions.
And add a couple of tests for IPv6 addresses that Windows represents
using dot-decimal notation for the last 32 bits but GNU/Linux does not.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-26 10:30:30 +02:00
Alex Henrie c84e416d23 ws2_32: Don't set output length in WSAStringToAddress on error.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-20 20:11:45 +02:00
Alex Henrie 205e09bc30 ws2_32/tests: Fix typos in test_WSAStringToAddress.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-20 20:10:46 +02:00
Alex Henrie 41e9a8c5fb ws2_32: Reimplement inet_pton on top of ntdll functions.
And add a test to show that inet_pton does not accept hexadecimal IPv4
addresses, and another test to demonstrate that it has the same leading
double colon bug as RtlIpv6StringToAddress.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-19 11:20:48 +02:00
Alex Henrie f21b25ae8e ws2_32: Set WSAEINVAL in InetPtonW if the address string is unparsable.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-19 11:20:48 +02:00
Alex Henrie 3bb824f988 ws2_32: Reimplement WSAStringToAddress on top of ntdll functions.
And add tests to show that the address is always zeroed out even if
there is an error, and that WSAStringToAddress has the same bug with
leading double colons as RtlIpv6StringToAddress.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-18 21:50:44 +02:00
Alex Henrie 2756b68559 ws2_32/tests: Put WSAStringToAddress tests in tables.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-18 21:50:25 +02:00
Marcus Meissner 8bce44e4ea ws2_32: Add IPPROTO_IPIP mapping.
Signed-off-by: Marcus Meissner <marcus@jet.franken.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-13 11:52:44 +02:00
Bernhard Übelacker 3795484e81 ws2_32: Add stub implementation for WSCGetProviderInfo.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48765
Signed-off-by: Bernhard Übelacker <bernhardu@mailbox.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-20 12:32:17 +01:00
Vijay Kiran Kamuju 0df9cce29d ws2_32: Add stub for WSCSetApplicationCategory.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48392
Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-10 23:24:06 +01:00
Damjan Jovanovic 37dec9f144 server: Revert b4a1d80ae3 for now.
It breaks too many things.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48357
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-06 22:19:19 +01:00
Damjan Jovanovic b4a1d80ae3 wineserver: Avoid spurious FD_WRITE on repeated calls to WSAEventSelect().
Repeated calls to WSAEventSelect() with FD_WRITE deliver
spurious FD_WRITE events, as the flag isn't held, resulting
in us unnecessarily polling the socket for writability,
despite the fact FD_WRITE should only be delivered (1) initially
on socket creation, and (2) after send[to]() fails with
EWOULDBLOCK and buffer space becomes available.

Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-20 10:33:54 +01:00
Damjan Jovanovic 6e7f357b65 ws2_32: Remove an unneeded todo_wine.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-19 16:20:39 +01:00
Francois Gouget c52c3d5a36 ws2_32/tests: Fix the spelling of a couple of ok() messages.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-10 20:59:19 +01:00
Fabian Maurer bf24c316f4 ws2_32: Handle more IGMP socket options.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47956
Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-21 17:11:43 +02:00
Hans Leidekker c3bcf83d14 ws2_32: Call the completion routine in GetAddrInfoExW.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-27 14:51:33 +02:00
Damjan Jovanovic c722d819ea ws2_32: Avoid data corruption of WSAPROTOCOL_INFO in ws_protocol_info().
WS_EnterSingleProtocol[A/W]() fills WSAPROTOCOL_INFO with zeroes,
ovewriting what was already there, so in ws_protocol_info(),
populate the address family, socket type and protocol
only AFTER calling it.

Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-01 19:11:49 +02:00