[Bug 47424] DataTransferLength in SCSI_PASS_THROUGH and SCSI_PASS_THROUGH_DIRECT *must* have return value

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Jul 2 06:49:27 CDT 2019


https://bugs.winehq.org/show_bug.cgi?id=47424

--- Comment #4 from Peter <peter at 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

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list