ntdll: Correctly fill DataTransferLength in SCSI_PASS_THROUGH and SCSI_PASS_THROUGH_DIRECT.

DataTransferLength specifies the number of bytes transferred, but
sg_io_hdr_t.resid gives the number of bytes *not* transferred:
https://www.tldp.org/HOWTO/SCSI-Generic-HOWTO/x356.html

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47424
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit bf891f34af)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
oldstable
Zebediah Figura 2019-07-01 19:03:14 -05:00 committed by Michael Stefaniuc
parent a2ea837849
commit 3c8c47b1fb
1 changed files with 2 additions and 2 deletions

View File

@ -1661,7 +1661,7 @@ static NTSTATUS CDROM_ScsiPassThroughDirect(int fd, PSCSI_PASS_THROUGH_DIRECT pP
io = ioctl(fd, SG_IO, &cmd);
pPacket->ScsiStatus = cmd.status;
pPacket->DataTransferLength = cmd.resid;
pPacket->DataTransferLength -= cmd.resid;
pPacket->SenseInfoLength = cmd.sb_len_wr;
ret = CDROM_GetStatusCode(io);
@ -1845,7 +1845,7 @@ static NTSTATUS CDROM_ScsiPassThrough(int fd, PSCSI_PASS_THROUGH pPacket)
io = ioctl(fd, SG_IO, &cmd);
pPacket->ScsiStatus = cmd.status;
pPacket->DataTransferLength = cmd.resid;
pPacket->DataTransferLength -= cmd.resid;
pPacket->SenseInfoLength = cmd.sb_len_wr;
ret = CDROM_GetStatusCode(io);