Proper implementation of IOCTL_{STORAGE,CDROM}_CHECK_VERIFY.

This commit is contained in:
Peter Beutner 2005-10-26 10:13:09 +00:00 committed by Alexandre Julliard
parent 22c97cd98a
commit 4dcab2805c
1 changed files with 17 additions and 6 deletions

View File

@ -1029,17 +1029,28 @@ static NTSTATUS CDROM_ReadQChannel(int dev, int fd, const CDROM_SUB_Q_DATA_FORMA
/****************************************************************** /******************************************************************
* CDROM_Verify * CDROM_Verify
* * Implements: IOCTL_STORAGE_CHECK_VERIFY
* IOCTL_CDROM_CHECK_VERIFY
* *
*/ */
static NTSTATUS CDROM_Verify(int dev, int fd) static NTSTATUS CDROM_Verify(int dev, int fd)
{ {
/* quick implementation */ #if defined(linux)
CDROM_SUB_Q_DATA_FORMAT fmt; int ret;
SUB_Q_CHANNEL_DATA data;
fmt.Format = IOCTL_CDROM_CURRENT_POSITION; ret = ioctl(fd, CDROM_DRIVE_STATUS, NULL);
return CDROM_ReadQChannel(dev, fd, &fmt, &data) ? 1 : 0; if(ret == -1) {
TRACE("ioctl CDROM_DRIVE_STATUS failed(%s)!\n", strerror(errno));
return CDROM_GetStatusCode(ret);
}
if(ret == CDS_DISC_OK)
return STATUS_SUCCESS;
else
return STATUS_NO_MEDIA_IN_DEVICE;
#endif
FIXME("not implemented for non-linux\n");
return STATUS_NOT_SUPPORTED;
} }
/****************************************************************** /******************************************************************