server: Remove no longer needed need_handle from queue_irp.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-06-26 12:20:27 +02:00 committed by Alexandre Julliard
parent 10c1f245e4
commit 84bc9c3d56
1 changed files with 7 additions and 15 deletions

View File

@ -462,22 +462,14 @@ static void set_file_user_ptr( struct device_file *file, client_ptr_t ptr )
}
/* queue an irp to the device */
static obj_handle_t queue_irp( struct device_file *file, struct irp_call *irp, struct async *async, int need_handle )
static int queue_irp( struct device_file *file, struct irp_call *irp, struct async *async )
{
obj_handle_t handle = 0;
if (!fd_queue_async( file->fd, async, ASYNC_TYPE_WAIT )) return 0;
if (!need_handle) handle = 1;
else if (async_is_blocking( async ) && !(handle = alloc_handle( current->process, async, SYNCHRONIZE, 0 ))) return 0;
if (!fd_queue_async( file->fd, async, ASYNC_TYPE_WAIT ))
{
if (need_handle && handle) close_handle( current->process, handle );
return 0;
}
irp->async = (struct async *)grab_object( async );
add_irp_to_queue( file, irp, current );
set_error( STATUS_PENDING );
return handle;
return 1;
}
static enum server_fd_type device_file_get_fd_type( struct fd *fd )
@ -501,7 +493,7 @@ static int device_file_read( struct fd *fd, struct async *async, file_pos_t pos
irp = create_irp( file, &params, async );
if (!irp) return 0;
handle = queue_irp( file, irp, async, 0 );
handle = queue_irp( file, irp, async );
release_object( irp );
return handle;
}
@ -522,7 +514,7 @@ static int device_file_write( struct fd *fd, struct async *async, file_pos_t pos
irp = create_irp( file, &params, async );
if (!irp) return 0;
handle = queue_irp( file, irp, async, 0 );
handle = queue_irp( file, irp, async );
release_object( irp );
return handle;
}
@ -541,7 +533,7 @@ static int device_file_flush( struct fd *fd, struct async *async )
irp = create_irp( file, &params, NULL );
if (!irp) return 0;
handle = queue_irp( file, irp, async, 0 );
handle = queue_irp( file, irp, async );
release_object( irp );
return handle;
}
@ -561,7 +553,7 @@ static int device_file_ioctl( struct fd *fd, ioctl_code_t code, struct async *as
irp = create_irp( file, &params, async );
if (!irp) return 0;
handle = queue_irp( file, irp, async, 0 );
handle = queue_irp( file, irp, async );
release_object( irp );
return handle;
}