Alexandre,
A problem with serial port read interval timeouts was brought up in bug 40540.[1] The code that you wrote [2] works great for some applications, but it does not help others. The problem is that the read interval timer needs to be started immediately if ReadFile is able to read any data from the serial port buffer, rather than waiting for more data to arrive before starting the timer.
It seems to me that NtReadFile [3] needs to tell serial_queue_async [4] if it read anything from the serial port before it sent the asynchronous read request to the Wineserver. If anything was read, serial_queue_async needs to start the read interval timer. Otherwise, serial_reselect_async should be the one to start the timer like it is now.
I could hack something in to achieve the desired behavior, but before I submit anything, I wanted to ask your opinion on how it should be done.
-Alex
[1] https://bugs.winehq.org/show_bug.cgi?id=40540 [2] https://source.winehq.org/git/wine.git/commitdiff/bc0bf9e505922b81df1c317d64... [3] https://source.winehq.org/git/wine.git/blob/698d4114677205c3e5a0df659d230fe9... [4] https://source.winehq.org/git/wine.git/blob/698d4114677205c3e5a0df659d230fe9...
Alex Henrie alexhenrie24@gmail.com writes:
It seems to me that NtReadFile [3] needs to tell serial_queue_async [4] if it read anything from the serial port before it sent the asynchronous read request to the Wineserver. If anything was read, serial_queue_async needs to start the read interval timer. Otherwise, serial_reselect_async should be the one to start the timer like it is now.
I could hack something in to achieve the desired behavior, but before I submit anything, I wanted to ask your opinion on how it should be done.
The easiest would probably be to not try to read anything and go straight to the async call when a read interval is set.