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.
This commit is contained in:
Jonathan Li 2018-06-02 10:02:09 +01:00
parent 83ffbc2d3d
commit 4ab97be693
1 changed files with 2 additions and 3 deletions

View File

@ -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)