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)
memset(&addr, 0xcc, sizeof(addr));
ret = NtDeviceIoControlFile((HANDLE)client, event, NULL, NULL, &io,
IOCTL_AFD_GETSOCKNAME, NULL, 0, &addr, sizeof(addr));
todo_wine ok(!ret, "got %#x\n", ret);
todo_wine ok(!io.Status, "got %#x\n", io.Status);
todo_wine ok(io.Information == sizeof(addr), "got %#Ix\n", io.Information);
ok(!ret, "got %#x\n", ret);
ok(!io.Status, "got %#x\n", io.Status);
ok(io.Information == sizeof(addr), "got %#Ix\n", io.Information);
len = sizeof(addr2);
ret = getsockname(client, (struct sockaddr *)&addr2, &len);
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);
......
......@@ -10292,7 +10292,7 @@ static void test_bind(void)
WSASetLastError(0xdeadbeef);
ret = bind(s, (const struct sockaddr *)&invalid_addr, sizeof(invalid_addr));
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);
ret = bind(s, (const struct sockaddr *)&bind_addr, sizeof(bind_addr));
......
......@@ -89,9 +89,6 @@
# undef if_indextoname
# undef if_nametoindex
#endif
#ifdef HAVE_LINUX_FILTER_H
# include <linux/filter.h>
#endif
#ifdef HAVE_IFADDRS_H
# include <ifaddrs.h>
#endif
......@@ -151,7 +148,6 @@
#include "winnt.h"
#define USE_WC_PREFIX /* For CMSG_DATA */
#include "iphlpapi.h"
#include "netioapi.h"
#include "ip2string.h"
#include "wine/afd.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