Device Scan

I am writing an application that lists the SCSI controllers in a system and
the disks that are attached to those controllers. Currently, I find the
devices by scanning the registry key HKLM\hardware\devicemap\scsi. This
works, I’m just trying to revise the scan code to something a little
cleaner. So the question is, what is the best way to do this sort of scan
and device matching:

  1. Use the registry key that I already use. This just seems a little
    messy.
  2. Use SetupDi calls. I am currently using this method, but am stuck.
    I have a list of all SCSI controllers and a list of all disks. I can then
    use IOCTL_GET_SCSI_ADDRESS to get the PortNumber for each disk. The problem
    is that I can’t find a port number for the controller to do a match. Is
    there a way to get this? Is there a better method to associate the
    controllers and the disks using SetupDi calls?
  3. Should I be using some other method completely?

Thank you for the help,
Brett Henning

Can WMI help?

----- Original Message -----
From: “Henning, Brett”
To: “NT Developers Interest List”
Sent: Tuesday, May 13, 2003 9:37 PM
Subject: [ntdev] Device Scan

> I am writing an application that lists the SCSI controllers in a
system and
> the disks that are attached to those controllers. Currently, I find
the
> devices by scanning the registry key HKLM\hardware\devicemap\scsi.
This
> works, I’m just trying to revise the scan code to something a little
> cleaner. So the question is, what is the best way to do this sort
of scan
> and device matching:
> 1. Use the registry key that I already use. This just seems a
little
> messy.
> 2. Use SetupDi calls. I am currently using this method, but am
stuck.
> I have a list of all SCSI controllers and a list of all disks. I
can then
> use IOCTL_GET_SCSI_ADDRESS to get the PortNumber for each disk. The
problem
> is that I can’t find a port number for the controller to do a match.
Is
> there a way to get this? Is there a better method to associate the
> controllers and the disks using SetupDi calls?
> 3. Should I be using some other method completely?
>
> Thank you for the help,
> Brett Henning
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to
xxxxx@lists.osr.com