Zebediah Figura : server: Return void from the write callback.

Alexandre Julliard julliard at winehq.org
Fri Sep 3 16:25:30 CDT 2021


Module: wine
Branch: master
Commit: 377d18c7b117ba225dd555dbfac62b3d8af423f4
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=377d18c7b117ba225dd555dbfac62b3d8af423f4

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Thu Sep  2 19:08:52 2021 -0500

server: Return void from the write callback.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 server/console.c    | 18 +++++++++---------
 server/device.c     |  6 +++---
 server/fd.c         |  3 +--
 server/file.h       |  4 ++--
 server/named_pipe.c | 15 +++++++--------
 5 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/server/console.c b/server/console.c
index 597bff994a2..0080e6ed163 100644
--- a/server/console.c
+++ b/server/console.c
@@ -240,7 +240,7 @@ static const struct object_ops screen_buffer_ops =
     screen_buffer_destroy             /* destroy */
 };
 
-static int screen_buffer_write( struct fd *fd, struct async *async, file_pos_t pos );
+static void screen_buffer_write( struct fd *fd, struct async *async, file_pos_t pos );
 static int screen_buffer_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
 
 static const struct fd_ops screen_buffer_fd_ops =
@@ -381,7 +381,7 @@ static const struct object_ops console_output_ops =
     console_output_destroy            /* destroy */
 };
 
-static int console_output_write( struct fd *fd, struct async *async, file_pos_t pos );
+static void console_output_write( struct fd *fd, struct async *async, file_pos_t pos );
 static int console_output_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
 
 static const struct fd_ops console_output_fd_ops =
@@ -972,18 +972,18 @@ static int console_flush( struct fd *fd, struct async *async )
     return queue_host_ioctl( console->server, IOCTL_CONDRV_FLUSH, 0, NULL, NULL );
 }
 
-static int screen_buffer_write( struct fd *fd, struct async *async, file_pos_t pos )
+static void screen_buffer_write( struct fd *fd, struct async *async, file_pos_t pos )
 {
     struct screen_buffer *screen_buffer = get_fd_user( fd );
 
     if (!screen_buffer->input || !screen_buffer->input->server)
     {
         set_error( STATUS_INVALID_HANDLE );
-        return 0;
+        return;
     }
 
-    return queue_host_ioctl( screen_buffer->input->server, IOCTL_CONDRV_WRITE_FILE,
-                             screen_buffer->id, async, &screen_buffer->ioctl_q );
+    queue_host_ioctl( screen_buffer->input->server, IOCTL_CONDRV_WRITE_FILE,
+                      screen_buffer->id, async, &screen_buffer->ioctl_q );
 }
 
 static int screen_buffer_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
@@ -1421,16 +1421,16 @@ static int console_output_ioctl( struct fd *fd, ioctl_code_t code, struct async
     return screen_buffer_ioctl( console->active->fd, code, async );
 }
 
-static int console_output_write( struct fd *fd, struct async *async, file_pos_t pos )
+static void console_output_write( struct fd *fd, struct async *async, file_pos_t pos )
 {
     struct console *console = current->process->console;
 
     if (!console || !console->active)
     {
         set_error( STATUS_INVALID_HANDLE );
-        return 0;
+        return;
     }
-    return screen_buffer_write( console->active->fd, async, pos );
+    screen_buffer_write( console->active->fd, async, pos );
 }
 
 struct object *create_console_device( struct object *root, const struct unicode_str *name,
diff --git a/server/device.c b/server/device.c
index 4dd9213811a..cc3e0466468 100644
--- a/server/device.c
+++ b/server/device.c
@@ -202,7 +202,7 @@ static int device_file_close_handle( struct object *obj, struct process *process
 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 int device_file_write( 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 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 );
@@ -637,7 +637,7 @@ static void device_file_read( struct fd *fd, struct async *async, file_pos_t pos
     queue_irp( file, &params, async );
 }
 
-static int device_file_write( 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 )
 {
     struct device_file *file = get_fd_user( fd );
     irp_params_t params;
@@ -646,7 +646,7 @@ static int device_file_write( struct fd *fd, struct async *async, file_pos_t pos
     params.write.type = IRP_CALL_WRITE;
     params.write.key  = 0;
     params.write.pos  = pos;
-    return queue_irp( file, &params, async );
+    queue_irp( file, &params, async );
 }
 
 static int device_file_flush( struct fd *fd, struct async *async )
diff --git a/server/fd.c b/server/fd.c
index c2cab0da1fe..6b79585147d 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -2298,10 +2298,9 @@ void no_fd_read( struct fd *fd, struct async *async, file_pos_t pos )
 }
 
 /* default write() routine */
-int no_fd_write( struct fd *fd, struct async *async, file_pos_t pos )
+void no_fd_write( struct fd *fd, struct async *async, file_pos_t pos )
 {
     set_error( STATUS_OBJECT_TYPE_MISMATCH );
-    return 0;
 }
 
 /* default flush() routine */
diff --git a/server/file.h b/server/file.h
index e4b8422660a..e200281d03b 100644
--- a/server/file.h
+++ b/server/file.h
@@ -59,7 +59,7 @@ struct fd_ops
     /* perform a read on the file */
     void (*read)(struct fd *, struct async *, file_pos_t );
     /* perform a write on the file */
-    int (*write)(struct fd *, struct async *, file_pos_t );
+    void (*write)(struct fd *, struct async *, file_pos_t );
     /* flush the object buffers */
     int (*flush)(struct fd *, struct async *);
     /* query file info */
@@ -110,7 +110,7 @@ extern void fd_queue_async( struct fd *fd, struct async *async, int type );
 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 int no_fd_write( 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_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 );
diff --git a/server/named_pipe.c b/server/named_pipe.c
index b81e167ddfc..503dda93931 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -144,7 +144,7 @@ static int pipe_end_set_sd( struct object *obj, const struct security_descriptor
                             unsigned int set_info );
 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 int pipe_end_write( struct fd *fd, struct async *async_data, 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_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 );
@@ -923,7 +923,7 @@ static void pipe_end_read( struct fd *fd, struct async *async, file_pos_t pos )
     set_error( STATUS_PENDING );
 }
 
-static int pipe_end_write( struct fd *fd, struct async *async, file_pos_t pos )
+static void pipe_end_write( struct fd *fd, struct async *async, file_pos_t pos )
 {
     struct pipe_end *pipe_end = get_fd_user( fd );
     struct pipe_message *message;
@@ -935,27 +935,26 @@ static int pipe_end_write( struct fd *fd, struct async *async, file_pos_t pos )
         break;
     case FILE_PIPE_DISCONNECTED_STATE:
         set_error( STATUS_PIPE_DISCONNECTED );
-        return 0;
+        return;
     case FILE_PIPE_LISTENING_STATE:
         set_error( STATUS_PIPE_LISTENING );
-        return 0;
+        return;
     case FILE_PIPE_CLOSING_STATE:
         set_error( STATUS_PIPE_CLOSING );
-        return 0;
+        return;
     }
 
-    if (!pipe_end->pipe->message_mode && !get_req_data_size()) return 1;
+    if (!pipe_end->pipe->message_mode && !get_req_data_size()) return;
 
     iosb = async_get_iosb( async );
     message = queue_message( pipe_end->connection, iosb );
     release_object( iosb );
-    if (!message) return 0;
+    if (!message) return;
 
     message->async = (struct async *)grab_object( async );
     queue_async( &pipe_end->write_q, async );
     reselect_read_queue( pipe_end->connection, 1 );
     set_error( STATUS_PENDING );
-    return 1;
 }
 
 static void pipe_end_reselect_async( struct fd *fd, struct async_queue *queue )




More information about the wine-cvs mailing list