[OSR-DETECTED-SPAM] Re: SetupDiGetDeviceInterfaceDetail Function & DevicePath

windev234 wrote:

I wonder if SetupDiCreateDeviceInterface is the right choice. The doc states that the interface created by the app must be enabled by the driver. Typically, to open a device handle with a device interface, you do the following:

Hmmm – I never even noticed that.

xxxxx@winsystems.com xxxxx@lists.osr.com wrote:

while (SetupDiEnumDeviceInfo(DeviceInfoSet, Index, &DeviceInfoData))
{
DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
SetupDiCreateDeviceInterface(DeviceInfoSet, &DeviceInfoData, &DeviceInfoData.ClassGuid, NULL, 0, &DeviceInterfaceData);

Yes, this is totally wrong. You want to enumerate the interfaces that
have already been exposed by existing drivers. You cannot add
additional interfaces to existing drivers, because you don’t know what
interfaces they support. Plus, you are adding the ClassGuid, which is
the Device Manager install class, not a device interface. You need to
rip this line right out.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.