server: Don't rely on async_is_blocking() to determine whether IOCTL_AFD_WINE_ADDRESS_LIST_CHANGE should block.

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-04 16:24:18 -05:00 committed by Alexandre Julliard
parent 0e05a7f8cd
commit 8c26fca5c2
4 changed files with 14 additions and 8 deletions

View File

@ -3639,9 +3639,10 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
case WS_SIO_ADDRESS_LIST_CHANGE:
{
int force_async = !!overlapped;
DWORD ret;
ret = server_ioctl_sock( s, IOCTL_AFD_WINE_ADDRESS_LIST_CHANGE, in_buff, in_size,
ret = server_ioctl_sock( s, IOCTL_AFD_WINE_ADDRESS_LIST_CHANGE, &force_async, sizeof(force_async),
out_buff, out_size, ret_size, overlapped, completion );
SetLastError( ret );
return ret ? -1 : 0;

View File

@ -557,11 +557,6 @@ struct thread *async_get_thread( struct async *async )
return async->thread;
}
int async_is_blocking( struct async *async )
{
return !async->event && !async->data.apc && !async->data.apc_context;
}
/* find the first pending async in queue */
struct async *find_pending_async( struct async_queue *queue )
{

View File

@ -232,7 +232,6 @@ extern void fd_copy_completion( struct fd *src, struct fd *dst );
extern struct iosb *create_iosb( const void *in_data, data_size_t in_size, data_size_t out_size );
extern struct iosb *async_get_iosb( struct async *async );
extern struct thread *async_get_thread( struct async *async );
extern int async_is_blocking( struct async *async );
extern struct async *find_pending_async( struct async_queue *queue );
extern void cancel_process_asyncs( struct process *process );

View File

@ -1882,7 +1882,17 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
}
case IOCTL_AFD_WINE_ADDRESS_LIST_CHANGE:
if ((sock->state & FD_WINE_NONBLOCKING) && async_is_blocking( async ))
{
int force_async;
if (get_req_data_size() < sizeof(int))
{
set_error( STATUS_BUFFER_TOO_SMALL );
return 0;
}
force_async = *(int *)get_req_data();
if ((sock->state & FD_WINE_NONBLOCKING) && !force_async)
{
set_error( STATUS_DEVICE_NOT_READY );
return 0;
@ -1891,6 +1901,7 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
queue_async( &sock->ifchange_q, async );
set_error( STATUS_PENDING );
return 1;
}
case IOCTL_AFD_WINE_FIONBIO:
if (get_req_data_size() < sizeof(int))