Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > Eliminating non-optical disc devices when enumerating with GUID_DEVINTERFACE_CDROM

Reply
Thread Tools Display Modes

Eliminating non-optical disc devices when enumerating with GUID_DEVINTERFACE_CDROM

 
 
bilm
Guest
Posts: n/a

 
      05-26-2010
If you use as guidance the MS DDK example "EnumCD" and/or KB 305184 to
enumerate CD/DVD devices you can get devices other than those that read &
write to actual (physical) optical discs.

Many USB memory sticks include an ISO file that is apparently recognized as
a device in the interface class GUID_DEVINTERFACE_CDROM.
Likewise for virtual drives. I've written hacks that seem to work in
eliminating these from enumeration.

The hack for virtual drives is to use SPDRP_ENUMERATOR_NAME and if it's not
IDE, USB or SBP(firewire) then it doesn't get enumerated. The memory stick
hack is searching the drive for the presence of a file with the dot iso
extension. I don't feel good about either of these.

Can anyone think of something I can use to improve reliability here ?

( GUID_DEVINTERFACE_CDROM is defined in Ntddstor.h )

bilm





 
Reply With Quote
 
 
 
 
Uwe Sieber
Guest
Posts: n/a

 
      05-28-2010

I have never seen a USB drive with a fake CDROM whose
data come out of an ISO file present on this drive...

Anyway, so far I have such devices a USB devices only.
So, if the BusType is USB then you can call CM_Get_Parent
to get the USB device, then CM_Get_Child and CM_Get_Sibling
to get all the USB device's childs. One of them is
your CDROM. If you find a DISK too, then it is a USB drive
with DISK + fake CDROM.


Uwe




bilm wrote:
> If you use as guidance the MS DDK example "EnumCD" and/or KB 305184 to
> enumerate CD/DVD devices you can get devices other than those that read &
> write to actual (physical) optical discs.
>
> Many USB memory sticks include an ISO file that is apparently recognized as
> a device in the interface class GUID_DEVINTERFACE_CDROM.
> Likewise for virtual drives. I've written hacks that seem to work in
> eliminating these from enumeration.
>
> The hack for virtual drives is to use SPDRP_ENUMERATOR_NAME and if it's not
> IDE, USB or SBP(firewire) then it doesn't get enumerated. The memory stick
> hack is searching the drive for the presence of a file with the dot iso
> extension. I don't feel good about either of these.
>
> Can anyone think of something I can use to improve reliability here ?
>
> ( GUID_DEVINTERFACE_CDROM is defined in Ntddstor.h )
>
> bilm
>
>
>
>
>

 
Reply With Quote
 
Pavel A.
Guest
Posts: n/a

 
      05-28-2010
"Uwe Sieber" <> wrote in message
news:...
>
> I have never seen a USB drive with a fake CDROM whose

data come out of an ISO file present on this drive...

Here is one: www.i-odd.com
But it's virtual CDROM looks as a real one.
There is no way to tell it's fake when its HDD interface (with the iso
file) is turned off.
-- pa

> Anyway, so far I have such devices a USB devices only.
> So, if the BusType is USB then you can call CM_Get_Parent
> to get the USB device, then CM_Get_Child and CM_Get_Sibling
> to get all the USB device's childs. One of them is
> your CDROM. If you find a DISK too, then it is a USB drive
> with DISK + fake CDROM.
>
>
> Uwe
>
>
>
>
> bilm wrote:
>> If you use as guidance the MS DDK example "EnumCD" and/or KB 305184 to
>> enumerate CD/DVD devices you can get devices other than those that read &
>> write to actual (physical) optical discs.
>>
>> Many USB memory sticks include an ISO file that is apparently recognized
>> as
>> a device in the interface class GUID_DEVINTERFACE_CDROM.
>> Likewise for virtual drives. I've written hacks that seem to work in
>> eliminating these from enumeration.
>>
>> The hack for virtual drives is to use SPDRP_ENUMERATOR_NAME and if it's
>> not
>> IDE, USB or SBP(firewire) then it doesn't get enumerated. The memory
>> stick
>> hack is searching the drive for the presence of a file with the dot iso
>> extension. I don't feel good about either of these.
>>
>> Can anyone think of something I can use to improve reliability here ?
>>
>> ( GUID_DEVINTERFACE_CDROM is defined in Ntddstor.h )
>>
>> bilm



 
Reply With Quote
 
Uwe Sieber
Guest
Posts: n/a

 
      05-28-2010
Pavel A. wrote:
> "Uwe Sieber" <> wrote in message
>>
>> I have never seen a USB drive with a fake CDROM whose

> data come out of an ISO file present on this drive...
>
> Here is one: www.i-odd.com
> But it's virtual CDROM looks as a real one.
> There is no way to tell it's fake when its HDD interface (with the iso
> file) is turned off.


Thanks, I never came across such a device. I had
U3 style flash drives in mind.
And yes, if it is in pure "CD Mode" then the simulation
is perfect. Reading some random data and measuring the
speed might be the final hack. If it is slow then it
is a real drive...


Uwe
 
Reply With Quote
 
bilm
Guest
Posts: n/a

 
      05-29-2010
Uwe,

The ISO thing is just a hack. All U3 USB sticks use it but it works with any
USB stick.

For U3s, the applauncher.exe & autorun.inf files are wrapped in an ISO 9660
file and placed in the root directory. When the stick is inserted, Windows
detects the ISO file system, thinks it's a CD/DVD because they're the only
storage that uses it, the autorun.inf file runs and starts up
applauncher.exe (autorun must be enabled).

--- Excerpt from Wikipedia on U3s at http://en.wikipedia.org/wiki/U3
"A U3 flash drive presents itself to the host system as a USB hub with a CD
drive and standard USB mass storage device attached. This configuration
causes Windows disk management to show two drives:
1. A read-only ISO 9660 volume on an emulated CD-ROM drive with an autorun
configuration to execute the U3 LaunchPad, and;
2. A standard flash drive (FAT formatted) that includes a hidden "SYSTEM"
folder with installed applications."
---

The ISO can contain boot code so folks with newer systems can boot their
computer from their USB stick.

You can wrap any program you want within the ISO. As Pavel's example points
out, the hack can be used on any number of devices.

I was hoping for a WinAPI that examines the hardware characteristics of a
drive (not volume information) and reports the USB memory stick as
a disk drive (removable) not a CD-ROM drive. If you can think of one let
me know.

In the meantime I'm going to send a SCSI MMC command ( www.t10.org ) which
only a real CD/DVD drive can respond to correctly. It will make the startup
enumeration slower but that's the price for increased reliability.

By the way, I want to thank you for some posts you sent about device
notification particularly how to use RegisterDeviceNotification. They really
helped clear up the mystery.

Regards,

bilm

"Uwe Sieber" <> wrote in message
news:...
>
> I have never seen a USB drive with a fake CDROM whose
> data come out of an ISO file present on this drive...
>
> Anyway, so far I have such devices a USB devices only.
> So, if the BusType is USB then you can call CM_Get_Parent
> to get the USB device, then CM_Get_Child and CM_Get_Sibling
> to get all the USB device's childs. One of them is
> your CDROM. If you find a DISK too, then it is a USB drive
> with DISK + fake CDROM.
>
>
> Uwe
>
>
>
>
> bilm wrote:
>> If you use as guidance the MS DDK example "EnumCD" and/or KB 305184 to
>> enumerate CD/DVD devices you can get devices other than those that read &
>> write to actual (physical) optical discs.
>>
>> Many USB memory sticks include an ISO file that is apparently recognized
>> as
>> a device in the interface class GUID_DEVINTERFACE_CDROM.
>> Likewise for virtual drives. I've written hacks that seem to work in
>> eliminating these from enumeration.
>>
>> The hack for virtual drives is to use SPDRP_ENUMERATOR_NAME and if it's
>> not
>> IDE, USB or SBP(firewire) then it doesn't get enumerated. The memory
>> stick
>> hack is searching the drive for the presence of a file with the dot iso
>> extension. I don't feel good about either of these.
>>
>> Can anyone think of something I can use to improve reliability here ?
>>
>> ( GUID_DEVINTERFACE_CDROM is defined in Ntddstor.h )
>>
>> bilm
>>
>>
>>
>>




 
Reply With Quote
 
Maxim S. Shatskih
Guest
Posts: n/a

 
      05-30-2010
> In the meantime I'm going to send a SCSI MMC command ( www.t10.org ) which
> only a real CD/DVD drive can respond to correctly.


And what is such a command? the perfect virtual CD drive will emulate them all.

--
Maxim S. Shatskih
Windows DDK MVP

http://www.storagecraft.com

 
Reply With Quote
 
bilm
Guest
Posts: n/a

 
      05-31-2010
Why would a 'virtual' CD drive program want to use SCSI MMC commands? They
can't manipulate a virtual drive or make the ISOs ('virtual discs') it
"mounts". ISOs are just data organized according to ISO9660 specs. Virtual
drive programs only need to use standard WinAPIs to do that. SCSI MMC
commands are designed & relevant only for a real piece of hardware (attached
to a physical hardware bus) that manipulate real physical discs.

Unless you mean the so called 'Virtual CD Burners'? They send a few scsi mmc
commands to enable their program to use an existing 'real' burner program to
burn their newly created ISOs to real CD/DVD discs using real CD/DVD drives.
They require you to already have Nero or Roxio or Windows Media Player, etc.
Some of these program describe creating a new ISO and mounting it as
"burning". I don't know how all that works but who needs a 'virtual burner'
if you already have a real burner program? Dunno. A virtual CD drive on the
other hand is quite useful.

I've tested Phantom Burner, Alcohol 120%/52% and the Original CD Emulator.
They all call themselves a virtual CD drive and include a 'virtual CD
Burner'. Are you referring to some other type of virtual CD drive program
issuing scsi mmc commands for some other purpose?

So far as enumeration is concerned who cares if a virtual CD drive program
can emulate scsi mmc commands because the drives they will be sending the
commands to are 'real drives' (the only devices the commands will work on).

Currently, I'm eliminated virtual drives from enumeration by checking the
Volume Mount Points. The virtual drive programs I've tested so far were
either \\?\scsi or \\?\acpi as compared with \\?\ide or \\?\usb or
\\?\sbp(Firewire) for hardware CD/DVD drives.

Finding a way to eliminate memory sticks containing an ISO from enumeration
is proving much more problematic, at least for me. I've just started playing
around with sending it scsi mmc commands and I haven't settled on one yet.
I was hoping you or one of the other experts could help me find a way to
distinguish these devices from real CD/DVD drives using a winapi.

bilm

"Maxim S. Shatskih" <> wrote in message
news:u1FUGo8$...
> In the meantime I'm going to send a SCSI MMC command ( www.t10.org ) which
> only a real CD/DVD drive can respond to correctly.


And what is such a command? the perfect virtual CD drive will emulate them
all.

--
Maxim S. Shatskih
Windows DDK MVP

http://www.storagecraft.com





 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Optical Devices Tenshii Windows Vista Hardware 1 02-14-2008 10:49 PM
USB Mass Storage Devices Unrecognized (Vista) Jason Windows Vista Hardware 9 06-01-2007 03:04 PM
previously working USB devices now showing as "Unknown Device" A L Windows Vista Hardware 4 02-27-2007 01:18 PM
bluetooth devices mtgb Windows Vista Hardware 0 12-16-2006 01:19 PM
Stop 0x0000007b at end of Install BobMiller Windows Vista Installation 2 08-03-2006 06:52 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59