server: Introduce IOCTL_AFD_WINE_GET_INFO.

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-20 11:05:55 -05:00 committed by Alexandre Julliard
parent 414b31bc0b
commit a4b3ed9f2a
2 changed files with 23 additions and 0 deletions

View File

@ -158,6 +158,7 @@ struct afd_get_events_params
#define IOCTL_AFD_WINE_MESSAGE_SELECT CTL_CODE(FILE_DEVICE_NETWORK, 215, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_AFD_WINE_GETPEERNAME CTL_CODE(FILE_DEVICE_NETWORK, 216, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_AFD_WINE_DEFER CTL_CODE(FILE_DEVICE_NETWORK, 217, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_AFD_WINE_GET_INFO CTL_CODE(FILE_DEVICE_NETWORK, 218, METHOD_BUFFERED, FILE_ANY_ACCESS)
struct afd_create_params
{
@ -218,4 +219,9 @@ struct afd_message_select_params
int mask;
};
struct afd_get_info_params
{
int family, type, protocol;
};
#endif

View File

@ -2515,6 +2515,23 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
return 1;
}
case IOCTL_AFD_WINE_GET_INFO:
{
struct afd_get_info_params params;
if (get_reply_max_size() < sizeof(params))
{
set_error( STATUS_BUFFER_TOO_SMALL );
return 0;
}
params.family = sock->family;
params.type = sock->type;
params.protocol = sock->proto;
set_reply_data( &params, sizeof(params) );
return 0;
}
default:
set_error( STATUS_NOT_SUPPORTED );
return 0;