Alexandre Julliard : server: Add an apc_param_t type to store APC client-side parameters.

Alexandre Julliard julliard at winehq.org
Mon Dec 15 08:27:36 CST 2008


Module: wine
Branch: master
Commit: dc7f17049560737e8da9f48f293066c55096cfd8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=dc7f17049560737e8da9f48f293066c55096cfd8

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Dec 15 13:29:38 2008 +0100

server: Add an apc_param_t type to store APC client-side parameters.

---

 include/wine/server_protocol.h |   17 +++++++++--------
 server/async.c                 |    6 +++---
 server/completion.c            |    7 ++++---
 server/fd.c                    |    4 ++--
 server/file.h                  |    5 +++--
 server/protocol.def            |   17 +++++++++--------
 tools/make_requests            |    1 +
 7 files changed, 31 insertions(+), 26 deletions(-)

diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
index 963eaa3..f69e797 100644
--- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
@@ -23,6 +23,7 @@ typedef unsigned int thread_id_t;
 typedef unsigned int data_size_t;
 typedef unsigned int ioctl_code_t;
 typedef unsigned long lparam_t;
+typedef unsigned long apc_param_t;
 typedef unsigned __int64 file_pos_t;
 
 struct request_header
@@ -164,7 +165,7 @@ typedef struct
     void           *arg;
     void           *apc;
     obj_handle_t    event;
-    unsigned long   cvalue;
+    apc_param_t     cvalue;
 } async_data_t;
 
 
@@ -260,7 +261,7 @@ typedef union
     {
         enum apc_type    type;
         void (__stdcall *func)(unsigned long,unsigned long,unsigned long);
-        unsigned long    args[3];
+        apc_param_t      args[3];
     } user;
     struct
     {
@@ -4224,8 +4225,8 @@ struct add_completion_request
 {
     struct request_header __header;
     obj_handle_t  handle;
-    unsigned long ckey;
-    unsigned long cvalue;
+    apc_param_t   ckey;
+    apc_param_t   cvalue;
     unsigned long information;
     unsigned int  status;
 };
@@ -4244,8 +4245,8 @@ struct remove_completion_request
 struct remove_completion_reply
 {
     struct reply_header __header;
-    unsigned long ckey;
-    unsigned long cvalue;
+    apc_param_t   ckey;
+    apc_param_t   cvalue;
     unsigned long information;
     unsigned int  status;
 };
@@ -4270,7 +4271,7 @@ struct set_completion_info_request
     struct request_header __header;
     obj_handle_t  handle;
     obj_handle_t  chandle;
-    unsigned long ckey;
+    apc_param_t   ckey;
 };
 struct set_completion_info_reply
 {
@@ -4283,7 +4284,7 @@ struct add_fd_completion_request
 {
     struct request_header __header;
     obj_handle_t   handle;
-    unsigned long  cvalue;
+    apc_param_t    cvalue;
     unsigned int   status;
     unsigned long  information;
 };
diff --git a/server/async.c b/server/async.c
index 879616d..4466de2 100644
--- a/server/async.c
+++ b/server/async.c
@@ -43,7 +43,7 @@ struct async
     unsigned int         timeout_status;  /* status to report upon timeout */
     struct event        *event;
     struct completion   *completion;
-    unsigned long        comp_key;
+    apc_param_t          comp_key;
     async_data_t         data;            /* data for async I/O call */
 };
 
@@ -266,8 +266,8 @@ void async_set_result( struct object *obj, unsigned int status, unsigned long to
             memset( &data, 0, sizeof(data) );
             data.type         = APC_USER;
             data.user.func    = async->data.apc;
-            data.user.args[0] = (unsigned long)async->data.arg;
-            data.user.args[1] = (unsigned long)async->data.iosb;
+            data.user.args[0] = (apc_param_t)async->data.arg;
+            data.user.args[1] = (apc_param_t)async->data.iosb;
             data.user.args[2] = 0;
             thread_queue_apc( async->thread, NULL, &data );
         }
diff --git a/server/completion.c b/server/completion.c
index 4188488..f9b8901 100644
--- a/server/completion.c
+++ b/server/completion.c
@@ -79,8 +79,8 @@ static const struct object_ops completion_ops =
 struct comp_msg
 {
     struct   list queue_entry;
-    unsigned long ckey;
-    unsigned long cvalue;
+    apc_param_t   ckey;
+    apc_param_t   cvalue;
     unsigned long information;
     unsigned int  status;
 };
@@ -141,7 +141,8 @@ struct completion *get_completion_obj( struct process *process, obj_handle_t han
     return (struct completion *) get_handle_obj( process, handle, access, &completion_ops );
 }
 
-void add_completion( struct completion *completion, unsigned long ckey, unsigned long cvalue, unsigned int status, unsigned long information )
+void add_completion( struct completion *completion, apc_param_t ckey, apc_param_t cvalue,
+                     unsigned int status, unsigned long information )
 {
     struct comp_msg *msg = mem_alloc( sizeof( *msg ) );
 
diff --git a/server/fd.c b/server/fd.c
index f7716d1..052e12c 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -199,7 +199,7 @@ struct fd
     struct async_queue  *write_q;     /* async writers of this fd */
     struct async_queue  *wait_q;      /* other async waiters of this fd */
     struct completion   *completion;  /* completion object attached to this fd */
-    unsigned long        comp_key;    /* completion key to set in completion events */
+    apc_param_t          comp_key;    /* completion key to set in completion events */
 };
 
 static void fd_dump( struct object *obj, int verbose );
@@ -1940,7 +1940,7 @@ static struct fd *get_handle_fd_obj( struct process *process, obj_handle_t handl
     return fd;
 }
 
-void fd_assign_completion( struct fd *fd, struct completion **p_port, unsigned long *p_key )
+void fd_assign_completion( struct fd *fd, struct completion **p_port, apc_param_t *p_key )
 {
     *p_key = fd->comp_key;
     *p_port = fd->completion ? (struct completion *)grab_object( fd->completion ) : NULL;
diff --git a/server/file.h b/server/file.h
index 2d1d047..4255017 100644
--- a/server/file.h
+++ b/server/file.h
@@ -124,7 +124,8 @@ extern struct object *create_dir_obj( struct fd *fd );
 /* completion */
 
 extern struct completion *get_completion_obj( struct process *process, obj_handle_t handle, unsigned int access );
-extern void add_completion( struct completion *completion, unsigned long ckey, unsigned long cvalue, unsigned int status, unsigned long information );
+extern void add_completion( struct completion *completion, apc_param_t ckey, apc_param_t cvalue,
+                            unsigned int status, unsigned long information );
 
 /* serial port functions */
 
@@ -141,7 +142,7 @@ extern void async_set_result( struct object *obj, unsigned int status, unsigned
 extern int async_waiting( struct async_queue *queue );
 extern void async_terminate( struct async *async, unsigned int status );
 extern void async_wake_up( struct async_queue *queue, unsigned int status );
-extern void fd_assign_completion( struct fd *fd, struct completion **p_port, unsigned long *p_key );
+extern void fd_assign_completion( struct fd *fd, struct completion **p_port, apc_param_t *p_key );
 
 /* access rights that require Unix read permission */
 #define FILE_UNIX_READ_ACCESS (FILE_READ_DATA|FILE_READ_ATTRIBUTES|FILE_READ_EA)
diff --git a/server/protocol.def b/server/protocol.def
index 7b34523..c99ea2e 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -39,6 +39,7 @@ typedef unsigned int thread_id_t;
 typedef unsigned int data_size_t;
 typedef unsigned int ioctl_code_t;
 typedef unsigned long lparam_t;
+typedef unsigned long apc_param_t;
 typedef unsigned __int64 file_pos_t;
 
 struct request_header
@@ -180,7 +181,7 @@ typedef struct
     void           *arg;           /* opaque user data to pass to callback */
     void           *apc;           /* user apc to call */
     obj_handle_t    event;         /* event to signal when done */
-    unsigned long   cvalue;        /* completion value to use for completion events */
+    apc_param_t     cvalue;        /* completion value to use for completion events */
 } async_data_t;
 
 /* structures for extra message data */
@@ -276,7 +277,7 @@ typedef union
     {
         enum apc_type    type;     /* APC_USER */
         void (__stdcall *func)(unsigned long,unsigned long,unsigned long);
-        unsigned long    args[3];  /* arguments for user function */
+        apc_param_t      args[3];  /* arguments for user function */
     } user;
     struct
     {
@@ -3031,8 +3032,8 @@ enum message_type
 /* add completion to completion port */
 @REQ(add_completion)
     obj_handle_t  handle;         /* port handle */
-    unsigned long ckey;           /* completion key */
-    unsigned long cvalue;         /* completion value */
+    apc_param_t   ckey;           /* completion key */
+    apc_param_t   cvalue;         /* completion value */
     unsigned long information;    /* IO_STATUS_BLOCK Information */
     unsigned int  status;         /* completion result */
 @END
@@ -3042,8 +3043,8 @@ enum message_type
 @REQ(remove_completion)
     obj_handle_t handle;          /* port handle */
 @REPLY
-    unsigned long ckey;           /* completion key */
-    unsigned long cvalue;         /* completion value */
+    apc_param_t   ckey;           /* completion key */
+    apc_param_t   cvalue;         /* completion value */
     unsigned long information;    /* IO_STATUS_BLOCK Information */
     unsigned int  status;         /* completion result */
 @END
@@ -3061,14 +3062,14 @@ enum message_type
 @REQ(set_completion_info)
     obj_handle_t  handle;         /* object handle */
     obj_handle_t  chandle;        /* port handle */
-    unsigned long ckey;           /* completion key */
+    apc_param_t   ckey;           /* completion key */
 @END
 
 
 /* check for associated completion and push msg */
 @REQ(add_fd_completion)
     obj_handle_t   handle;        /* async' object */
-    unsigned long  cvalue;        /* completion value */
+    apc_param_t    cvalue;        /* completion value */
     unsigned int   status;        /* completion status */
     unsigned long  information;   /* IO_STATUS_BLOCK Information */
 @END
diff --git a/tools/make_requests b/tools/make_requests
index 214ade4..2203e5a 100755
--- a/tools/make_requests
+++ b/tools/make_requests
@@ -38,6 +38,7 @@ my %formats =
     "process_id_t"  => [  4,   4,  "%04x" ],
     "thread_id_t"   => [  4,   4,  "%04x" ],
     "lparam_t"      => [  4,   4,  "%lx" ],
+    "apc_param_t"   => [  4,   4,  "%lx" ],
     "timeout_t"     => [  8,   8,  "&dump_timeout" ],
     "rectangle_t"   => [  16,  4,  "&dump_rectangle" ],
     "char_info_t"   => [  4,   2,  "&dump_char_info" ],




More information about the wine-cvs mailing list