Prev: Type Conversions
Next: Strange MDL behavior
From: Boba on 28 Aug 2009 17:58 Dear All; I have data stored on CDs in raw mode. All discs can be read in cooked mode but reading some discs with DeviceIoControl specifiying IOCTL_CDROM_READ_RAW returns ERROR_INVALID_FUNCTION. My question is: what determines if a disk can be read in raw mode? Is it cdrom.sys? Is it disk it- self? (I assume it is not a bus driver.) Thank you. Boba.
From: bilm on 30 Aug 2009 15:20 Boba, You mean IOCTL_CDROM_RAW_READ ? I do not see IOCTL_CDROM_READ_RAW listed in the MSDN among the CD-ROM I/O Control Codes. This may be your 1st problem. Make sure your implementation agrees with the ntddcdrm header. There are no special requirements for reading a disc in raw mode. If it's raw data (not CDDA/audio) make sure you have the correct data block type (sector size) e.g.YellowMode2, or XAForm2 (for mixed audio & data). Make sure you get the handle for your CD/DVD drive using the device interface path. Don't use the CDROM Class (driver) name because many of these ioctls won't work on these drives with that handle. Even still it may not work. Many people have complained about these MS multimedia ioctls. Personally I don't use them. I recommend using IOCTL_SCSI_PASS_THROUGH_DIRECT and setting up the CDB per T10 specifications. It is much more reliable. Here is an example (C++) of using this ioctl for WAV data but you should be able to learn how to adapt it for raw data by changing the sector size. http://www.codeproject.com/KB/audio-video/SimpleAudioCD.aspx?display=Print another example ... http://files.codes-sources.com/fichier_fullscreen.aspx?id=25566&f=CdMusic.cpp&lang=en bilm "Boba" <Boba(a)somewhere.net> wrote in message news:OWjp8qCKKHA.4392(a)TK2MSFTNGP04.phx.gbl... > Dear All; > I have data stored on CDs in raw mode. > All discs can be read in cooked mode but > reading some discs with DeviceIoControl > specifiying IOCTL_CDROM_READ_RAW returns > ERROR_INVALID_FUNCTION. My question is: > what determines if a disk can be read in > raw mode? Is it cdrom.sys? Is it disk it- > self? (I assume it is not a bus driver.) > Thank you. Boba. > >
From: Boba on 31 Aug 2009 00:05 "bilm" <fence61775(a)mypacks.net> wrote in message news:OCL0eaaKKHA.5956(a)TK2MSFTNGP03.phx.gbl... > Boba, > > You mean IOCTL_CDROM_RAW_READ ? yes, sorry for the typo. > I do not see IOCTL_CDROM_READ_RAW listed > in the MSDN among the CD-ROM I/O Control Codes. > This may be your 1st problem. Make sure your > implementation agrees with the ntddcdrm header. > > There are no special requirements for reading a disc in > raw mode. If it's raw data (not CDDA/audio) make sure you > have the correct data block type (sector size) e.g.YellowMode2, > or XAForm2 (for mixed audio & data). > > Make sure you get the handle for your CD/DVD drive > using the device interface path. Don't use the CDROM > Class (driver) name because many of these ioctls > won't work on these drives with that handle. I'm trying to find out what makes some discs to be different wrt the call to DeviceIoControl even if they were burnt using the same IMAPI2::IDiscFormat2Data.Write(IStream*) method. > Even still it may not work. Many people have complained about > these MS multimedia ioctls. Personally I don't use them. I recommend using > IOCTL_SCSI_PASS_THROUGH_DIRECT and setting up the CDB > per T10 specifications. It is much more reliable. > > Here is an example (C++) of using this ioctl for WAV data but you should > be > able to learn how to adapt it for raw data by changing the sector size. > http://www.codeproject.com/KB/audio-video/SimpleAudioCD.aspx?display=Print > > another example ... > http://files.codes-sources.com/fichier_fullscreen.aspx?id=25566&f=CdMusic.cpp&lang=en > > bilm > these samples do not consider data CDs. thanks for your thoughts and the links. Boba.
From: bilm on 31 Aug 2009 14:30 If the discs are all CDs and you are using the same write routine (same exact code) on the exact same drive then : - is the disc a CD-R ? Are the ones that succeed CD-RW ? - check for scratches or dust on the discs that failed - check the disc manufacturer - is it the same one as the discs that succeeded ? bilm >> Boba, >> >> You mean IOCTL_CDROM_RAW_READ ? > > yes, sorry for the typo. > >> I do not see IOCTL_CDROM_READ_RAW listed >> in the MSDN among the CD-ROM I/O Control Codes. >> This may be your 1st problem. Make sure your >> implementation agrees with the ntddcdrm header. >> >> There are no special requirements for reading a disc in >> raw mode. If it's raw data (not CDDA/audio) make sure you >> have the correct data block type (sector size) e.g.YellowMode2, >> or XAForm2 (for mixed audio & data). >> >> Make sure you get the handle for your CD/DVD drive >> using the device interface path. Don't use the CDROM >> Class (driver) name because many of these ioctls >> won't work on these drives with that handle. > > I'm trying to find out what makes some discs to be different > wrt the call to DeviceIoControl even if they were burnt using > the same IMAPI2::IDiscFormat2Data.Write(IStream*) method. > >> Even still it may not work. Many people have complained about >> these MS multimedia ioctls. Personally I don't use them. I recommend >> using >> IOCTL_SCSI_PASS_THROUGH_DIRECT and setting up the CDB >> per T10 specifications. It is much more reliable. >> >> Here is an example (C++) of using this ioctl for WAV data but you should >> be >> able to learn how to adapt it for raw data by changing the sector size. >> http://www.codeproject.com/KB/audio-video/SimpleAudioCD.aspx?display=Print >> >> another example ... >> http://files.codes-sources.com/fichier_fullscreen.aspx?id=25566&f=CdMusic.cpp&lang=en >> >> bilm >> > > these samples do not consider data CDs. > thanks for your thoughts and the links. > Boba. > >
From: Boba on 31 Aug 2009 15:40
"bilm" <fence61775(a)mypacks.net> wrote in message news:OMUJ7imKKHA.1380(a)TK2MSFTNGP02.phx.gbl... > If the discs are all CDs and you are using the same write routine > (same exact code) on the exact same drive then : > - is the disc a CD-R ? Are the ones that succeed CD-RW ? > - check for scratches or dust on the discs that failed > - check the disc manufacturer - is it the same one as the discs that > succeeded ? different OSs, different hardware, different media (mint condition). (I can't tell what type the discs are: there is no labling on them.) SCSI bus driver returns SRB_STATUS_ERROR with both QUEUE_FROZEN and AUTOSENSE_VALID bits set. |