(For Win 2K and above)

I want to send IOCTLs to a disk device by getting a handle using
CreateFile(). I've been using SetupDiXXX with GUID_DEVINTERFACE_DISK
to get the string that can be used with CreateFile(). So this is
working well for drives known to the OS.

Now, for drives not known to the OS (e.g. connected to a RAID
controller) I cannot use the above method. There is a private
Passthru API from the controller oem that I need to use. I can get
the handle using "\\.\ScsiX:" but I don't know of a way to know if it
belongs to a specific controller. I can enumerate devices of type
GUID_DEVCLASS_SCSIADAPTER and find the controller I want to talk to,
but I can't get a handle thru CreateFile. Is there a way to
correspond a specific device in GUID_DEVCLASS_SCSIADAPTER to the
proper "\\.\ScsiX:"?

Re: How to find an interface to be used with CreateFile() by Peter

Peter
Wed May 05 13:24:05 CDT 2004

what happens when you try to get a handle to the SCSI device interface?

-p

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"the veloper" <ppp_l_qqq@yahoo.com> wrote in message
news:de0ced42.0405041224.639b0feb@posting.google.com...
> (For Win 2K and above)
>
> I want to send IOCTLs to a disk device by getting a handle using
> CreateFile(). I've been using SetupDiXXX with GUID_DEVINTERFACE_DISK
> to get the string that can be used with CreateFile(). So this is
> working well for drives known to the OS.
>
> Now, for drives not known to the OS (e.g. connected to a RAID
> controller) I cannot use the above method. There is a private
> Passthru API from the controller oem that I need to use. I can get
> the handle using "\\.\ScsiX:" but I don't know of a way to know if it
> belongs to a specific controller. I can enumerate devices of type
> GUID_DEVCLASS_SCSIADAPTER and find the controller I want to talk to,
> but I can't get a handle thru CreateFile. Is there a way to
> correspond a specific device in GUID_DEVCLASS_SCSIADAPTER to the
> proper "\\.\ScsiX:"?



Re: How to find an interface to be used with CreateFile() by ppp_l_qqq

ppp_l_qqq
Tue May 11 15:27:24 CDT 2004

Do you meant using SetupDiXXX to get the interface path for
GUID_DEVINTERFACE_STORAGEPORT?

If so, it returns no available devices of this GUID. Is there another
GUID that I can use for a SCSI Interface?






"Peter Wieland [MSFT]" <peterwie@online.microsoft.com> wrote in message news:<eaWwm4sMEHA.3380@TK2MSFTNGP11.phx.gbl>...
> what happens when you try to get a handle to the SCSI device interface?
>
> -p
>

Re: How to find an interface to be used with CreateFile() by Peter

Peter
Tue May 11 16:14:24 CDT 2004

"I can enumerate devices of type GUID_DEVCLASS_SCSIADAPTER and find the
controller I want to talk to, but I can't get a handle thru CreateFile"

You implied that you could get get the name for the device but that create
file didn't work. What is the error when createFile returns?

-p



--
This posting is provided "AS IS" with no warranties, and confers no rights.
"the veloper" <ppp_l_qqq@yahoo.com> wrote in message
news:de0ced42.0405111227.14791797@posting.google.com...
> Do you meant using SetupDiXXX to get the interface path for
> GUID_DEVINTERFACE_STORAGEPORT?
>
> If so, it returns no available devices of this GUID. Is there another
> GUID that I can use for a SCSI Interface?
>
>
>
>
>
>
> "Peter Wieland [MSFT]" <peterwie@online.microsoft.com> wrote in message
> news:<eaWwm4sMEHA.3380@TK2MSFTNGP11.phx.gbl>...
>> what happens when you try to get a handle to the SCSI device interface?
>>
>> -p
>>



Re: How to find an interface to be used with CreateFile() by ppp_l_qqq

ppp_l_qqq
Wed May 19 11:50:19 CDT 2004

... I got delayed on something else ...

When I said "I can't get a handle thru CreateFile" is because there is
nothing from the infor returned by GUID_DEVCLASS_SCSIADAPTER that I
can use to pass as the first parameter to CreateFile(). This is in
contrast to when using GUID_DEVINTERFACE_DISK because I can use
SetupDiEnumDeviceInterfaces() to get the interface path that I can
pass along to CreateFile(). Calling SetupDiEnumDeviceInterfaces() for
GUID_DEV_CLASS_SCSIADAPTER of course does not work because it is not
an interface class.


"Peter Wieland [MSFT]" <peterwie@online.microsoft.com> wrote in message news:<uaQowz5NEHA.2972@TK2MSFTNGP10.phx.gbl>...
> "I can enumerate devices of type GUID_DEVCLASS_SCSIADAPTER and find the
> controller I want to talk to, but I can't get a handle thru CreateFile"
>
> You implied that you could get get the name for the device but that create
> file didn't work. What is the error when createFile returns?
>
> -p

Re: How to find an interface to be used with CreateFile() by Peter

Peter
Wed May 19 12:49:42 CDT 2004

d'oh. sorry - i missed that distinction.

-p

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"the veloper" <ppp_l_qqq@yahoo.com> wrote in message
news:de0ced42.0405190850.3cc8c12d@posting.google.com...
> ... I got delayed on something else ...
>
> When I said "I can't get a handle thru CreateFile" is because there is
> nothing from the infor returned by GUID_DEVCLASS_SCSIADAPTER that I
> can use to pass as the first parameter to CreateFile(). This is in
> contrast to when using GUID_DEVINTERFACE_DISK because I can use
> SetupDiEnumDeviceInterfaces() to get the interface path that I can
> pass along to CreateFile(). Calling SetupDiEnumDeviceInterfaces() for
> GUID_DEV_CLASS_SCSIADAPTER of course does not work because it is not
> an interface class.
>
>
> "Peter Wieland [MSFT]" <peterwie@online.microsoft.com> wrote in message
news:<uaQowz5NEHA.2972@TK2MSFTNGP10.phx.gbl>...
> > "I can enumerate devices of type GUID_DEVCLASS_SCSIADAPTER and find the
> > controller I want to talk to, but I can't get a handle thru CreateFile"
> >
> > You implied that you could get get the name for the device but that
create
> > file didn't work. What is the error when createFile returns?
> >
> > -p



Re: How to find an interface to be used with CreateFile() by Alexander

Alexander
Thu May 20 15:19:49 CDT 2004

GUID_DEVCLASS_SCSIADAPTER is device class guid (which you can find under
HKLM/CurrentControlSet/Control/Class).

It if NOT SCSI interface class.

Try GUID_DEVINTERFACE_STORAGEPORT

"the veloper" <ppp_l_qqq@yahoo.com> wrote in message
news:de0ced42.0405190850.3cc8c12d@posting.google.com...
> ... I got delayed on something else ...
>
> When I said "I can't get a handle thru CreateFile" is because there is
> nothing from the infor returned by GUID_DEVCLASS_SCSIADAPTER that I
> can use to pass as the first parameter to CreateFile(). This is in
> contrast to when using GUID_DEVINTERFACE_DISK because I can use
> SetupDiEnumDeviceInterfaces() to get the interface path that I can
> pass along to CreateFile(). Calling SetupDiEnumDeviceInterfaces() for
> GUID_DEV_CLASS_SCSIADAPTER of course does not work because it is not
> an interface class.
>
>
> "Peter Wieland [MSFT]" <peterwie@online.microsoft.com> wrote in message
news:<uaQowz5NEHA.2972@TK2MSFTNGP10.phx.gbl>...
> > "I can enumerate devices of type GUID_DEVCLASS_SCSIADAPTER and find the
> > controller I want to talk to, but I can't get a handle thru CreateFile"
> >
> > You implied that you could get get the name for the device but that
create
> > file didn't work. What is the error when createFile returns?
> >
> > -p



Re: How to find an interface to be used with CreateFile() by Mark

Mark
Fri May 21 05:59:54 CDT 2004

Last time I looked you still have to do the nt4-style createfile on names
such as scsi0.

--

=====================
Mark Roddy
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com
markr@hollistech.com


"Alexander Grigoriev" <alegr@earthlink.net> wrote in message
news:%23WdxLfqPEHA.3140@TK2MSFTNGP11.phx.gbl...
> GUID_DEVCLASS_SCSIADAPTER is device class guid (which you can find under
> HKLM/CurrentControlSet/Control/Class).
>
> It if NOT SCSI interface class.
>
> Try GUID_DEVINTERFACE_STORAGEPORT
>
> "the veloper" <ppp_l_qqq@yahoo.com> wrote in message
> news:de0ced42.0405190850.3cc8c12d@posting.google.com...
> > ... I got delayed on something else ...
> >
> > When I said "I can't get a handle thru CreateFile" is because there is
> > nothing from the infor returned by GUID_DEVCLASS_SCSIADAPTER that I
> > can use to pass as the first parameter to CreateFile(). This is in
> > contrast to when using GUID_DEVINTERFACE_DISK because I can use
> > SetupDiEnumDeviceInterfaces() to get the interface path that I can
> > pass along to CreateFile(). Calling SetupDiEnumDeviceInterfaces() for
> > GUID_DEV_CLASS_SCSIADAPTER of course does not work because it is not
> > an interface class.
> >
> >
> > "Peter Wieland [MSFT]" <peterwie@online.microsoft.com> wrote in message
> news:<uaQowz5NEHA.2972@TK2MSFTNGP10.phx.gbl>...
> > > "I can enumerate devices of type GUID_DEVCLASS_SCSIADAPTER and find
the
> > > controller I want to talk to, but I can't get a handle thru
CreateFile"
> > >
> > > You implied that you could get get the name for the device but that
> create
> > > file didn't work. What is the error when createFile returns?
> > >
> > > -p
>
>



Re: How to find an interface to be used with CreateFile() by Alexander

Alexander
Fri May 21 09:16:55 CDT 2004

If one wants all devices with SCSI-like command interface, like CD drives
and scanners connected through IDE, USB, IEEE1394, I think those SCSI ports
don't have NT4 style name.

You can also use the interface GUID for notifications.

"Mark Roddy" <markr@hollistech.com> wrote in message
news:%23w2aBLyPEHA.3216@TK2MSFTNGP12.phx.gbl...
> Last time I looked you still have to do the nt4-style createfile on names
> such as scsi0.
>
> --
>
> =====================
> Mark Roddy
> Windows 2003/XP/2000 Consulting
> Hollis Technology Solutions 603-321-1032
> www.hollistech.com
> markr@hollistech.com
>
>
> "Alexander Grigoriev" <alegr@earthlink.net> wrote in message
> news:%23WdxLfqPEHA.3140@TK2MSFTNGP11.phx.gbl...
> > GUID_DEVCLASS_SCSIADAPTER is device class guid (which you can find under
> > HKLM/CurrentControlSet/Control/Class).
> >
> > It if NOT SCSI interface class.
> >
> > Try GUID_DEVINTERFACE_STORAGEPORT
> >
> > "the veloper" <ppp_l_qqq@yahoo.com> wrote in message
> > news:de0ced42.0405190850.3cc8c12d@posting.google.com...
> > > ... I got delayed on something else ...
> > >
> > > When I said "I can't get a handle thru CreateFile" is because there is
> > > nothing from the infor returned by GUID_DEVCLASS_SCSIADAPTER that I
> > > can use to pass as the first parameter to CreateFile(). This is in
> > > contrast to when using GUID_DEVINTERFACE_DISK because I can use
> > > SetupDiEnumDeviceInterfaces() to get the interface path that I can
> > > pass along to CreateFile(). Calling SetupDiEnumDeviceInterfaces() for
> > > GUID_DEV_CLASS_SCSIADAPTER of course does not work because it is not
> > > an interface class.
> > >
> > >
> > > "Peter Wieland [MSFT]" <peterwie@online.microsoft.com> wrote in
message
> > news:<uaQowz5NEHA.2972@TK2MSFTNGP10.phx.gbl>...
> > > > "I can enumerate devices of type GUID_DEVCLASS_SCSIADAPTER and find
> the
> > > > controller I want to talk to, but I can't get a handle thru
> CreateFile"
> > > >
> > > > You implied that you could get get the name for the device but that
> > create
> > > > file didn't work. What is the error when createFile returns?
> > > >
> > > > -p
> >
> >
>
>



Re: How to find an interface to be used with CreateFile() by Mark

Mark
Fri May 21 12:13:36 CDT 2004

Right. But if you want the adapter devices you can't use a device interface.
Keeps us programmers on our toes :-)

--

=====================
Mark Roddy
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com
markr@hollistech.com


"Alexander Grigoriev" <alegr@earthlink.net> wrote in message
news:e3rRH5zPEHA.2132@TK2MSFTNGP11.phx.gbl...
> If one wants all devices with SCSI-like command interface, like CD drives
> and scanners connected through IDE, USB, IEEE1394, I think those SCSI
ports
> don't have NT4 style name.
>
> You can also use the interface GUID for notifications.
>
> "Mark Roddy" <markr@hollistech.com> wrote in message
> news:%23w2aBLyPEHA.3216@TK2MSFTNGP12.phx.gbl...
> > Last time I looked you still have to do the nt4-style createfile on
names
> > such as scsi0.
> >
> > --
> >
> > =====================
> > Mark Roddy
> > Windows 2003/XP/2000 Consulting
> > Hollis Technology Solutions 603-321-1032
> > www.hollistech.com
> > markr@hollistech.com
> >
> >
> > "Alexander Grigoriev" <alegr@earthlink.net> wrote in message
> > news:%23WdxLfqPEHA.3140@TK2MSFTNGP11.phx.gbl...
> > > GUID_DEVCLASS_SCSIADAPTER is device class guid (which you can find
under
> > > HKLM/CurrentControlSet/Control/Class).
> > >
> > > It if NOT SCSI interface class.
> > >
> > > Try GUID_DEVINTERFACE_STORAGEPORT
> > >
> > > "the veloper" <ppp_l_qqq@yahoo.com> wrote in message
> > > news:de0ced42.0405190850.3cc8c12d@posting.google.com...
> > > > ... I got delayed on something else ...
> > > >
> > > > When I said "I can't get a handle thru CreateFile" is because there
is
> > > > nothing from the infor returned by GUID_DEVCLASS_SCSIADAPTER that I
> > > > can use to pass as the first parameter to CreateFile(). This is in
> > > > contrast to when using GUID_DEVINTERFACE_DISK because I can use
> > > > SetupDiEnumDeviceInterfaces() to get the interface path that I can
> > > > pass along to CreateFile(). Calling SetupDiEnumDeviceInterfaces()
for
> > > > GUID_DEV_CLASS_SCSIADAPTER of course does not work because it is not
> > > > an interface class.
> > > >
> > > >
> > > > "Peter Wieland [MSFT]" <peterwie@online.microsoft.com> wrote in
> message
> > > news:<uaQowz5NEHA.2972@TK2MSFTNGP10.phx.gbl>...
> > > > > "I can enumerate devices of type GUID_DEVCLASS_SCSIADAPTER and
find
> > the
> > > > > controller I want to talk to, but I can't get a handle thru
> > CreateFile"
> > > > >
> > > > > You implied that you could get get the name for the device but
that
> > > create
> > > > > file didn't work. What is the error when createFile returns?
> > > > >
> > > > > -p
> > >
> > >
> >
> >
>
>



Re: How to find an interface to be used with CreateFile() by Alexander

Alexander
Fri May 21 21:37:28 CDT 2004

Actually, I was not right.

GUID_DEVINTERFACE_STORAGEPORT is only registered for real SCSI adapters.

"Mark Roddy" <markr@hollistech.com> wrote in message
news:%23sCI2b1PEHA.2132@TK2MSFTNGP11.phx.gbl...
> Right. But if you want the adapter devices you can't use a device
interface.
> Keeps us programmers on our toes :-)
>
> --
>
> =====================
> Mark Roddy
> Windows 2003/XP/2000 Consulting
> Hollis Technology Solutions 603-321-1032
> www.hollistech.com
> markr@hollistech.com
>
>
> "Alexander Grigoriev" <alegr@earthlink.net> wrote in message
> news:e3rRH5zPEHA.2132@TK2MSFTNGP11.phx.gbl...
> > If one wants all devices with SCSI-like command interface, like CD
drives
> > and scanners connected through IDE, USB, IEEE1394, I think those SCSI
> ports
> > don't have NT4 style name.
> >
> > You can also use the interface GUID for notifications.
> >
> > "Mark Roddy" <markr@hollistech.com> wrote in message
> > news:%23w2aBLyPEHA.3216@TK2MSFTNGP12.phx.gbl...
> > > Last time I looked you still have to do the nt4-style createfile on
> names
> > > such as scsi0.
> > >
> > > --
> > >
> > > =====================
> > > Mark Roddy
> > > Windows 2003/XP/2000 Consulting
> > > Hollis Technology Solutions 603-321-1032
> > > www.hollistech.com
> > > markr@hollistech.com
> > >
> > >
> > > "Alexander Grigoriev" <alegr@earthlink.net> wrote in message
> > > news:%23WdxLfqPEHA.3140@TK2MSFTNGP11.phx.gbl...
> > > > GUID_DEVCLASS_SCSIADAPTER is device class guid (which you can find
> under
> > > > HKLM/CurrentControlSet/Control/Class).
> > > >
> > > > It if NOT SCSI interface class.
> > > >
> > > > Try GUID_DEVINTERFACE_STORAGEPORT
> > > >
> > > > "the veloper" <ppp_l_qqq@yahoo.com> wrote in message
> > > > news:de0ced42.0405190850.3cc8c12d@posting.google.com...
> > > > > ... I got delayed on something else ...
> > > > >
> > > > > When I said "I can't get a handle thru CreateFile" is because
there
> is
> > > > > nothing from the infor returned by GUID_DEVCLASS_SCSIADAPTER that
I
> > > > > can use to pass as the first parameter to CreateFile(). This is
in
> > > > > contrast to when using GUID_DEVINTERFACE_DISK because I can use
> > > > > SetupDiEnumDeviceInterfaces() to get the interface path that I can
> > > > > pass along to CreateFile(). Calling SetupDiEnumDeviceInterfaces()
> for
> > > > > GUID_DEV_CLASS_SCSIADAPTER of course does not work because it is
not
> > > > > an interface class.
> > > > >
> > > > >
> > > > > "Peter Wieland [MSFT]" <peterwie@online.microsoft.com> wrote in
> > message
> > > > news:<uaQowz5NEHA.2972@TK2MSFTNGP10.phx.gbl>...
> > > > > > "I can enumerate devices of type GUID_DEVCLASS_SCSIADAPTER and
> find
> > > the
> > > > > > controller I want to talk to, but I can't get a handle thru
> > > CreateFile"
> > > > > >
> > > > > > You implied that you could get get the name for the device but
> that
> > > > create
> > > > > > file didn't work. What is the error when createFile returns?
> > > > > >
> > > > > > -p
> > > >
> > > >
> > >
> > >
> >
> >
>
>