Commit 5c009c17 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ws2_32: Reimplement bind() and getsockname() on top of IOCTL_AFD_BIND and…

ws2_32: Reimplement bind() and getsockname() on top of IOCTL_AFD_BIND and IOCTL_AFD_GETSOCKNAME respectively. Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent a997c398
...@@ -1549,13 +1549,13 @@ static void test_getsockname(void) ...@@ -1549,13 +1549,13 @@ static void test_getsockname(void)
memset(&addr, 0xcc, sizeof(addr)); memset(&addr, 0xcc, sizeof(addr));
ret = NtDeviceIoControlFile((HANDLE)client, event, NULL, NULL, &io, ret = NtDeviceIoControlFile((HANDLE)client, event, NULL, NULL, &io,
IOCTL_AFD_GETSOCKNAME, NULL, 0, &addr, sizeof(addr)); IOCTL_AFD_GETSOCKNAME, NULL, 0, &addr, sizeof(addr));
todo_wine ok(!ret, "got %#x\n", ret); ok(!ret, "got %#x\n", ret);
todo_wine ok(!io.Status, "got %#x\n", io.Status); ok(!io.Status, "got %#x\n", io.Status);
todo_wine ok(io.Information == sizeof(addr), "got %#Ix\n", io.Information); ok(io.Information == sizeof(addr), "got %#Ix\n", io.Information);
len = sizeof(addr2); len = sizeof(addr2);
ret = getsockname(client, (struct sockaddr *)&addr2, &len); ret = getsockname(client, (struct sockaddr *)&addr2, &len);
ok(!ret, "got error %u\n", WSAGetLastError()); ok(!ret, "got error %u\n", WSAGetLastError());
todo_wine ok(!memcmp(&addr, &addr2, sizeof(struct sockaddr)), "addresses didn't match\n"); ok(!memcmp(&addr, &addr2, sizeof(struct sockaddr)), "addresses didn't match\n");
closesocket(client); closesocket(client);
......
...@@ -10292,7 +10292,7 @@ static void test_bind(void) ...@@ -10292,7 +10292,7 @@ static void test_bind(void)
WSASetLastError(0xdeadbeef); WSASetLastError(0xdeadbeef);
ret = bind(s, (const struct sockaddr *)&invalid_addr, sizeof(invalid_addr)); ret = bind(s, (const struct sockaddr *)&invalid_addr, sizeof(invalid_addr));
ok(ret == -1, "expected failure\n"); ok(ret == -1, "expected failure\n");
todo_wine ok(WSAGetLastError() == WSAEADDRNOTAVAIL, "got error %u\n", WSAGetLastError()); ok(WSAGetLastError() == WSAEADDRNOTAVAIL, "got error %u\n", WSAGetLastError());
WSASetLastError(0xdeadbeef); WSASetLastError(0xdeadbeef);
ret = bind(s, (const struct sockaddr *)&bind_addr, sizeof(bind_addr)); ret = bind(s, (const struct sockaddr *)&bind_addr, sizeof(bind_addr));
......
...@@ -89,9 +89,6 @@ ...@@ -89,9 +89,6 @@
# undef if_indextoname # undef if_indextoname
# undef if_nametoindex # undef if_nametoindex
#endif #endif
#ifdef HAVE_LINUX_FILTER_H
# include <linux/filter.h>
#endif
#ifdef HAVE_IFADDRS_H #ifdef HAVE_IFADDRS_H
# include <ifaddrs.h> # include <ifaddrs.h>
#endif #endif
...@@ -151,7 +148,6 @@ ...@@ -151,7 +148,6 @@
#include "winnt.h" #include "winnt.h"
#define USE_WC_PREFIX /* For CMSG_DATA */ #define USE_WC_PREFIX /* For CMSG_DATA */
#include "iphlpapi.h" #include "iphlpapi.h"
#include "netioapi.h"
#include "ip2string.h" #include "ip2string.h"
#include "wine/afd.h" #include "wine/afd.h"
#include "wine/server.h" #include "wine/server.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment