https://bugs.winehq.org/show_bug.cgi?id=47424
--- Comment #4 from Peter peter@smart-projects.net --- Thank you. Proposed solution will work.
I don't believe it is 100% correct, but it is good enough. I understand that this is due to Linux' implementation of 'resid'.
Not 100% correct because the input value 'DataTransferLength' may be, and often is, more than what is really returned. Meaning it is possible to setup a buffer of (for instance) 64KB, put that value in 'DataTransferLength' and send a command that will only return a few bytes.
In current suggested fix a buffer under-run may not be properly detected if the input buffer was bigger than the expected return data, because 'resid' may be smaller than what the buffer was bigger than required.
On the other hand, software could detect the delta between input and output and use that to detect the buffer under-run. However since the mechanism is different on Windows, that may not happen.
Still, this is as good as it gets, and certainly the way to go for the time being.
Cheers, Peter