In Windows IOCTL CD-ROM code, only try reading via SPTI if ReadFile returned success but didn't read all requested data. Fixes Red Alert 2 installer.
This commit is contained in:
parent
5ef5fc1f98
commit
6a27983f17
1 changed files with 2 additions and 2 deletions
|
|
@ -451,8 +451,8 @@ static int ioctl_readsector(uint8_t *b, int sector, int count)
|
||||||
status = ReadFile(hIOCTL, b, count*2048, (LPDWORD)&size, NULL);
|
status = ReadFile(hIOCTL, b, count*2048, (LPDWORD)&size, NULL);
|
||||||
ioctl_close();
|
ioctl_close();
|
||||||
|
|
||||||
/*If the read failed, try again using SPTI*/
|
/*If the read 'succeeded' but didn't read all required data, try again using SPTI*/
|
||||||
if (!status || size != count*2048)
|
if (status && size != count*2048)
|
||||||
{
|
{
|
||||||
uint8_t cmd[12] = { 0xbe, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 };
|
uint8_t cmd[12] = { 0xbe, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 };
|
||||||
SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER swb;
|
SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER swb;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue