server: Introduce IOCTL_AFD_WINE_SET_SO_RCVBUF.

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-25 20:21:05 -05:00 committed by Alexandre Julliard
parent 8dfcc1e3bc
commit b83a8b2da5
2 changed files with 17 additions and 0 deletions

View File

@ -169,6 +169,7 @@ struct afd_get_events_params
#define IOCTL_AFD_WINE_SET_SO_LINGER CTL_CODE(FILE_DEVICE_NETWORK, 226, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_AFD_WINE_GET_SO_OOBINLINE CTL_CODE(FILE_DEVICE_NETWORK, 227, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_AFD_WINE_SET_SO_OOBINLINE CTL_CODE(FILE_DEVICE_NETWORK, 228, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_AFD_WINE_SET_SO_RCVBUF CTL_CODE(FILE_DEVICE_NETWORK, 229, METHOD_BUFFERED, FILE_ANY_ACCESS)
struct afd_create_params
{

View File

@ -2580,6 +2580,22 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
return 1;
}
case IOCTL_AFD_WINE_SET_SO_RCVBUF:
{
DWORD rcvbuf;
if (get_req_data_size() < sizeof(rcvbuf))
{
set_error( STATUS_BUFFER_TOO_SMALL );
return 0;
}
rcvbuf = *(DWORD *)get_req_data();
if (setsockopt( unix_fd, SOL_SOCKET, SO_RCVBUF, (char *)&rcvbuf, sizeof(rcvbuf) ) < 0)
set_error( sock_get_ntstatus( errno ) );
return 0;
}
default:
set_error( STATUS_NOT_SUPPORTED );
return 0;