https://bugs.winehq.org/show_bug.cgi?id=38143
--- Comment #6 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to Sebastian Lackner from comment #4)
Does that match the Windows behaviour, or is it just a hack? Since applications can also queue their own APCs (with QueueUserAPC) Wine should try to stay as close as possible to the Windows behaviour. Moreover, please note that a wait is interrupted when APC calls are handled, so with your patch applied NtRemoveIoCompletion returns a different status value in some situations. It sounds like this might need some additional tests. ;)
The tests I've added clearly show that user APCs are not supposed to be executed during GetQueuedCompletionStatus call, so my patch is wrong in that regard. On the other hand it looks like the queued APCs are never executed (and nothing in the attached application breaks) means that adding an APC to the queue as a reply to APC_ASYNC_IO request and actually executing it wasn't tested very well (if tested at all). So it raises a question whether APCs should be always generated by server, or generated at all.