From 4ab97be693be9cb43aac377e295dff1ca8ffbb3c Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Sat, 2 Jun 2018 10:02:09 +0100 Subject: [PATCH] cdvdgigaherz:windows: Adjust CD read success condition IOCTL_SCSI_PASS_THROUGH_DIRECT will return success even if the read fails (I'm not sure when it'll return failure). Assume the read is successful only when the read length is correct. --- plugins/cdvdGigaherz/src/Windows/IOCtlSrc.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/cdvdGigaherz/src/Windows/IOCtlSrc.cpp b/plugins/cdvdGigaherz/src/Windows/IOCtlSrc.cpp index 9c62025f6e..6ae9db3e4b 100644 --- a/plugins/cdvdGigaherz/src/Windows/IOCtlSrc.cpp +++ b/plugins/cdvdGigaherz/src/Windows/IOCtlSrc.cpp @@ -180,9 +180,8 @@ bool IOCtlSrc::ReadSectors2352(u32 sector, u32 count, u8 *buffer) const DWORD unused; if (DeviceIoControl(m_device, IOCTL_SCSI_PASS_THROUGH_DIRECT, &sptd, sizeof(sptd), &sptd, sizeof(sptd), &unused, nullptr)) { - if (sptd.info.DataTransferLength != 2352) - printf(" * CDVD: SPTI short transfer of %u bytes", sptd.info.DataTransferLength); - continue; + if (sptd.info.DataTransferLength == 2352) + continue; } printf(" * CDVD: SPTI failed reading sector %u; SENSE %u -", current_sector, sptd.info.SenseInfoLength); for (const auto &c : sptd.sense_buffer)