[6/6] server: Store full sized completion information on the server side.

Dmitry Timoshkov dmitry at baikal.ru
Wed Aug 21 04:35:51 CDT 2013


---
 dlls/ntdll/tests/file.c |  5 -----
 server/async.c          | 12 ++++++------
 server/completion.c     |  8 ++++----
 server/fd.c             |  2 +-
 server/file.h           |  4 ++--
 server/protocol.def     |  6 +++---
 6 files changed, 16 insertions(+), 21 deletions(-)

diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 7de3baf..56b637e 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/server/async.c b/server/async.c
index ccddec7..9495134 100644
--- a/server/async.c
+++ b/server/async.c
@@ -240,8 +240,8 @@ void async_set_timeout( struct async *async, timeout_t timeout, unsigned int sta
     async->timeout_status = status;
 }
 
-static void add_async_completion( struct async_queue *queue, apc_param_t cvalue, unsigned int status,
-                                  unsigned int information )
+static void add_async_completion( struct async_queue *queue, apc_param_t cvalue, apc_param_t information,
+                                  unsigned int status )
 {
     if (status == STATUS_MORE_PROCESSING_REQUIRED)
         return; /* The async callback has successfully finished but no completion should be reported */
@@ -253,16 +253,16 @@ static void add_async_completion( struct async_queue *queue, apc_param_t cvalue,
 
         if (completion)
         {
-            add_completion( completion, ckey, cvalue, status, information );
+            add_completion( completion, ckey, cvalue, information, status );
             release_object( completion );
         }
     }
     else if (queue->completion) add_completion( queue->completion, queue->comp_key,
-                                                cvalue, status, information );
+                                                cvalue, information, status );
 }
 
 /* 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;
 
@@ -286,7 +286,7 @@ void async_set_result( struct object *obj, unsigned int status, unsigned int tot
         if (async->timeout) remove_timeout_user( async->timeout );
         async->timeout = NULL;
         async->status = status;
-        if (async->data.cvalue) add_async_completion( async->queue, async->data.cvalue, status, total );
+        if (async->data.cvalue) add_async_completion( async->queue, async->data.cvalue, total, status );
         if (apc)
         {
             apc_call_t data;
diff --git a/server/completion.c b/server/completion.c
index 948d7d1..a5742cc 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 )
+                     apc_param_t information, unsigned int status )
 {
     struct comp_msg *msg = mem_alloc( sizeof( *msg ) );
 
@@ -221,7 +221,7 @@ DECL_HANDLER(add_completion)
 
     if (!completion) return;
 
-    add_completion( completion, req->ckey, req->cvalue, req->status, req->information );
+    add_completion( completion, req->ckey, req->cvalue, req->information, req->status );
 
     release_object( completion );
 }
@@ -245,8 +245,8 @@ DECL_HANDLER(remove_completion)
         msg = LIST_ENTRY( entry, struct comp_msg, queue_entry );
         reply->ckey = msg->ckey;
         reply->cvalue = msg->cvalue;
-        reply->status = msg->status;
         reply->information = msg->information;
+        reply->status = msg->status;
         free( msg );
     }
 
diff --git a/server/fd.c b/server/fd.c
index f3e42bd..c957209 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -2363,7 +2363,7 @@ DECL_HANDLER(add_fd_completion)
     if (fd)
     {
         if (fd->completion)
-            add_completion( fd->completion, fd->comp_key, req->cvalue, req->status, req->information );
+            add_completion( fd->completion, fd->comp_key, req->cvalue, req->information, req->status );
         release_object( fd );
     }
 }
diff --git a/server/file.h b/server/file.h
index ead356d..048be4e 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 );
+                            apc_param_t information, unsigned int status );
 
 /* 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 234c41e..239780a 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3306,7 +3306,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
 
@@ -3317,7 +3317,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
 
@@ -3342,8 +3342,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
 
 
-- 
1.8.3.4




More information about the wine-patches mailing list