wine/server
Jinoh Kang b632ddedcd server: Actually set initial status in set_async_direct_result handler.
Commit 15483b1a12 (server: Allow calling async_handoff() with status
code STATUS_ALERTED., 2022-02-10) introduced the set_async_direct_result
handler which calls async_set_initial_status().

However, the async_set_initial_status() call does nothing since
async->terminated is set, leaving the async in a confusing state
(unknown_status = 1 but pending/completed).

So far, this issue is unlikely to have been a problem in practice for
the following reasons:

1. async_set_initial_status() would have unset unknown_status, but it
   remains set instead.  This is usually not a problem, since
   unknown_status is usually ever read by code paths effectively
   unreachable for non-device (e.g. socket) asyncs.

   It would still potentially allow set_async_direct_result to be called
   multiple times, but it wouldn't actually happen in practice unless
   something goes wrong.

2. async_set_initial_status() would have set initial_status; however,
   it is left with the default value STATUS_PENDING.  If the actual
   status is something other than that, the handler closes the wait
   handle and async_satisfied (the only real consumer of initial_status)
   would never be called anyway.

For reasons above, this issue is not effectively observable or testable.
Nonetheless, the current code does leave the async object in an
inconsistent state.

Fix this by removing the !async->terminated check in
async_set_initial_status().

Also, remove assert( async->unknown_status ).  The client can now
trigger the assert() by calling set_async_direct_result on a device
async, thereby causing async_set_initial_status() to be called twice.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-22 18:36:32 +01:00
..
async.c server: Actually set initial status in set_async_direct_result handler. 2022-03-22 18:36:32 +01:00
atom.c server: Avoid using wine/port.h. 2021-10-07 18:03:11 +02:00
change.c server: Define a server-side structure for SID. 2022-01-25 12:32:11 +01:00
class.c server: Avoid using wine/port.h. 2021-10-07 18:03:11 +02:00
clipboard.c server: Avoid using wine/port.h. 2021-10-07 18:03:11 +02:00
completion.c server: Avoid using wine/port.h. 2021-10-07 18:03:11 +02:00
console.c kernelbase: Support CONSOLE_READCONSOLE_CONTROL in ReadConsoleW. 2022-03-01 22:41:15 +01:00
debugger.c server: Avoid using wine/port.h. 2021-10-07 18:03:11 +02:00
device.c server: Always close previous IRP handle. 2022-03-14 12:00:48 +01:00
directory.c server: Implement the \??\GLOBALROOT symbolic link. 2021-11-25 21:43:49 +01:00
event.c server: Add sys/types.h include in a few more files. 2021-10-11 11:44:02 +02:00
fd.c server: Allocate enough space for the backslash in dup_nt_name() (Valgrind). 2022-01-21 09:23:25 +01:00
file.c server: Define a server-side structure for SID. 2022-01-25 12:32:11 +01:00
file.h server: Define a server-side structure for SID. 2022-01-25 12:32:11 +01:00
handle.c server: Define a server-side structure for SID. 2022-01-25 12:32:11 +01:00
handle.h server: Inherit standard handles together with explicit handle list. 2020-09-29 21:04:13 +02:00
hook.c server: Avoid using wine/port.h. 2021-10-07 18:03:11 +02:00
mach.c server: Remove workarounds for Mac OS X 10.4. 2021-12-02 09:50:46 +01:00
mailslot.c configure: Assume that sys/ioctl.h is available on Unix. 2021-12-09 18:43:51 +01:00
main.c server: Avoid using getopt_long(). 2021-10-05 11:53:08 +02:00
Makefile.in server: Implement vm counters on FreeBSD. 2021-11-19 18:59:02 +01:00
mapping.c server: Store PE image info in process structure. 2022-01-02 13:53:08 +01:00
mutex.c server: Add sys/types.h include in a few more files. 2021-10-11 11:44:02 +02:00
named_pipe.c server: Return ReadDataAvailable value for FilePipeLocalInformation. 2021-12-06 22:55:07 +01:00
object.c server: Define a server-side structure for SID. 2022-01-25 12:32:11 +01:00
object.h server: Implement the \??\GLOBALROOT symbolic link. 2021-11-25 21:43:49 +01:00
process.c server: Define a server-side structure for SID. 2022-01-25 12:32:11 +01:00
process.h server: Store PE image info in process structure. 2022-01-02 13:53:08 +01:00
procfs.c server: Add a platform-specific entry point to initialize registers of a new thread. 2017-07-27 17:04:04 +02:00
protocol.def server: Replace redundant recv_socket status fields with force_async boolean field. 2022-02-10 20:18:39 +01:00
ptrace.c configure: Assume that sys/wait.h is available on Unix. 2021-12-09 18:43:51 +01:00
queue.c server: Return error when hardware message is too large. 2022-01-12 17:27:50 +01:00
region.c server: Map region to the window DPI in redraw_region(). 2018-08-24 20:12:05 +02:00
registry.c server: Define a server-side structure for SID. 2022-01-25 12:32:11 +01:00
request.c configure: Assume that sys/wait.h is available on Unix. 2021-12-09 18:43:51 +01:00
request.h server: Replace redundant recv_socket status fields with force_async boolean field. 2022-02-10 20:18:39 +01:00
security.h server: Define a server-side structure for SID. 2022-01-25 12:32:11 +01:00
semaphore.c server: Add sys/types.h include in a few more files. 2021-10-11 11:44:02 +02:00
serial.c configure: Assume that sys/ioctl.h is available on Unix. 2021-12-09 18:43:51 +01:00
signal.c configure: Stop checking for poll.h and sys/poll.h - always use poll.h. 2021-10-31 17:56:54 +01:00
sock.c server: Replace redundant recv_socket status fields with force_async boolean field. 2022-02-10 20:18:39 +01:00
symlink.c server: Implement the \??\GLOBALROOT symbolic link. 2021-11-25 21:43:49 +01:00
thread.c server: Fix the spelling of a comment. 2021-12-10 22:00:17 +01:00
thread.h ntdll: Avoid accessing the I/O status block in wait_async(). 2021-05-24 11:32:28 +02:00
timer.c server: Avoid using wine/port.h. 2021-10-07 18:03:11 +02:00
token.c server: Don't depend on the TOKEN_GROUPS structure on the server side. 2022-01-25 12:35:54 +01:00
trace.c server: Replace redundant recv_socket status fields with force_async boolean field. 2022-02-10 20:18:39 +01:00
unicode.c server: Use sysctl instead of /proc/curproc/file on FreeBSD. 2021-10-25 18:50:59 +02:00
unicode.h server: Create the NLS section object for the l_intl.nls file. 2020-11-27 18:28:35 +01:00
user.c
user.h server: Make window struct a server object. 2022-02-09 18:37:32 +01:00
window.c server: Store all 64 bits of window id. 2022-02-10 18:15:04 +01:00
wineserver.de.UTF-8.man.in server: Move WineHQ URLs to https. 2017-12-01 09:23:26 +01:00
wineserver.fr.UTF-8.man.in server: Move WineHQ URLs to https. 2017-12-01 09:23:26 +01:00
wineserver.man.in server: Move WineHQ URLs to https. 2017-12-01 09:23:26 +01:00
winstation.c server: Make window struct a server object. 2022-02-09 18:37:32 +01:00