server: Improve APC error handling when alloc_handle fails.

Whenever alloc_handle fails, we ignored the error and dequeued the
next APC. This patch makes the loop break whenever the error status
changes.

Note that the APC is still marked as executed although it failed.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2020-02-05 11:49:35 +01:00 committed by Alexandre Julliard
parent dc9267dc1c
commit 9e581ba8c5
1 changed files with 13 additions and 16 deletions

View File

@ -1579,9 +1579,7 @@ DECL_HANDLER(select)
reply->timeout = select_on( &select_op, op_size, req->cookie, req->flags, req->timeout );
if (get_error() == STATUS_USER_APC)
{
for (;;)
while (get_error() == STATUS_USER_APC)
{
if (!(apc = thread_dequeue_apc( current, !(req->flags & SELECT_ALERTABLE) )))
break;
@ -1600,7 +1598,6 @@ DECL_HANDLER(select)
release_object( apc );
}
}
}
/* queue an APC for a thread or process */
DECL_HANDLER(queue_apc)