You can create a third interface GUID that you always have the PDO report. That way you only need to query for one device interface. Unless the device interfaces have reference strings (and disk and cdrom device interfaces usually don’t) you can use them interchangeably.
So you call SetupDiOpenDeviceInfo to get an SP_DEVINFO_DATA from the instance ID. Then you use SetupDiEnumDeviceInterfaces with your new interface GUID to see if it supports that interface.
SetupDi does not provide a way to find out about all of the interfaces that a particular device exposes at one time.
-p
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Friday, February 09, 2007 11:25 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Open a device with its instance id
Well.
My driver is a port driver which can simulate CDs and harddisks. Currently, I can enumerate my controller and CDs/HDs in my application. From here, I have the instance ids for every controler and CDs/HDs. The purpose of my question is, I want to send DeviceIoControl to the CD/HD, which requires a device handle.
Usually we just enumerate the specified interface GUID and open it to get a handle to the device which registers that interface. But in my case, there are some other CDs/HDs which are not created by my driver, which I can also get handles to them. I know the solution for this problem: Just send my custom IOCTLs to the port driver to distinguish which one is created by myself. However, another problem is, when users click on a device to send a custom IOCTL, I need to enumerate all possible interface GUID to open the handle, which looks really stupid.
So, I guess there should be some relations between a device instance id and its registered interface GUID (with index #).
Any idea?
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer