From 9e4df70f7282b04849153b3fa2edf15dc24eaf4f Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Tue, 23 Jul 2019 18:39:06 -0500
Subject: [PATCH] server: Only signal the APC fd for user APCs.

Otherwise we might incorrectly return WAIT_IO_COMPLETION to the user when a system APC runs.
---
 server/thread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/thread.c b/server/thread.c
index fc751c2cb..2e77e5ff2 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -1057,7 +1057,7 @@ static int queue_apc( struct process *process, struct thread *thread, struct thr
     {
         wake_thread( thread );
 
-        if (do_esync())
+        if (do_esync() && queue == &thread->user_apc)
             esync_wake_fd( thread->esync_apc_fd );
     }
 
-- 
2.23.0

