Solved

Enumerating devices

Posted on 2004-03-22
4
200 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now