server: Add support for queuing a user APC upon async I/O completion.
diff --git a/server/async.c b/server/async.c
index aa4db4e..440cb2e 100644
--- a/server/async.c
+++ b/server/async.c
@@ -150,6 +150,16 @@
     }
     else
     {
+        if (async->data.apc)
+        {
+            apc_call_t data;
+            data.type         = APC_USER;
+            data.user.func    = async->data.apc;
+            data.user.args[0] = (unsigned long)async->data.apc_arg;
+            data.user.args[1] = (unsigned long)async->data.iosb;
+            data.user.args[2] = 0;
+            thread_queue_apc( async->thread, NULL, &data );
+        }
         if (async->event) set_event( async->event );
     }
 }
diff --git a/server/protocol.def b/server/protocol.def
index 5105fd6..ef20235 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -178,6 +178,8 @@
     void           *callback;      /* client-side callback to call upon end of async */
     void           *iosb;          /* I/O status block in client addr space */
     void           *arg;           /* opaque user data to pass to callback */
+    void           *apc;           /* user apc to call */
+    void           *apc_arg;       /* argument for user apc */
     obj_handle_t    event;         /* event to signal when done */
 } async_data_t;
 
diff --git a/server/trace.c b/server/trace.c
index a332821..898998b 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -246,8 +246,8 @@
 
 static void dump_async_data( const async_data_t *data )
 {
-    fprintf( stderr, "{callback=%p,iosb=%p,arg=%p,event=%p}",
-             data->callback, data->iosb, data->arg, data->event );
+    fprintf( stderr, "{callback=%p,iosb=%p,arg=%p,apc=%p,apc_arg=%p,event=%p}",
+             data->callback, data->iosb, data->arg, data->apc, data->apc_arg, data->event );
 }
 
 static void dump_luid( const luid_t *luid )