From: Zebediah Figura z.figura12@gmail.com
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 --- dlls/ntdll/cdrom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/cdrom.c b/dlls/ntdll/cdrom.c index 4a3b84d4ad2..f6e3a86e34f 100644 --- a/dlls/ntdll/cdrom.c +++ b/dlls/ntdll/cdrom.c @@ -1658,7 +1658,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); @@ -1842,7 +1842,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);