ntdll: Avoid accessing the I/O status block in wait_async().
commit97afac469fbe012e22acc1f1045c88b1004a241f
authorZebediah Figura <z.figura12@gmail.com>
Sat, 22 May 2021 03:08:46 +0000 (21 22:08 -0500)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 24 May 2021 09:32:28 +0000 (24 11:32 +0200)
treea0ea6c9eef7e186649e630a87ac63d881c48ba27
parenta5b6e90d48eb2f1a82cbab4b2a7864a312b8c78a
ntdll: Avoid accessing the I/O status block in wait_async().

Steam uses WSASend() with completion ports, reusing OVERLAPPED structures as
soon as they are returned from GetQueuedCompletionStatus(). Since completion is
queued during the select request in wait_async(), the I/O status block can be
reused even before the call to NtDeviceIoControl exits.

This works fine with current Wine, because WSASend() doesn't access the I/O
status block after queuing completion. However, a patch that changes it to use
wait_async() like other async requests causes NtDeviceIoControlFile to
consistently return garbage status codes.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/ntdll/unix/file.c
server/async.c
server/thread.c
server/thread.h