How to enumerate all the devices on the IDE channel?

I am trying to write an application that would be able to enumerate what
kind of devices (ATA or ATAPI) are there on both IDE Channels. I have tried
to use IOCTL_STORAGE_QUERY_PROPERTY but I can only query the adapter, not
the devices since I don’t know what the names of the devices are
(PhysicalDrive0, CdRom0, etc.). I do know that I have to query scsi0: and
scsi1: but that gives me info about adapters and not devices.
I have also tried to use IOCTL_SCSI_MINIPORT with control code
IOCTL_SCSI_MINIPORT_IDENTIFY but that only works with ATA devices and I
don’t know how to set up the SRB for ATAPI devices. A third approach that I
have tried is to use SetupDi… functions, but there are several problems
attached to those. Firstly, some of the ones that I am using only work with
NT OSs and not on 9x. Secondly, SetupDiGetClassDevs only gets a list of
devices but does not co-relate them to their position on the IDE channels,
like the first drive is a PM, the second one is a SM; it just gives a list
of two drives.
Does anyone know how to solve this problem? Basically all I want the app to
do is this: (SAMPLE OUTPUT)

Here are the devices on your IDE Channels:
PM : ATA device (maybe some more info like the HDD info here)
PS : ATAPI device
SM : ATA device
SS : ATAPI device


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> I have also tried to use IOCTL_SCSI_MINIPORT with control code

IOCTL_SCSI_MINIPORT_IDENTIFY but that only works with ATA devices and I

Really?
Try SMART_RCV_DRIVE_DATA IOCTL - this can help.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi,

…ill not work on Win9x/WinMe (the guy wanted them as well?) if the
smartvsd.vxd is not loaded. And be careful with loading this vxd
dynamically -)

Regards,
Anton Kolomyeytsev

CoolDev.Com - Toolkits for Network & Storage Kernel Software Developers
“KoolSockets” & “KoolStorage” - TDI Client, Kernel Sockets, iSCSI port
www.CoolDev.Com xxxxx@CoolDev.Com xxxxx@CoolDev.Com

Really?
Try SMART_RCV_DRIVE_DATA IOCTL - this can help.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

So what do you suggest? How can I get it to work for 9X and NT?


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi,

You can try to use ASPI for IDE device enumeration. Check for Target ID on
ATAPI ports. If the device has TID 0 it’s master, if device has TDI 1 it’s
slave. Not a 100% cure. I’m not sure there is universal way that will work
on all machines and all OSes…

Regards,
Anton Kolomyeytsev

CoolDev.Com - Toolkits for Network & Storage Kernel Software Developers
“KoolSockets” & “KoolStorage” - TDI Client, Kernel Sockets, iSCSI port
www.CoolDev.Com xxxxx@CoolDev.Com xxxxx@CoolDev.Com

So what do you suggest? How can I get it to work for 9X and NT?


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com