Skip to content

Commit

Permalink
cleanup comment to match style
Browse files Browse the repository at this point in the history
  • Loading branch information
dontech committed Nov 28, 2023
1 parent 4d02971 commit 69babb6
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions windows/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -1279,15 +1279,14 @@ void HID_API_EXPORT HID_API_CALL hid_close(hid_device *dev)
return;

/* Cancel I/O specifically for overlapped operations. There are cases
* where CancelIo() does _not_ cancel the associated overlapped
* operations, causing GetOverlappedResult() to hang forever for
* read/write operations.
*
* This is also the recommended way of cancelling pending overlapped
* operations according to:
*
* https://learn.microsoft.com/en-us/windows/win32/fileio/canceling-pending-i-o-operations
*/
where CancelIo() does _not_ cancel the associated overlapped
operations, causing GetOverlappedResult() to hang forever for
read/write operations.
This is also the recommended way of cancelling pending overlapped
operations according to:
https://learn.microsoft.com/en-us/windows/win32/fileio/canceling-pending-i-o-operations */
CancelIoEx(dev->device_handle, &dev->ol);
CancelIoEx(dev->device_handle, &dev->write_ol);

Expand Down

0 comments on commit 69babb6

Please sign in to comment.