diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
index 963eaa3ead1898a5ec62a8bfd69b1cea68b0192c..f69e7970d9b753f3d803bce936a15eb3c9d616fa 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 879616d9946d249117c25d81fe5d067c150e0e50..4466de2d91eab128cac6761d2add0005ff980911 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 41884882d5454bceece3daedaf48ee25163ecbcd..f9b8901e5e1633c721920a73923c5d204886b65f 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 f7716d107b9edf708d5b24f97be2faba3adb027a..052e12c3f2cf810996f7c348d09bdc19263019f6 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 2d1d047c2f410fcfe99f1cff0e0ff14d7f338d8b..4255017845cdeebe7d2e937417bc3a28f9124813 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 7b345231d667dd25d4f2f93b24aa471bc921902e..c99ea2e47e5f957aef70a02b8b83fac63a09da72 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 214ade471ca152ca6c1a013d2162111ac7dbd8a9..2203e5ac300ea85c11b40d6ee259b24b81aa7a0f 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" ],