Changed the IOCtl implementation of READ TRACK INFORMATION so that it returns if it succeded or failed, so the ATAPI and SCSI controllers can then act accordingly.

This commit is contained in:
OBattler
2016-12-25 17:52:17 +01:00
parent 4d71ebaf67
commit 92c44cb89f
5 changed files with 42 additions and 7 deletions

View File

@@ -537,11 +537,13 @@ static void ioctl_read_header(uint8_t *in_cdb, uint8_t *b)
ioctl_close();
}
static void ioctl_read_track_information(uint8_t *in_cdb, uint8_t *b)
static int ioctl_read_track_information(uint8_t *in_cdb, uint8_t *b)
{
int maxlen = 0;
int len = 0;
int ret = 0;
const UCHAR cdb[12];
UCHAR buf[65535];
@@ -552,7 +554,12 @@ static void ioctl_read_track_information(uint8_t *in_cdb, uint8_t *b)
ioctl_open(0);
memcpy(cdb, in_cdb, 12);
SCSICommand(cdb, buf, 65535);
ret = SCSICommand(cdb, buf, 65535);
if (!ret)
{
return 0;
}
len = buf[0];
len <<= 8;
@@ -569,6 +576,8 @@ static void ioctl_read_track_information(uint8_t *in_cdb, uint8_t *b)
memcpy(b, buf, len);
ioctl_close();
return 1;
}
static void ioctl_read_disc_information(uint8_t *b)