server: Introduce IOCTL_AFD_WINE_SET_SO_SNDBUF.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-06-29 23:25:39 -05:00 committed by Alexandre Julliard
parent 7f1623bc62
commit a0bb5564eb
2 changed files with 25 additions and 0 deletions

View File

@ -175,6 +175,7 @@ struct afd_get_events_params
#define IOCTL_AFD_WINE_GET_SO_RCVTIMEO CTL_CODE(FILE_DEVICE_NETWORK, 232, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_AFD_WINE_GET_SO_REUSEADDR CTL_CODE(FILE_DEVICE_NETWORK, 233, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_AFD_WINE_SET_SO_REUSEADDR CTL_CODE(FILE_DEVICE_NETWORK, 234, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_AFD_WINE_SET_SO_SNDBUF CTL_CODE(FILE_DEVICE_NETWORK, 235, METHOD_BUFFERED, FILE_ANY_ACCESS)
struct afd_create_params
{

View File

@ -2650,6 +2650,30 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
return 0;
}
case IOCTL_AFD_WINE_SET_SO_SNDBUF:
{
DWORD sndbuf;
if (get_req_data_size() < sizeof(sndbuf))
{
set_error( STATUS_BUFFER_TOO_SMALL );
return 0;
}
sndbuf = *(DWORD *)get_req_data();
#ifdef __APPLE__
if (!sndbuf)
{
/* setsockopt fails if a zero value is passed */
return 0;
}
#endif
if (setsockopt( unix_fd, SOL_SOCKET, SO_SNDBUF, (char *)&sndbuf, sizeof(sndbuf) ) < 0)
set_error( sock_get_ntstatus( errno ) );
return 0;
}
default:
set_error( STATUS_NOT_SUPPORTED );
return 0;