mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 15:55:03 +00:00
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:
parent
0e05a7f8cd
commit
8c26fca5c2
|
@ -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;
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue