Added a workaround for Alcohol/DT virtual drive bug #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This introduces a workaround for a bug in SPTD SATA controller used by Alcohol and DAEMON Tools where it doesn't return LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE error for out-of-range sector reads - this includes track 1 pregap which later versions of SafeDisc try to check. If the disc drive returns an error then SafeDisc gives up and doesn't bother checking pregap but SPTD returns success code despite not actually returning any sector data so SafeDisc keeps checking pregap and then fails the disc check since it did not receive valid data from the virtual drive.
This is only present on SPTD SATA controller which Alcohol (and presumably DT) uses on Windows 10. On Windows 7 and below, Alcohol emulates SCSI drive which doesn't have this bug.
The workaround checks if read command on negative LBA was attempted and success code was returned with empty output buffer. If yes, it manually writes LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE error.