https://bugs.winehq.org/show_bug.cgi?id=40540
Bug ID: 40540 Summary: ReadFile overlapped not using ReadIntervalTimeout Product: Wine Version: 1.9.8 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: henry@littau.org Distribution: ---
Created attachment 54371 --> https://bugs.winehq.org/attachment.cgi?id=54371 Copy of code where error occurs in Appload.exe
I am running on wine-1.9.8 (Staging).
Program is connected to a USB VCP serial device as COMnn. The behavior of overlapped reads is different between Windows and Wine. A Serial write is sent to the device, which triggers a response. The code below is waiting for the response. The response is 8 characters, pretty much immediately.
Under Wine, when I step with the VS2008 debugger remotely, the ReadFile returns with IO_Pending, and I see the eight characters in the read buffer. The call to WaitForSingleObject blocks until it times out, returns TIMEOUT, and the read process is considered failed.
Under Windows, ReadFile also returns IO_Pending, read buffer unmodified. The call to WaitForSingleObject returns Success. GetOverlappedResult succeeds with read length of 8. Life is good.
If I set dwToRead to 8 the code works correctly under Wine. When it is at 64, we have problems under Wine but not Windows. ReadIntervalTimeout in COMMTIMEOUTS is 1000 so after one second without new characters, the ReadFile should be considered complete and WaitForSingleObject should return. This appears not to be happening under Wine. Is this fixable under Wine?
Example code attached.
App is called Appload and is available here: https://wiki.opticonusa.com/techsupport/en/Appload
To run the app and demonstrate the issue you would need an Opticon barcode scanner, or a mock up of a scanner, on /dev/ttyACM0. App does an enumeration of COM devices, so Wine needs registry mods as described here: http://www.downtowndougbrown.com/2013/03/getting-x-ctu-in-wine-to-detect-you...
I can likely provide whatever a credible developer needs if the example attached is not sufficient.