Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ws2_32/tests/afd.c | 2 +- server/sock.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/ws2_32/tests/afd.c b/dlls/ws2_32/tests/afd.c index d4633f7a8bb..eb4f0a42f8d 100644 --- a/dlls/ws2_32/tests/afd.c +++ b/dlls/ws2_32/tests/afd.c @@ -1407,7 +1407,7 @@ static void test_bind(void)
ret = NtDeviceIoControlFile((HANDLE)s, event, NULL, NULL, &io, IOCTL_AFD_BIND, ¶ms, sizeof(params), &addr, sizeof(addr)); - todo_wine ok(ret == STATUS_ADDRESS_ALREADY_ASSOCIATED, "got %#x\n", ret); + ok(ret == STATUS_ADDRESS_ALREADY_ASSOCIATED, "got %#x\n", ret);
s2 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
diff --git a/server/sock.c b/server/sock.c index 8cd3475d7b2..6b0c4af6b11 100644 --- a/server/sock.c +++ b/server/sock.c @@ -2405,6 +2405,12 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) return 0; }
+ if (sock->bound) + { + set_error( STATUS_ADDRESS_ALREADY_ASSOCIATED ); + return 0; + } + unix_len = sockaddr_to_unix( ¶ms->addr, in_size - sizeof(int), &unix_addr ); if (!unix_len) {