Re: Rip audio from USB CD device?

From: Alexander Grigoriev (alegr_at_earthlink.net)
Date: 04/06/04


Date: Tue, 6 Apr 2004 07:11:32 -0700

You don't need GENERIC_WRITE for opening CD drive to send IOCTL_CDROM_*,they
all are defined with FILE_READ_ACCESS:

#define IOCTL_CDROM_RAW_READ CTL_CODE(IOCTL_CDROM_BASE, 0x000F,
METHOD_OUT_DIRECT, FILE_READ_ACCESS)

Specify GENERIC_READ in CreateFile. Some of IOCTL_STORAGE_ codes will only
work if you specify zero as access mask, so you may need to open two
handles. Specify both FILE_SHARE_READ and FILE_SHARE_WRITE. You should not
care whether anybody is trying to open the CD drive with GENERIC_WRITE
access. In fact, only Administrators can do it in Win2K/XP.

You only need GENERIC_WRITE if you want to send IOCTL_SCSI_PASSTROUGH, but
this access right is allowed for administrators only, and in general should
be avoided in commercial software.

For an example of software which uses IOCTL_CDROM_RAW_READ, download
Audiograbber from http://www.audiograbber.com-us.net/ (check "WinNT/2000
calls" option).

In Windows 2000, Windows Media Player uses cdral.dll for CD recording,
licenced by MS from Roxio. CDRAL.DLL is also installed by other Roxio
software, such as WinOnCD. This DLL provides the same functions (the same
names and data structures) as ASPI, but only works for CD/DVD devices.
Because
this is not MS' own library, they don't expect you to use it in your
applications. Even if you're smart enough to figure it out in Win2K, in
Windows XP it's gone (nobody promised it would be there!). Such is fate of
undocumented features.
CD reading in WMP for Win2K and XP is still done by IOCTL_CDROM_RAW_READ.

"Rolf Nilsson" <nospam@nomail.nu> wrote in message
news:%23Z8n130GEHA.744@TK2MSFTNGP09.phx.gbl...
>
> Hi,
>
> Thanks for responding!
>
>
> "Alexander Grigoriev" <alegr@earthlink.net> skrev i meddelandet
> news:ebNingsGEHA.1180@TK2MSFTNGP09.phx.gbl...
> > No need to blame Microsoft for "secrecy".
> > Do your homework: read about IOCTL_CDROM_RAW_READ.
>
> I've done that homework a long time ago
>
> anyway,
>
> IOCTL_CDROM_RAW_READ works fine as long as you are able to open the
device.
>
> If another process has opened the same device in the same way with say:
>
> HANDLE hFile = CreateFile(\\\\.\\D:, GENERIC_READ | GENERIC_WRITE,
> FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL/*0*/, NULL );
>
> the second one will fail with the following message:
> "Can not access the file since it's in use by another process"
>
> If there is a way to open it I would be happy to know about that, I've
tried
> for years.
>
>
> As far as I know there are three options to get hold of the raw audio data
>
> 1. ASPI - works fine on all Windows platforms, must be installed by the
user
> on Windows NT, 2000 and XP
> and this is not easy for an average user. Does not work with USB devices.
>
> 2. SPTI (SCSII Pass Thru Interface) - works on Windows NT, 2000 and XP,
is
> sinilar to ASPI but one must login
> with administrator rights and no other process can use the device, if so
it
> fails. Does not work with USB devices.
>
> 3. IOCTL_CDROM_RAW_READ - works on Windows NT, 2000 and XP and does work
> with USB devices.
> Using it without administrator rights works fine BUT other processes can
use
> the device only if it's NOT opened in the same way.
>
> >
> > "The only software that can extract audio of an audio CD at any time,
> > without any restrictions is WMP, period"
> >
> > You seem to want to read more from EU lawsuit proceedings,
>
> I don't care about it, it's just big news here in Europe at the moment.
>
> > rather than
> > Windows SDK/DDK programming docimentation. There are tons of software
that
> > can do it, even open source.
>
> Please let me know what software you are thinking of besides WMP and
iTunes
> that can access the raw data, not just playing the CD, without being
> disturbed by another process
> accessing the same CD device and not using third party drivers/software.
>
>
> I would love to be proved being wrong
>
> Thanks
> Rolf
>
>
>
> > Check sourceforge.net.
> >
> > "Rolf Nilsson" <nospam@nomail.nu> wrote in message
> > news:eSKzWnnGEHA.580@TK2MSFTNGP11.phx.gbl...
> > >
> > > " Thomas Osthege" <onlyspam@gmx.net> skrev i meddelandet
> > > news:%23Pl7BBmGEHA.2052@TK2MSFTNGP12.phx.gbl...
> > > > "Rolf Nilsson" <nospam@nomail.nu> schrieb im Newsbeitrag
> > > > news:Or9iYNYGEHA.264@TK2MSFTNGP12.phx.gbl...
> > > > |
> > > > | Hi,
> > > > |
> > > > | Is there a way to extract the info in the .cda files that Windows
> > > > displays
> > > > | to us or are they just "dummy" files with no particular meaning?
> > > > |
> > > > | Any hints, help or information appreciated
> > > > |
> > > > | Thanks
> > > > | Rolf
> > > >
> > > >
> > > > Hi Rolf,
> > > >
> > > > I did it with with the burning software. I use WinOnCD version 5.
This
> > > > works great for me.
> > >
> > >
> > > thanks for the info
> > >
> > > but this newsgroups is about programming, not using software
> > >
> > > The easist solution to my problem is to simply use Windows Media
Player
> to
> > > do the job
> > > and that's what Microsoft wants us to do, use WMP for everything and
> kill
> > > all competitors.
> > >
> > > I'm one of the competitors and want to programatically solve this
> problem,
> > > not to be able to
> > > rip CD audio tracks to create MP3 files but to be able to playback
audio
> > and
> > > process the content before sending it out,
> > > i.e. add some reverb, maybe do some EQ on the music or whatever. On
the
> > Mac
> > > platform this is simple, easy, documented etc.
> > > If you can't get it working you can even ask for help from the guys
> behind
> > > the scene (the Mac OS sytem people) and you get help.
> > > Not so with MS.
> > >
> > > The problem is (and the Eurpean Union has just sued Micorsoft to pay
500
> > > millions of Euro, they will of course not succeed and maybe they
should
> > > not?)
> > > but they point to the problem that Microsoft hides a lot of
information
> > and
> > > monopolize certain things.
> > >
> > > Ever since the old DOS days, all programmers knows, there is a lot of
> > > undocumented API calls that are not available to the public
> > > and I would guess (without knowing), this is stil the case.
> > >
> > > The only software that can extract audio of an audio CD at any time,
> > without
> > > any restrictions is WMP, period, well OK it seems Apples iTunes
> > > can as well, but no other to my knowledge without installing third
party
> > > software as ASPI drivers etc.
> > >
> > > You can get around it by logging in as administrator, install third
> party
> > > drivers, etc, etc but we need a documented and working solution, not
> > > potential hacks that may or may not work. Microsoft needs it as well
to
> > not
> > > be left behind. I love programming Windows as much as any other OS but
> it
> > > must not be impossible to do what is/should be simple.
> > >
> > > Rolf
> > >
> > >
> > >
> > > >
> > > > Thomas
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: ASM objects?
    ... > Mind explaining what Borland's OWL is about? ... "Microsoft" is written multiple times on the Windows loading screen (it ... endianness thereafter... ... smart to specify and when it's actually far, ...
    (alt.lang.asm)
  • Re: Recycle Bin Error.
    ... In My Computer or Windows Explorer, right-click the volume you want to ... [[The disk check could not be performed because the disk check utility needs ... You have to reboot for Error-checking to run. ... Specify a different file name. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Windows Version numbers for Windows 2008
    ... to specify the size of the structure. ... backwards compatibility among versions of Windows. ... Also, if I add extra members to the structure, like ... Pointer to an OSVERSIONINFO data structure that the function ...
    (microsoft.public.vb.winapi)
  • Re: Error 800A0046 while running a vbs script on a remote computer
    ... do I need administrator rights? ... Windows 2000 and I just ran the script on a Windows 2000 and it works. ... Microsoft MVP Scripting and ADSI ... You need administrative rights on the remote computer. ...
    (microsoft.public.scripting.vbscript)
  • Re: adding new user
    ... That is not normal and would not have anything to do with the Windows ... /R user Revoke specified user's access rights. ... Wildcards can be used to specify more that one file in a command. ... CI - Container Inherit. ...
    (microsoft.public.windowsxp.security_admin)