Commit Graph

512 Commits

Author SHA1 Message Date
Hans Leidekker 998e5eaddb ws2_32: Implement GetHostNameW.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49286
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-12 19:32:15 +02:00
Alexandre Julliard 2330a5860a ntdll: Stop exporting wine_server_send_fd() and wine_server_release_fd().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-05 15:07:01 +02:00
Paul Gofman 904f7cfbae ws2_32: Copy send buffer data for async send in WS2_ConnectEx().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50738
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-24 20:48:21 +01:00
Jiangyi Chen 37b7d573b2 ws2_32: Add a missing break.
Signed-off-by: Jiangyi Chen <chenjiangyi@uniontech.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-15 22:22:19 +01:00
Hans Leidekker dc02bbee54 ws2_32: Fix buffer size query in WSAAddressToStringW.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-20 22:12:28 +01:00
Hans Leidekker e7dc82377b ws2_32: Avoid returning duplicate entries from WS_getaddrinfo.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-20 22:12:24 +01:00
Jeff Latimer 89b82195cd ws2_32: Do not print an ERR message when returning WSAEWOULDBLOCK from WSAIoctl().
Signed-off-by: Jeff Latimer <lats@yless4u.com.au>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-20 11:10:44 +01:00
Paul Gofman e0238b6c76 ws2_32: Use if_nameindex() instead of SIOCGIFNAME.
Fixes Mac build broken by 03fcb54c0e

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50525
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-19 13:40:25 +01:00
Paul Gofman 03fcb54c0e ws2_32: Reimplement SIO_GET_INTERFACE_LIST on top of GetIpAddrTable().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-18 22:46:37 +01:00
Damjan Jovanovic 47d50bbbc2 ws2_32: Deal with getaddrinfo() returning NULL ai_canonname despite AI_CANONNAME.
This fixes a wineboot crash on FreeBSD, where getaddrinfo() returns a NULL
ai_canonname, causing wineboot to pass NULL to strchr().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50408
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-28 12:27:10 +01:00
Paul Gofman f17404f8ed ws2_32: Fix buffer size check in WSAIoctl() for SIO_GET_INTERFACE_LIST.
Fixes out of bound memory access in Anno 1404 Addon.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-16 11:03:10 +01:00
Francois Gouget b344ccd857 ws2_32: Fix the spelling of a comment.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-25 22:51:35 +01:00
Paul Gofman 2793bdeb26 ws2_32: Force adding completion for error status in WS2_ConnectEx().
Fixes Paradox launcher hang on start (which happens after commit
0c2f556afe).

The referenced commit did not introduce the problem, it just made
getsockopt(..., WS_SO_PROTOCOL_INFOW, ) working and the application
is taking another path after getting XP1_IFS_HANDLES flag for protocol.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-13 21:57:16 +01:00
Zebediah Figura 93fb921ca7 ws2_32: Use server-side async I/O in accept().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-20 22:54:02 +02:00
Zebediah Figura 0bbd3f6617 ws2_32: Use server-side async I/O in AcceptEx().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-20 22:54:01 +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 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 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 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 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
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
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