candleapi driver on win*: hang on CloseHandle() #16
I'm having trouble with the windows candleapi driver, which I'm trying to use for a personal project.
I reduced the test case to the following code:
The essential part is simply "candle_dev_open()" followed by "candle_dev_close()".
If I modify candle_dev_open() to not prepare the URBs (i.e. disable candle_prepare_read() ), then CloseHandle() will work properly.
I'm not sure what's wrong with the URBs or associated events ?
Hah ! Adding a call to "CancelIo(dev->deviceHandle);" inside candle_close_rxurbs() seems to fix the issue here. However, MSDN docs state
But, CancelIoEx is not supported on winXP (I'm trying to keep compatibility in my application), so I'm not sure how reliable CancelIo will be on multi-threaded applications.