I suppose one or another way, all that logic should be contained inside wineserver and it should be signaling cancel wait object based on its knowledge that async canceled
I have to recheck but I think that would signal too early? We want to signal the cancel as completed only after all the `iosb.Status` are set on the client.
(would it be the explicit flag as it is now or derived in some other way, like checking the canceled async queue, as the flag seems to be going away in previous patches for some reason).
That's a patch from Rémi's gitlab, he rearranged the previous version of this MR here: https://gitlab.winehq.org/rbernon/wine/-/commits/mr/7797
Besides that cancellation handling doesn't seem to belong to client and to IOSB status, what will happen with NtCancelIo wait if the thread or process which is supposed to notify cancel gets killed?
Process termination should be no concern since `NtCancelIoFile[Ex]()` are restricted to the same process in the first place. Valid point about thread termination though, thanks.
[...] So why not to use exact same mechanics here if we need to wait for async to conclude after cancellation request in NtCancelIoFile?
That sounds like the previous version of this MR (I think you can still see it here: https://gitlab.winehq.org/wine/wine/-/merge_requests/7797/diffs?commit_id=40..., or from Rémi's gitlab as above), which indeed was not very nice WRT passing and waiting on multiple handles.