Skip to content

Get and use CancelIoEx if available - #208

Open
amullins83 wants to merge 1 commit into
signal11:masterfrom
amullins83:use_cancelioex
Open

amullins83 wants to merge 1 commit into
signal11:masterfrom
amullins83:use_cancelioex

Conversation

@amullins83

Copy link
Copy Markdown
Contributor

Addresses #48 for Windows Vista and higher. I verified this with an MSP430-based device on a Windows 7 64-bit machine. I need to get Visual Studio installed on an XP VM to verify it there.

@amullins83

Copy link
Copy Markdown
Contributor Author

Finally got VS 2008 installed on that XP VM, as well as node, etc. As expected, the device does not close properly due to the CancelIo call instead of CancelIoEx, but there are no problems with communication while the device is connected and open.

@signal11

Copy link
Copy Markdown
Owner

Bummer about XP. I'll have a look on 7. Thanks!

Alan.

@amullins83

Copy link
Copy Markdown
Contributor Author

I found a workaround for my device and posted it to the node-hid repo. I
doubt this is a problem for everyone.

On Saturday, January 10, 2015, Alan Ott [email protected] wrote:

Bummer about XP. I'll have a look on 7. Thanks!

Alan.

—
Reply to this email directly or view it on GitHub
#208 (comment).

Austin Mullins

@j-waechter

Copy link
Copy Markdown

@signal11, @amullins83: This pull request would solve my problem with the Logitech G13 keyboard! (I tested it.) Accepting it would be very appreciated.

I use the node-hid Node.js module. I add a listener (on("data", ...)), but after close() you are forced to press a key on the device to let the application exit. Calling removeAllListeners() before close() doesn't help.

I could call setNonBlocking(1), but, then, the data listener is called very often and my application consumes very much CPU power.

(See node-hid/node-hid#61 for an issue describing similar problems.)

@limpkin

limpkin commented Mar 30, 2017

Copy link
Copy Markdown

Hello,

Please merge that PR, we're getting the same problem as @j-waechter

@gniezen

gniezen commented Jun 20, 2017

Copy link
Copy Markdown

👍 I would love for this to get merged, as it causes our Electron app to crash when we unplug the USB device on Windows 7.

@mspisars

Copy link
Copy Markdown
Contributor

Can this be merged? @signal11 Win XP is now 4 years past EOL.
And given that this patch falls back to CancelIo if CancelIoEx is not available should solve the problem without depriving WinXP users.

erikolofsson pushed a commit to Malterlib/hidapi that referenced this pull request Nov 25, 2020
Removes a possible cause for a segmentation fault observed in `CFSetGetCount`.

Related: signal11#208 ("Segmentation fault on Mac OS Catalina").
Signed-off-by: Jonas Malaco <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants