Commit Graph

827 Commits

Author SHA1 Message Date
Zebediah Figura 7a934b708c ws2_32: Map EADDRINUSE to STATUS_SHARING_VIOLATION.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-05 10:19:48 +02:00
Zebediah Figura 08da4ba927 ws2_32: Map EWOULDBLOCK to STATUS_DEVICE_NOT_READY.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-05 10:19:03 +02:00
Zebediah Figura 9195da83b9 ws2_32/tests: Add some tests for WSAGetOverlappedResult() status mapping.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-04 09:37:36 +02:00
Zebediah Figura b9cfd6eddb ws2_32: Move namespace provider stubs to protocol.c.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-04 09:37:31 +02:00
Zebediah Figura ec6940cd3f ws2_32: Move byte order conversion functions to protocol.c.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-04 09:37:28 +02:00
Zebediah Figura 615028f8ba ws2_32: Move address/string conversion functions to protocol.c.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-04 09:37:25 +02:00
Zebediah Figura cfdaa7fdaf ws2_32: Move service lookup functions to protocol.c.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 21:07:28 +02:00
Zebediah Figura 5d9fe03637 ws2_32: Move protocol lookup functions to protocol.c.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 21:07:26 +02:00
Zebediah Figura 877e3e24d4 ws2_32: Move name info functions to protocol.c.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 21:07:24 +02:00
Zebediah Figura ec9f311930 ws2_32: Move host lookup functions to protocol.c.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 21:07:21 +02:00
Zebediah Figura e30b16d738 ws2_32: Move getaddrinfo() and related functions to a separate file.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 21:07:18 +02:00
Zebediah Figura 2deb8c2825 ws2_32: Don't call free_per_thread_data() on process exit.
It is redundant.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-30 22:59:50 +02:00
Zebediah Figura adb138c489 ws2_32: Do not free a static critical section.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-30 22:59:50 +02:00
Zebediah Figura 2adcb77c3e ws2_32/tests: Add some tests for calling methods on a connecting socket.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-30 22:59:50 +02:00
Zebediah Figura c03d345ffc ws2_32/tests: Rewrite test_events().
Separate the tests by event type, make them much more exhaustive, and use a
simpler method of validating event sequences.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-30 22:59:50 +02:00
Zebediah Figura 055ed95a24 ws2_32/tests: Add some tests for bind().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-30 22:59:50 +02:00
Zebediah Figura b7c3135444 ws2_32/tests: Move namespace provider tests to protocol.c.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-29 10:48:59 +02:00
Zebediah Figura 8b20809354 ws2_32/tests: Move address/string conversion tests to protocol.c.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-29 10:48:59 +02:00
Zebediah Figura 29fafd5569 ws2_32/tests: Move service lookup tests to protocol.c.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-29 10:48:59 +02:00
Zebediah Figura 1699d4b785 ws2_32/tests: Move host lookup tests to protocol.c.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-29 10:48:59 +02:00
Zebediah Figura edd9ef9c27 ws2_32/tests: Move address lookup tests to protocol.c.
sock.c is huge. This doesn't bother some people, but I find that it can be
harder to navigate and slower to compile. Splitting it is tricky, but I think
there's a pretty natural divide between functions that operate on sockets
(e.g. bind, listen, recv, getsockname) and functions that don't (e.g.
get*info, inet_*, get*by*, WSC*).

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-29 10:48:59 +02:00
Zebediah Figura 904c05d3d3 include: Do not include winsock.h in winsock2.h.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-27 18:55:24 +02:00
Francois Gouget 6ccd501503 ws2_32/tests: Load GetHostNameW() dynamically.
It is not available on Windows 7 and lower.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-21 22:11:27 +02:00
Alexandre Julliard 50c40b913a ws2_32: Install network database files.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=12076
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-15 17:30:50 +02:00
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 e695982db3 ws2_32/tests: Don't fail the test in test_wsaioctl() if only one interface is available.
Fixes test failure on Testbot.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-17 10:46:45 +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 948e08152b ws2_32/tests: Skip some raw socket tests when missing elevated privileges.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-14 17:02:39 +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 b9f8adb243 server: Forbid accepting into the same socket more than once.
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 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 a0d386a310 ws2_32/tests: Fix an intermittent test failure on w10pro64.
Much like 2aebe0b628.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-19 11:36:18 +02:00
Zebediah Figura 0c249e6125 ws2_32/tests: Add more tests for passing short buffers to AcceptEx().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-16 22:05:40 +02:00
Zebediah Figura 2aebe0b628 ws2_32/tests: Fix a test failure on w10pro64.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-16 22:05:37 +02:00
Zebediah Figura ff8b5a51d7 ws2_32/tests: Remove workarounds from test_events().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-16 22:05:35 +02:00
Zebediah Figura 102c7903ea ws2_32/tests: Remove some workarounds for no longer supported versions of Windows.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-16 22:05:33 +02:00
Zebediah Figura d1461b622e ws2_32/tests: Rewrite the CF_DEFER test in test_AcceptEx().
The previous test in fact regularly failed on Windows, hidden by the
presence of broken(), since both sockets could be connected before the
listener was signaled.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-16 22:05:28 +02:00
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