IOCTL CD-ROM code now returns 'not ready' when TOC can not be read. Should fix crashes in Windows 9x when CD drive empty or disc changed.

This commit is contained in:
TomW 2015-06-27 16:39:06 +01:00
commit 78a36b2e9d

View file

@ -219,6 +219,8 @@ static int ioctl_ready(void)
ioctl_open(0);
temp=DeviceIoControl(hIOCTL,IOCTL_CDROM_READ_TOC, NULL,0,&ltoc,sizeof(ltoc),&size,NULL);
ioctl_close();
if (!temp)
return 0;
if ((ltoc.TrackData[ltoc.LastTrack].Address[1] != toc.TrackData[toc.LastTrack].Address[1]) ||
(ltoc.TrackData[ltoc.LastTrack].Address[2] != toc.TrackData[toc.LastTrack].Address[2]) ||
(ltoc.TrackData[ltoc.LastTrack].Address[3] != toc.TrackData[toc.LastTrack].Address[3]) ||