Commit Graph

756 Commits

Author SHA1 Message Date
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
Damjan Jovanovic 0645e6c959 ws2_32: Implement IP_PKTINFO on *BSDs, which only have IP_RECVDSTADDR instead.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-01 15:04:16 +02:00
Damjan Jovanovic aa2c84a9db ws2_32: WSARecvMsg allows a NULL control buffer when no control messages arrive.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=43286
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-01 15:03:37 +02:00
Hans Leidekker 943d91c8b5 include: Use WS_ prefix with struct timeval.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-26 23:08:56 +02:00
Piotr Caban 17779b44d1 ws2_32: Don't use strcasecmp.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-03 20:27:43 +02:00
Rob Hughes b9591e21cf ws2_32: Handle EISCONN from sendmsg.
When calling sendmsg on a socket that's already connected, some
implementations will return EISCONN if you specify a recipient
(notably, Darwin/OSX with UDP connections). Newer versions of Linux
and Windows will simply ignore the destination parameter.

Signed-off-by: Rob Hughes <rbhughes@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-13 23:40:39 +01:00
Hans Leidekker 72c1cf59a3 ws2_32: Always set overlapped status in AcceptEx.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-22 18:22:15 +01:00
Sven Baars 651c446217 ws2_32: Use heap_realloc instead of HeapReAlloc to avoid an invalid realloc (Valgrind).
Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-06 19:57:27 +01:00
Alexandre Julliard 70073ff2d0 server: Return a WSA error code in accept_socket.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-20 16:26:04 +01:00
Alexandre Julliard 424a379f64 server: Return a WSA error code in create_socket.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-20 16:26:04 +01:00
Alexandre Julliard 4383a9d536 ws2_32: Return a WSA error code from _is_blocking().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-20 16:26:04 +01:00
Alexandre Julliard f670a162a0 server: Return WSA error codes in socket events.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-20 16:26:04 +01:00
Alistair Leslie-Hughes e7fd1ac3b2 ws2_32: Ignore a SO_SNDBUF value of 0 on macOS.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40264
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-19 22:42:40 +01:00
Sebastian Lackner 18e074b0f3 server: Support FILE_SKIP_COMPLETION_PORT_ON_SUCCESS on client-side asyncs.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=38960
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-25 20:32:03 +02:00
Michael Stefaniuc d58163b26d ws2_32: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-12 23:15:32 +02:00
Alex Henrie 2be851c955 ws2_32/tests: Mark the IPX-not-supported error code test as todo.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-04 15:04:58 +02:00
André Hentschel 48a7d4d0a4 ws2_32/tests: Use the available ARRAY_SIZE() macro.
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-13 22:13:27 +02:00
Hans Leidekker 6d6b4bffb3 ws2_32: Enable IP_DONTFRAGMENT by default for SOCK_STREAM sockets.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-11 00:41:07 +02:00
Alexandre Julliard 5dd1bad730 ws2_32: Add fallback data for getprotobyname/number.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-10 10:02:19 +02:00
Akihiro Sagawa f6b6c94add ws2_32: Fix ioctlsocket(FIONREAD) with listening socket.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-27 12:47:17 +01:00
Akihiro Sagawa 13b66d3d1c ws2_32/tests: Add ioctlsocket(FIONREAD) tests with listening socket.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-27 12:47:17 +01:00
Michael Müller 6fa715c270 w2_32: Ignore setting several port assignment related socket options.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-26 11:40:33 +01:00
Zebediah Figura 80677440cf ws2_32: Only set error codes for triggered events in WSAEnumNetworkEvents().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-20 20:12:35 +01:00
André Hentschel 57b76f0d1a ws2_32/tests: Test with less socket pairs.
about 400 lines less in output

Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-03 12:01:52 +01:00