Previously it was assumed that synchronous I/O fills the 64-bit IOSB, and asynchronous I/O fills the 32-bit IOSB. As the ntdll:wow64 tests show, this is incorrect. I/O on an overlapped handle, whether it is synchronous or not, fills the 32-bit IOSB, and I/O on a non-overlapped handle always fills the 64-bit IOSB. The first half is important, since completion can be signaled before we even return from the initial I/O call [NtReadFile() etc.] Filling the IOSB after signaling completion is the cause of bug 56389. This patch series fixes that. The second discrepancy does not cause any bugs, as far as I can see, and is a bit harder to fix anyway. It is therefore not addressed by this patch series. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56389 -- v2: ntdll: Always fill the 32-bit iosb for overlapped handles, for regular read/write. ntdll: Always fill the 32-bit iosb for overlapped handles, in set_async_direct_result(). ntdll: Always fill the 32-bit iosb for overlapped handles, in file_complete_async(). https://gitlab.winehq.org/wine/wine/-/merge_requests/5926