From 0b4c9cb533efc72cb9a4a165ab0d8c5044c3fd08 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Fri, 23 Aug 2013 19:37:51 +0900 Subject: [PATCH] server: Store full-sized completion information on the server side. --- dlls/ntdll/tests/file.c | 5 ----- include/wine/server_protocol.h | 11 +++++++---- server/async.c | 4 ++-- server/completion.c | 4 ++-- server/file.h | 4 ++-- server/protocol.def | 6 +++--- server/request.h | 14 +++++++------- server/trace.c | 6 +++--- 8 files changed, 26 insertions(+), 28 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 9ce38342bb5..1f9d60e7d58 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -1001,11 +1001,6 @@ static void test_iocp_setcompletion(HANDLE h) if (get_msg(h)) { ok( completionKey == CKEY_FIRST, "Invalid completion key: %lx\n", completionKey ); - /* FIXME: Remove once Wine is fixed */ - if (sizeof(size) > 4) -todo_wine - ok( ioSb.Information == size, "Invalid ioSb.Information: %lu\n", ioSb.Information ); - else ok( ioSb.Information == size, "Invalid ioSb.Information: %lu\n", ioSb.Information ); ok( U(ioSb).Status == STATUS_INVALID_DEVICE_REQUEST, "Invalid ioSb.Status: %x\n", U(ioSb).Status); ok( completionValue == CVALUE_FIRST, "Invalid completion value: %lx\n", completionValue ); diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index a34a9702e54..8ec1b85f6e3 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -4786,8 +4786,9 @@ struct add_completion_request obj_handle_t handle; apc_param_t ckey; apc_param_t cvalue; - unsigned int information; + apc_param_t information; unsigned int status; + char __pad_44[4]; }; struct add_completion_reply { @@ -4806,8 +4807,9 @@ struct remove_completion_reply struct reply_header __header; apc_param_t ckey; apc_param_t cvalue; - unsigned int information; + apc_param_t information; unsigned int status; + char __pad_36[4]; }; @@ -4846,8 +4848,9 @@ struct add_fd_completion_request struct request_header __header; obj_handle_t handle; apc_param_t cvalue; + apc_param_t information; unsigned int status; - unsigned int information; + char __pad_36[4]; }; struct add_fd_completion_reply { @@ -5754,6 +5757,6 @@ union generic_reply struct set_suspend_context_reply set_suspend_context_reply; }; -#define SERVER_PROTOCOL_VERSION 441 +#define SERVER_PROTOCOL_VERSION 442 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/async.c b/server/async.c index ccddec76a6a..017419d772f 100644 --- a/server/async.c +++ b/server/async.c @@ -241,7 +241,7 @@ void async_set_timeout( struct async *async, timeout_t timeout, unsigned int sta } static void add_async_completion( struct async_queue *queue, apc_param_t cvalue, unsigned int status, - unsigned int information ) + apc_param_t information ) { if (status == STATUS_MORE_PROCESSING_REQUIRED) return; /* The async callback has successfully finished but no completion should be reported */ @@ -262,7 +262,7 @@ static void add_async_completion( struct async_queue *queue, apc_param_t cvalue, } /* store the result of the client-side async callback */ -void async_set_result( struct object *obj, unsigned int status, unsigned int total, client_ptr_t apc ) +void async_set_result( struct object *obj, unsigned int status, apc_param_t total, client_ptr_t apc ) { struct async *async = (struct async *)obj; diff --git a/server/completion.c b/server/completion.c index 948d7d1045f..cf891fe67e9 100644 --- a/server/completion.c +++ b/server/completion.c @@ -82,7 +82,7 @@ struct comp_msg struct list queue_entry; apc_param_t ckey; apc_param_t cvalue; - unsigned int information; + apc_param_t information; unsigned int status; }; @@ -152,7 +152,7 @@ struct completion *get_completion_obj( struct process *process, obj_handle_t han } void add_completion( struct completion *completion, apc_param_t ckey, apc_param_t cvalue, - unsigned int status, unsigned int information ) + unsigned int status, apc_param_t information ) { struct comp_msg *msg = mem_alloc( sizeof( *msg ) ); diff --git a/server/file.h b/server/file.h index ead356d20d9..2a35979a36b 100644 --- a/server/file.h +++ b/server/file.h @@ -143,7 +143,7 @@ extern struct dir *get_dir_obj( struct process *process, obj_handle_t handle, un extern struct completion *get_completion_obj( struct process *process, obj_handle_t handle, unsigned int access ); extern void add_completion( struct completion *completion, apc_param_t ckey, apc_param_t cvalue, - unsigned int status, unsigned int information ); + unsigned int status, apc_param_t information ); /* serial port functions */ @@ -157,7 +157,7 @@ extern struct async *create_async( struct thread *thread, struct async_queue *qu const async_data_t *data ); extern void async_set_timeout( struct async *async, timeout_t timeout, unsigned int status ); extern void async_set_result( struct object *obj, unsigned int status, - unsigned int total, client_ptr_t apc ); + apc_param_t total, client_ptr_t apc ); extern int async_queued( struct async_queue *queue ); extern int async_waiting( struct async_queue *queue ); extern void async_terminate( struct async *async, unsigned int status ); diff --git a/server/protocol.def b/server/protocol.def index 8fd592eabc0..5da99387fbc 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -3326,7 +3326,7 @@ enum coords_relative obj_handle_t handle; /* port handle */ apc_param_t ckey; /* completion key */ apc_param_t cvalue; /* completion value */ - unsigned int information; /* IO_STATUS_BLOCK Information */ + apc_param_t information; /* IO_STATUS_BLOCK Information */ unsigned int status; /* completion result */ @END @@ -3337,7 +3337,7 @@ enum coords_relative @REPLY apc_param_t ckey; /* completion key */ apc_param_t cvalue; /* completion value */ - unsigned int information; /* IO_STATUS_BLOCK Information */ + apc_param_t information; /* IO_STATUS_BLOCK Information */ unsigned int status; /* completion result */ @END @@ -3362,8 +3362,8 @@ enum coords_relative @REQ(add_fd_completion) obj_handle_t handle; /* async' object */ apc_param_t cvalue; /* completion value */ + apc_param_t information; /* IO_STATUS_BLOCK Information */ unsigned int status; /* completion status */ - unsigned int information; /* IO_STATUS_BLOCK Information */ @END diff --git a/server/request.h b/server/request.h index 326ce6e69d4..9a7d69255eb 100644 --- a/server/request.h +++ b/server/request.h @@ -2108,15 +2108,15 @@ C_ASSERT( FIELD_OFFSET(struct add_completion_request, handle) == 12 ); C_ASSERT( FIELD_OFFSET(struct add_completion_request, ckey) == 16 ); C_ASSERT( FIELD_OFFSET(struct add_completion_request, cvalue) == 24 ); C_ASSERT( FIELD_OFFSET(struct add_completion_request, information) == 32 ); -C_ASSERT( FIELD_OFFSET(struct add_completion_request, status) == 36 ); -C_ASSERT( sizeof(struct add_completion_request) == 40 ); +C_ASSERT( FIELD_OFFSET(struct add_completion_request, status) == 40 ); +C_ASSERT( sizeof(struct add_completion_request) == 48 ); C_ASSERT( FIELD_OFFSET(struct remove_completion_request, handle) == 12 ); C_ASSERT( sizeof(struct remove_completion_request) == 16 ); C_ASSERT( FIELD_OFFSET(struct remove_completion_reply, ckey) == 8 ); C_ASSERT( FIELD_OFFSET(struct remove_completion_reply, cvalue) == 16 ); C_ASSERT( FIELD_OFFSET(struct remove_completion_reply, information) == 24 ); -C_ASSERT( FIELD_OFFSET(struct remove_completion_reply, status) == 28 ); -C_ASSERT( sizeof(struct remove_completion_reply) == 32 ); +C_ASSERT( FIELD_OFFSET(struct remove_completion_reply, status) == 32 ); +C_ASSERT( sizeof(struct remove_completion_reply) == 40 ); C_ASSERT( FIELD_OFFSET(struct query_completion_request, handle) == 12 ); C_ASSERT( sizeof(struct query_completion_request) == 16 ); C_ASSERT( FIELD_OFFSET(struct query_completion_reply, depth) == 8 ); @@ -2127,9 +2127,9 @@ C_ASSERT( FIELD_OFFSET(struct set_completion_info_request, chandle) == 24 ); C_ASSERT( sizeof(struct set_completion_info_request) == 32 ); C_ASSERT( FIELD_OFFSET(struct add_fd_completion_request, handle) == 12 ); C_ASSERT( FIELD_OFFSET(struct add_fd_completion_request, cvalue) == 16 ); -C_ASSERT( FIELD_OFFSET(struct add_fd_completion_request, status) == 24 ); -C_ASSERT( FIELD_OFFSET(struct add_fd_completion_request, information) == 28 ); -C_ASSERT( sizeof(struct add_fd_completion_request) == 32 ); +C_ASSERT( FIELD_OFFSET(struct add_fd_completion_request, information) == 24 ); +C_ASSERT( FIELD_OFFSET(struct add_fd_completion_request, status) == 32 ); +C_ASSERT( sizeof(struct add_fd_completion_request) == 40 ); C_ASSERT( FIELD_OFFSET(struct get_window_layered_info_request, handle) == 12 ); C_ASSERT( sizeof(struct get_window_layered_info_request) == 16 ); C_ASSERT( FIELD_OFFSET(struct get_window_layered_info_reply, color_key) == 8 ); diff --git a/server/trace.c b/server/trace.c index dd88c000a12..61f3180bee7 100644 --- a/server/trace.c +++ b/server/trace.c @@ -3886,7 +3886,7 @@ static void dump_add_completion_request( const struct add_completion_request *re fprintf( stderr, " handle=%04x", req->handle ); dump_uint64( ", ckey=", &req->ckey ); dump_uint64( ", cvalue=", &req->cvalue ); - fprintf( stderr, ", information=%08x", req->information ); + dump_uint64( ", information=", &req->information ); fprintf( stderr, ", status=%08x", req->status ); } @@ -3899,7 +3899,7 @@ static void dump_remove_completion_reply( const struct remove_completion_reply * { dump_uint64( " ckey=", &req->ckey ); dump_uint64( ", cvalue=", &req->cvalue ); - fprintf( stderr, ", information=%08x", req->information ); + dump_uint64( ", information=", &req->information ); fprintf( stderr, ", status=%08x", req->status ); } @@ -3924,8 +3924,8 @@ static void dump_add_fd_completion_request( const struct add_fd_completion_reque { fprintf( stderr, " handle=%04x", req->handle ); dump_uint64( ", cvalue=", &req->cvalue ); + dump_uint64( ", information=", &req->information ); fprintf( stderr, ", status=%08x", req->status ); - fprintf( stderr, ", information=%08x", req->information ); } static void dump_get_window_layered_info_request( const struct get_window_layered_info_request *req )