Commit 8c26fca5 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

server: Don't rely on async_is_blocking() to determine whether…

server: Don't rely on async_is_blocking() to determine whether IOCTL_AFD_WINE_ADDRESS_LIST_CHANGE should block. Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 0e05a7f8
...@@ -3639,9 +3639,10 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID ...@@ -3639,9 +3639,10 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
case WS_SIO_ADDRESS_LIST_CHANGE: case WS_SIO_ADDRESS_LIST_CHANGE:
{ {
int force_async = !!overlapped;
DWORD ret; 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 ); out_buff, out_size, ret_size, overlapped, completion );
SetLastError( ret ); SetLastError( ret );
return ret ? -1 : 0; return ret ? -1 : 0;
......
...@@ -557,11 +557,6 @@ struct thread *async_get_thread( struct async *async ) ...@@ -557,11 +557,6 @@ struct thread *async_get_thread( struct async *async )
return async->thread; 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 */ /* find the first pending async in queue */
struct async *find_pending_async( struct async_queue *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 ); ...@@ -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 *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 iosb *async_get_iosb( struct async *async );
extern struct thread *async_get_thread( 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 struct async *find_pending_async( struct async_queue *queue );
extern void cancel_process_asyncs( struct process *process ); 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 ) ...@@ -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: 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 ); set_error( STATUS_DEVICE_NOT_READY );
return 0; return 0;
...@@ -1891,6 +1901,7 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) ...@@ -1891,6 +1901,7 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
queue_async( &sock->ifchange_q, async ); queue_async( &sock->ifchange_q, async );
set_error( STATUS_PENDING ); set_error( STATUS_PENDING );
return 1; return 1;
}
case IOCTL_AFD_WINE_FIONBIO: case IOCTL_AFD_WINE_FIONBIO:
if (get_req_data_size() < sizeof(int)) if (get_req_data_size() < sizeof(int))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment