Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use CancelIoEx instead of CancelIo on windows_native
Fixes a use-after-free bug when dropping the HidDevice from a thread other than the one that was last used to read it, because of a pending async operation that did not get canceled. If the cancellation does not return an error, we get the overlapped result to block until it actually goes through. This is recommended by Microsoft in this example: <https://learn.microsoft.com/en-us/windows/win32/fileio/canceling-pending-i-o-operations#canceling-asynchronous-io>. Closes #151
- Loading branch information