server: Return void from the flush callback.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-09-02 19:08:53 -05:00 committed by Alexandre Julliard
parent 377d18c7b1
commit a36e2769c9
5 changed files with 17 additions and 19 deletions

View File

@ -101,7 +101,7 @@ static enum server_fd_type console_get_fd_type( struct fd *fd );
static void console_get_file_info( struct fd *fd, obj_handle_t handle, unsigned int info_class );
static void console_get_volume_info( struct fd *fd, struct async *async, unsigned int info_class );
static void console_read( struct fd *fd, struct async *async, file_pos_t pos );
static int console_flush( struct fd *fd, struct async *async );
static void console_flush( struct fd *fd, struct async *async );
static int console_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
static const struct fd_ops console_fd_ops =
@ -326,7 +326,7 @@ static const struct object_ops console_input_ops =
};
static void console_input_read( struct fd *fd, struct async *async, file_pos_t pos );
static int console_input_flush( struct fd *fd, struct async *async );
static void console_input_flush( struct fd *fd, struct async *async );
static int console_input_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
static const struct fd_ops console_input_fd_ops =
@ -960,16 +960,16 @@ static void console_read( struct fd *fd, struct async *async, file_pos_t pos )
queue_host_ioctl( console->server, IOCTL_CONDRV_READ_FILE, 0, async, &console->ioctl_q );
}
static int console_flush( struct fd *fd, struct async *async )
static void console_flush( struct fd *fd, struct async *async )
{
struct console *console = get_fd_user( fd );
if (!console->server)
{
set_error( STATUS_INVALID_HANDLE );
return 0;
return;
}
return queue_host_ioctl( console->server, IOCTL_CONDRV_FLUSH, 0, NULL, NULL );
queue_host_ioctl( console->server, IOCTL_CONDRV_FLUSH, 0, NULL, NULL );
}
static void screen_buffer_write( struct fd *fd, struct async *async, file_pos_t pos )
@ -1361,16 +1361,16 @@ static void console_input_read( struct fd *fd, struct async *async, file_pos_t p
console_read( console->fd, async, pos );
}
static int console_input_flush( struct fd *fd, struct async *async )
static void console_input_flush( struct fd *fd, struct async *async )
{
struct console *console = current->process->console;
if (!console)
{
set_error( STATUS_INVALID_HANDLE );
return 0;
return;
}
return console_flush( console->fd, async );
console_flush( console->fd, async );
}
static void console_output_dump( struct object *obj, int verbose )

View File

@ -203,7 +203,7 @@ static void device_file_destroy( struct object *obj );
static enum server_fd_type device_file_get_fd_type( struct fd *fd );
static void device_file_read( struct fd *fd, struct async *async, file_pos_t pos );
static void device_file_write( struct fd *fd, struct async *async, file_pos_t pos );
static int device_file_flush( struct fd *fd, struct async *async );
static void device_file_flush( struct fd *fd, struct async *async );
static int device_file_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
static void device_file_reselect_async( struct fd *fd, struct async_queue *queue );
static void device_file_get_volume_info( struct fd *fd, struct async *async, unsigned int info_class );
@ -649,14 +649,14 @@ static void device_file_write( struct fd *fd, struct async *async, file_pos_t po
queue_irp( file, &params, async );
}
static int device_file_flush( struct fd *fd, struct async *async )
static void device_file_flush( struct fd *fd, struct async *async )
{
struct device_file *file = get_fd_user( fd );
irp_params_t params;
memset( &params, 0, sizeof(params) );
params.flush.type = IRP_CALL_FLUSH;
return queue_irp( file, &params, async );
queue_irp( file, &params, async );
}
static int device_file_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )

View File

@ -2304,10 +2304,9 @@ void no_fd_write( struct fd *fd, struct async *async, file_pos_t pos )
}
/* default flush() routine */
int no_fd_flush( struct fd *fd, struct async *async )
void no_fd_flush( struct fd *fd, struct async *async )
{
set_error( STATUS_OBJECT_TYPE_MISMATCH );
return 0;
}
/* default get_file_info() routine */

View File

@ -61,7 +61,7 @@ struct fd_ops
/* perform a write on the file */
void (*write)(struct fd *, struct async *, file_pos_t );
/* flush the object buffers */
int (*flush)(struct fd *, struct async *);
void (*flush)(struct fd *, struct async *);
/* query file info */
void (*get_file_info)( struct fd *, obj_handle_t, unsigned int );
/* query volume info */
@ -111,7 +111,7 @@ extern void fd_async_wake_up( struct fd *fd, int type, unsigned int status );
extern void fd_reselect_async( struct fd *fd, struct async_queue *queue );
extern void no_fd_read( struct fd *fd, struct async *async, file_pos_t pos );
extern void no_fd_write( struct fd *fd, struct async *async, file_pos_t pos );
extern int no_fd_flush( struct fd *fd, struct async *async );
extern void no_fd_flush( struct fd *fd, struct async *async );
extern void no_fd_get_file_info( struct fd *fd, obj_handle_t handle, unsigned int info_class );
extern void default_fd_get_file_info( struct fd *fd, obj_handle_t handle, unsigned int info_class );
extern void no_fd_get_volume_info( struct fd *fd, struct async *async, unsigned int info_class );

View File

@ -145,7 +145,7 @@ static int pipe_end_set_sd( struct object *obj, const struct security_descriptor
static WCHAR *pipe_end_get_full_name( struct object *obj, data_size_t *len );
static void pipe_end_read( struct fd *fd, struct async *async, file_pos_t pos );
static void pipe_end_write( struct fd *fd, struct async *async_data, file_pos_t pos );
static int pipe_end_flush( struct fd *fd, struct async *async );
static void pipe_end_flush( struct fd *fd, struct async *async );
static void pipe_end_get_volume_info( struct fd *fd, struct async *async, unsigned int info_class );
static void pipe_end_reselect_async( struct fd *fd, struct async_queue *queue );
static void pipe_end_get_file_info( struct fd *fd, obj_handle_t handle, unsigned int info_class );
@ -578,14 +578,14 @@ static void named_pipe_device_file_destroy( struct object *obj )
release_object( file->device );
}
static int pipe_end_flush( struct fd *fd, struct async *async )
static void pipe_end_flush( struct fd *fd, struct async *async )
{
struct pipe_end *pipe_end = get_fd_user( fd );
if (!pipe_end->pipe)
{
set_error( STATUS_PIPE_DISCONNECTED );
return 0;
return;
}
if (pipe_end->connection && !list_empty( &pipe_end->connection->message_queue ))
@ -593,7 +593,6 @@ static int pipe_end_flush( struct fd *fd, struct async *async )
fd_queue_async( pipe_end->fd, async, ASYNC_TYPE_WAIT );
set_error( STATUS_PENDING );
}
return 1;
}
static void pipe_end_get_file_info( struct fd *fd, obj_handle_t handle, unsigned int info_class )