server: Add an apc_param_t type to store APC client-side parameters.
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 @@
     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 @@
             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 @@
 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 @@
     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 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 @@
     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 @@
 /* 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 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 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 @@
     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 @@
     {
         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 @@
 /* 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 @@
 @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 @@
 @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