Solved

Enumerating devices

Posted on 2004-03-22
4
203 Views
Last Modified: 2013-12-03
I understand that I can open and manipulate a device by passing a name such as "\\.\TAPE0" to CreateFile.  However, I can find NO documentation that tells me where to find out that a device is named TAPE0.  I know that I can use GetNTMSInformation to find the names of tape devices, but

1.  I am trying to avoid using RSM because it is so horribly flaky and unreliable.
2.  That does nothing for disk drives unless they are removable.

Any suggestions?
0
Comment
Question by:dirtdart
  • 2
4 Comments
 
LVL 86

Assisted Solution

by:jkr
jkr earned 250 total points
ID: 10649508
Check out http://support.microsoft.com/default.aspx?scid=kb;en-us;259695 ("HOWTO: Enumerate Hardware Devices by Using SetupDi Calls")
0
 
LVL 5

Author Comment

by:dirtdart
ID: 10698600
That does enumerate all the hardware on a machine, but unless I'm missing something, I have no way to find the device name from the information retrieved.  As stated above, I need to know that the device is named "TAPE0", "TAPE1", etc.
0
 
LVL 9

Accepted Solution

by:
Cayce earned 250 total points
ID: 10761484
Check out the API call SetupDiGetDeviceInterfaceDetail (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/setupdigetdeviceinterfacedetail.asp).

The DeviceInterfaceDetailData (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/sp_device_interface_detail_data_str.asp) parameter includes the DevicePath that is what you are looking for.
0
 
LVL 5

Author Comment

by:dirtdart
ID: 10832281
That looks like it would probably do what I need.  However, the answer came just in time for the project to get cancelled.  Hopefully I'll have some time to pick it back up one day.  Thanks for your help.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question