server: Introduce async_is_blocking helper and use it in sock_ioctl.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5af62255ef
commit
5c8d11270d
|
@ -472,6 +472,11 @@ struct iosb *async_get_iosb( struct async *async )
|
||||||
return async->iosb ? (struct iosb *)grab_object( async->iosb ) : NULL;
|
return async->iosb ? (struct iosb *)grab_object( async->iosb ) : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -187,6 +187,7 @@ extern struct completion *fd_get_completion( struct fd *fd, apc_param_t *p_key )
|
||||||
extern void fd_copy_completion( struct fd *src, struct fd *dst );
|
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 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 );
|
||||||
|
|
||||||
|
|
|
@ -545,14 +545,14 @@ obj_handle_t sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async,
|
||||||
switch(code)
|
switch(code)
|
||||||
{
|
{
|
||||||
case WS_SIO_ADDRESS_LIST_CHANGE:
|
case WS_SIO_ADDRESS_LIST_CHANGE:
|
||||||
if ((sock->state & FD_WINE_NONBLOCKING) && blocking)
|
if ((sock->state & FD_WINE_NONBLOCKING) && async_is_blocking( async ))
|
||||||
{
|
{
|
||||||
set_error( STATUS_CANT_WAIT );
|
set_error( STATUS_CANT_WAIT );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (!(ifchange_q = sock_get_ifchange_q( sock ))) return 0;
|
if (!(ifchange_q = sock_get_ifchange_q( sock ))) return 0;
|
||||||
queue_async( ifchange_q, async );
|
queue_async( ifchange_q, async );
|
||||||
if (blocking) wait_handle = alloc_handle( current->process, async, SYNCHRONIZE, 0 );
|
if (async_is_blocking( async )) wait_handle = alloc_handle( current->process, async, SYNCHRONIZE, 0 );
|
||||||
set_error( STATUS_PENDING );
|
set_error( STATUS_PENDING );
|
||||||
return wait_handle;
|
return wait_handle;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue