ws2_32: Move the setsockopt(IP_HDRINCL) implementation to ntdll.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-07-07 20:16:39 -05:00 committed by Alexandre Julliard
parent 342795edb3
commit f0533d9a5a
4 changed files with 18 additions and 12 deletions

View file

@ -1745,6 +1745,9 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc
#ifdef IP_HDRINCL
case IOCTL_AFD_WINE_GET_IP_HDRINCL:
return do_getsockopt( handle, io, IPPROTO_IP, IP_HDRINCL, out_buffer, out_size );
case IOCTL_AFD_WINE_SET_IP_HDRINCL:
return do_setsockopt( handle, io, IPPROTO_IP, IP_HDRINCL, in_buffer, in_size );
#endif
default:

View file

@ -3643,6 +3643,9 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
case WS_IP_DROP_SOURCE_MEMBERSHIP:
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_DROP_SOURCE_MEMBERSHIP, optval, optlen );
case WS_IP_HDRINCL:
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_HDRINCL, optval, optlen );
case WS_IP_UNBLOCK_SOURCE:
{
WS_IP_MREQ_SOURCE* val = (void*)optval;
@ -3656,9 +3659,6 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
convert_sockopt(&level, &optname);
break;
}
#ifdef IP_HDRINCL
case WS_IP_HDRINCL:
#endif
case WS_IP_MULTICAST_IF:
case WS_IP_MULTICAST_LOOP:
case WS_IP_MULTICAST_TTL:

View file

@ -1431,29 +1431,31 @@ todo_wine
err = setsockopt(s, IPPROTO_IP, IP_HDRINCL, (char *) &k, size);
if (err == -1) /* >= Vista */
{
todo_wine {
ok(GetLastError() == WSAEINVAL, "Expected 10022, got %d\n", GetLastError());
k = 99;
SetLastError(0xdeadbeef);
err = getsockopt(s, IPPROTO_IP, IP_HDRINCL, (char *) &k, &size);
ok(err == -1, "Expected -1, got %d\n", err);
ok(GetLastError() == WSAEINVAL, "Expected 10022, got %d\n", GetLastError());
ok(k == 99, "Expected 99, got %d\n", k);
todo_wine
{
ok(err == -1, "Expected -1, got %d\n", err);
ok(GetLastError() == WSAEINVAL, "Expected 10022, got %d\n", GetLastError());
ok(k == 99, "Expected 99, got %d\n", k);
}
size = sizeof(k);
k = 0;
SetLastError(0xdeadbeef);
err = setsockopt(s, IPPROTO_IP, IP_HDRINCL, (char *) &k, size);
}
ok(err == -1, "Expected -1, got %d\n", err);
todo_wine {
ok(GetLastError() == WSAEINVAL, "Expected 10022, got %d\n", GetLastError());
k = 99;
SetLastError(0xdeadbeef);
err = getsockopt(s, IPPROTO_IP, IP_HDRINCL, (char *) &k, &size);
ok(err == -1, "Expected -1, got %d\n", err);
ok(GetLastError() == WSAEINVAL, "Expected 10022, got %d\n", GetLastError());
ok(k == 99, "Expected 99, got %d\n", k);
todo_wine
{
ok(err == -1, "Expected -1, got %d\n", err);
ok(GetLastError() == WSAEINVAL, "Expected 10022, got %d\n", GetLastError());
ok(k == 99, "Expected 99, got %d\n", k);
}
}
else /* <= 2003 the tests differ between TCP and UDP, UDP silently accepts */

View file

@ -189,6 +189,7 @@ struct afd_get_events_params
#define IOCTL_AFD_WINE_SET_IP_DROP_MEMBERSHIP WINE_AFD_IOC(244)
#define IOCTL_AFD_WINE_SET_IP_DROP_SOURCE_MEMBERSHIP WINE_AFD_IOC(245)
#define IOCTL_AFD_WINE_GET_IP_HDRINCL WINE_AFD_IOC(246)
#define IOCTL_AFD_WINE_SET_IP_HDRINCL WINE_AFD_IOC(247)
struct afd_create_params
{