Maxim
Fri Mar 21 20:28:16 CDT 2008
What I suggest is to list all disk names in the system by
SetupDiGetClassDevs/SetupDiEnumDeviceInterfaces/SetupDiGetDeviceInterfaceDetail
, open each and then determine which of them is your enclosure.
You can also enumerate \\.\PhysicalDrive%d incrementing the counter, but
this is lesser correct.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
"KenH" <KenHwang@newsgroup.nospam> wrote in message
news:3D2B345D-EB52-4CF6-8CD2-5D30923339FB@microsoft.com...
> Maxim,
>
> Thanks but I didn't get it. As I learned from the ddk spti sample I will
> need to use the device name in the CreateFile function call to get the
> Windows handle. And then use the handle in the SCSI_PASS_THROUGH,
> SCSIOP_INQUIRY IOCTL to get the Inquiry data back. You mentioned get the
> enclosure name from the Inquiry data. But I'll need the device name first in
> order to use the IOCTL. Or you're talking about discovering? Am I missing
> something?
>
> Ken
>
> "KenH" wrote:
>
> > Hi,
> >
> > I need to send various SCSI commands to a SAS disk enclosure connected with
> > LSI SCSI HBA. I read the SPTI sample in DDK and realize I need to use
> > CreateFile with device name such as \\.\PhysicalDrive0, \\.\scsi1: to get a
> > handle of the device and then use the handle in the SCSI_PASS_THROUGH IOCTL
> > call to send SCSI command to the specific SCSI device. But I could not find
> > the name for the SAS Disk Enclosure. Can anyone give me a hint on the disk
> > enclosure name and how to discover a disk enclosure?
> >
> > Thanks,
> >
> > Ken