From 576d7e24cd3d66060d33d04b86758c3c5be95561 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard <julliard@winehq.org> Date: Fri, 15 Nov 2024 16:24:15 +0100 Subject: [PATCH] server: Use an explicit struct instead of a typedef for async I/O data. --- dlls/ntdll/unix/unix_private.h | 6 +++--- include/wine/server_protocol.h | 22 +++++++++++----------- server/async.c | 6 +++--- server/file.h | 4 ++-- server/protocol.def | 22 +++++++++++----------- server/request_handlers.h | 2 +- server/request_trace.h | 2 +- server/trace.c | 2 +- tools/make_requests | 2 +- 9 files changed, 34 insertions(+), 34 deletions(-) diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index ac55cd7894c..fe49ee4efd0 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -436,10 +436,10 @@ static inline void mutex_unlock( pthread_mutex_t *mutex ) if (!process_exiting) pthread_mutex_unlock( mutex ); } -static inline async_data_t server_async( HANDLE handle, struct async_fileio *user, HANDLE event, - PIO_APC_ROUTINE apc, void *apc_context, client_ptr_t iosb ) +static inline struct async_data server_async( HANDLE handle, struct async_fileio *user, HANDLE event, + PIO_APC_ROUTINE apc, void *apc_context, client_ptr_t iosb ) { - async_data_t async; + struct async_data async; async.handle = wine_server_obj_handle( handle ); async.user = wine_server_client_ptr( user ); async.iosb = iosb; diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 42f14538946..430ccc965a6 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -260,7 +260,7 @@ typedef struct } rectangle_t; -typedef struct +struct async_data { obj_handle_t handle; obj_handle_t event; @@ -268,7 +268,7 @@ typedef struct client_ptr_t user; client_ptr_t apc; apc_param_t apc_context; -} async_data_t; +}; @@ -1829,7 +1829,7 @@ struct flush_request { struct request_header __header; char __pad_12[4]; - async_data_t async; + struct async_data async; }; struct flush_reply { @@ -1857,7 +1857,7 @@ struct get_volume_info_request { struct request_header __header; obj_handle_t handle; - async_data_t async; + struct async_data async; unsigned int info_class; char __pad_60[4]; }; @@ -1906,7 +1906,7 @@ struct recv_socket_request { struct request_header __header; int oob; - async_data_t async; + struct async_data async; int force_async; char __pad_60[4]; }; @@ -1925,7 +1925,7 @@ struct send_socket_request { struct request_header __header; unsigned int flags; - async_data_t async; + struct async_data async; }; struct send_socket_reply { @@ -2016,7 +2016,7 @@ struct read_directory_changes_request unsigned int filter; int subtree; int want_data; - async_data_t async; + struct async_data async; }; struct read_directory_changes_reply { @@ -3152,7 +3152,7 @@ struct register_async_request { struct request_header __header; int type; - async_data_t async; + struct async_data async; int count; char __pad_60[4]; }; @@ -3216,7 +3216,7 @@ struct read_request { struct request_header __header; char __pad_12[4]; - async_data_t async; + struct async_data async; file_pos_t pos; }; struct read_reply @@ -3233,7 +3233,7 @@ struct write_request { struct request_header __header; char __pad_12[4]; - async_data_t async; + struct async_data async; file_pos_t pos; /* VARARG(data,bytes); */ }; @@ -3252,7 +3252,7 @@ struct ioctl_request { struct request_header __header; ioctl_code_t code; - async_data_t async; + struct async_data async; /* VARARG(in_data,bytes); */ }; struct ioctl_reply diff --git a/server/async.c b/server/async.c index 3e7ef9b3d80..d2d929c9709 100644 --- a/server/async.c +++ b/server/async.c @@ -45,7 +45,7 @@ struct async struct timeout_user *timeout; unsigned int timeout_status; /* status to report upon timeout */ struct event *event; - async_data_t data; /* data for async I/O call */ + struct async_data data; /* data for async I/O call */ struct iosb *iosb; /* I/O status block */ obj_handle_t wait_handle; /* pre-allocated wait handle */ unsigned int initial_status; /* status returned from initial request */ @@ -248,7 +248,7 @@ void queue_async( struct async_queue *queue, struct async *async ) } /* create an async on a given queue of a fd */ -struct async *create_async( struct fd *fd, struct thread *thread, const async_data_t *data, struct iosb *iosb ) +struct async *create_async( struct fd *fd, struct thread *thread, const struct async_data *data, struct iosb *iosb ) { struct event *event = NULL; struct async *async; @@ -753,7 +753,7 @@ static struct iosb *create_iosb( const void *in_data, data_size_t in_size, data_ /* create an async associated with iosb for async-based requests * returned async must be passed to async_handoff */ -struct async *create_request_async( struct fd *fd, unsigned int comp_flags, const async_data_t *data, int is_system ) +struct async *create_request_async( struct fd *fd, unsigned int comp_flags, const struct async_data *data, int is_system ) { struct async *async; struct iosb *iosb; diff --git a/server/file.h b/server/file.h index eb4eff96575..a238a6a2b90 100644 --- a/server/file.h +++ b/server/file.h @@ -252,8 +252,8 @@ extern struct object *create_serial( struct fd *fd ); typedef void (*async_completion_callback)( void *private ); extern void free_async_queue( struct async_queue *queue ); -extern struct async *create_async( struct fd *fd, struct thread *thread, const async_data_t *data, struct iosb *iosb ); -extern struct async *create_request_async( struct fd *fd, unsigned int comp_flags, const async_data_t *data, +extern struct async *create_async( struct fd *fd, struct thread *thread, const struct async_data *data, struct iosb *iosb ); +extern struct async *create_request_async( struct fd *fd, unsigned int comp_flags, const struct async_data *data, int is_system ); extern obj_handle_t async_handoff( struct async *async, data_size_t *result, int force_blocking ); extern void queue_async( struct async_queue *queue, struct async *async ); diff --git a/server/protocol.def b/server/protocol.def index 20ba868c32a..16f33a3e658 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -276,7 +276,7 @@ typedef struct } rectangle_t; /* structure for parameters of async I/O calls */ -typedef struct +struct async_data { obj_handle_t handle; /* object to perform I/O on */ obj_handle_t event; /* event to signal when done */ @@ -284,7 +284,7 @@ typedef struct client_ptr_t user; /* opaque user data containing callback pointer and async-specific data */ client_ptr_t apc; /* user APC to call */ apc_param_t apc_context; /* user APC context or completion value */ -} async_data_t; +}; /* structures for extra message data */ @@ -1539,7 +1539,7 @@ enum server_fd_type /* Flush a file buffers */ @REQ(flush) - async_data_t async; /* async I/O parameters */ + struct async_data async; /* async I/O parameters */ @REPLY obj_handle_t event; /* event set when finished */ @END @@ -1555,7 +1555,7 @@ enum server_fd_type /* Query volume information */ @REQ(get_volume_info) obj_handle_t handle; /* handle to the file */ - async_data_t async; /* async I/O parameters */ + struct async_data async; /* async I/O parameters */ unsigned int info_class; /* queried information class */ @REPLY obj_handle_t wait; /* handle to wait on for blocking read */ @@ -1586,7 +1586,7 @@ enum server_fd_type /* Perform a recv on a socket */ @REQ(recv_socket) int oob; /* are we receiving OOB data? */ - async_data_t async; /* async I/O parameters */ + struct async_data async; /* async I/O parameters */ int force_async; /* Force asynchronous mode? */ @REPLY obj_handle_t wait; /* handle to wait on for blocking recv */ @@ -1598,7 +1598,7 @@ enum server_fd_type /* Perform a send on a socket */ @REQ(send_socket) unsigned int flags; /* SERVER_SOCKET_IO_* flags */ - async_data_t async; /* async I/O parameters */ + struct async_data async; /* async I/O parameters */ @REPLY obj_handle_t wait; /* handle to wait on for blocking send */ unsigned int options; /* device open options */ @@ -1656,7 +1656,7 @@ enum server_fd_type unsigned int filter; /* notification filter */ int subtree; /* watch the subtree? */ int want_data; /* flag indicating whether change data should be collected */ - async_data_t async; /* async I/O parameters */ + struct async_data async; /* async I/O parameters */ @END @@ -2355,7 +2355,7 @@ enum message_type /* Create an async I/O */ @REQ(register_async) int type; /* type of queue to look after */ - async_data_t async; /* async I/O parameters */ + struct async_data async; /* async I/O parameters */ int count; /* count - usually # of bytes to be read/written */ @END #define ASYNC_TYPE_READ 0x01 @@ -2392,7 +2392,7 @@ enum message_type /* Perform a read on a file object */ @REQ(read) - async_data_t async; /* async I/O parameters */ + struct async_data async; /* async I/O parameters */ file_pos_t pos; /* read position */ @REPLY obj_handle_t wait; /* handle to wait on for blocking read */ @@ -2403,7 +2403,7 @@ enum message_type /* Perform a write on a file object */ @REQ(write) - async_data_t async; /* async I/O parameters */ + struct async_data async; /* async I/O parameters */ file_pos_t pos; /* write position */ VARARG(data,bytes); /* write data */ @REPLY @@ -2416,7 +2416,7 @@ enum message_type /* Perform an ioctl on a file */ @REQ(ioctl) ioctl_code_t code; /* ioctl code */ - async_data_t async; /* async I/O parameters */ + struct async_data async; /* async I/O parameters */ VARARG(in_data,bytes); /* ioctl input data */ @REPLY obj_handle_t wait; /* handle to wait on for blocking ioctl */ diff --git a/server/request_handlers.h b/server/request_handlers.h index 8469f502b10..d4fbfb34ca7 100644 --- a/server/request_handlers.h +++ b/server/request_handlers.h @@ -598,7 +598,6 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] = C_ASSERT( sizeof(abstime_t) == 8 ); C_ASSERT( sizeof(affinity_t) == 8 ); C_ASSERT( sizeof(apc_param_t) == 8 ); -C_ASSERT( sizeof(async_data_t) == 40 ); C_ASSERT( sizeof(atom_t) == 4 ); C_ASSERT( sizeof(char) == 1 ); C_ASSERT( sizeof(client_ptr_t) == 8 ); @@ -626,6 +625,7 @@ C_ASSERT( sizeof(rectangle_t) == 16 ); C_ASSERT( sizeof(select_op_t) == 264 ); C_ASSERT( sizeof(short int) == 2 ); C_ASSERT( sizeof(startup_info_t) == 96 ); +C_ASSERT( sizeof(struct async_data) == 40 ); C_ASSERT( sizeof(struct filesystem_event) == 12 ); C_ASSERT( sizeof(struct handle_info) == 20 ); C_ASSERT( sizeof(struct luid) == 8 ); diff --git a/server/request_trace.h b/server/request_trace.h index da7cc60591d..bd6d89f6205 100644 --- a/server/request_trace.h +++ b/server/request_trace.h @@ -7,7 +7,7 @@ static void dump_abstime( const char *prefix, const abstime_t *val ); static void dump_apc_result( const char *prefix, const union apc_result *val ); -static void dump_async_data( const char *prefix, const async_data_t *val ); +static void dump_async_data( const char *prefix, const struct async_data *val ); static void dump_generic_map( const char *prefix, const generic_map_t *val ); static void dump_hw_input( const char *prefix, const hw_input_t *val ); static void dump_ioctl_code( const char *prefix, const ioctl_code_t *val ); diff --git a/server/trace.c b/server/trace.c index b1206d7d2cb..fbc3683208e 100644 --- a/server/trace.c +++ b/server/trace.c @@ -377,7 +377,7 @@ static void dump_apc_result( const char *prefix, const union apc_result *result fputc( '}', stderr ); } -static void dump_async_data( const char *prefix, const async_data_t *data ) +static void dump_async_data( const char *prefix, const struct async_data *data ) { fprintf( stderr, "%s{handle=%04x,event=%04x", prefix, data->handle, data->event ); dump_uint64( ",iosb=", &data->iosb ); diff --git a/tools/make_requests b/tools/make_requests index e9b58dab879..2eaffe30c0b 100755 --- a/tools/make_requests +++ b/tools/make_requests @@ -38,7 +38,6 @@ my %formats = "timeout_t" => [ 8, 8 ], "abstime_t" => [ 8, 8 ], "rectangle_t" => [ 16, 4 ], - "async_data_t" => [ 40, 8 ], "irp_params_t" => [ 32, 8 ], "generic_map_t" => [ 16, 4 ], "ioctl_code_t" => [ 4, 4 ], @@ -57,6 +56,7 @@ my %formats = "udp_endpoint" => [ 32, 4 ], "union apc_call" => [ 64, 8 ], "union apc_result" => [ 40, 8 ], + "struct async_data" => [ 40, 8 ], "struct filesystem_event" => [ 12, 4 ], "struct handle_info" => [ 20, 4 ], "struct luid" => [ 8, 4 ], -- GitLab