S
Scott Dowd
I need explicit example of how to use SetupDi* functions
in both C# .NET and VB .NET to determine device interface
detail for a given device class with interface information
detail. All examples available on the web and/or
Microsoft documentation are C or C++ based and do not take
into account the various issues and pitfalls that the .NET
based environment incurs, or otherwise avoids over
unmanaged code, in short, no examples of how to use the
SetupDi* functions in a managed code of any significant
scenario exist.
Of specific interest is how to get the ‘Device Path’
information from SP_DEVICE_INTERFACE_DETAIL_DATA structure
via a managed code example in C# .NET and VB .NET, which
would include examples of how to declare, and use
following API functions…
SetupDiCreateDeviceInfoList()
SetupDIGetClassDevsEx()
SetupDiEnumDeviceInterfaces()
SetupDiGetDeviceInterfaceDetail()
SetupDiDestroyDeviceInfoList()
For example, via only official and proper methods for a
managed code environment, determine the actual number of
tape devices that are present, and which publish
interfaces, and what the device path is for each device,
i.e. \\.\Tape0, \\.\Tape1, etc. etc.
in both C# .NET and VB .NET to determine device interface
detail for a given device class with interface information
detail. All examples available on the web and/or
Microsoft documentation are C or C++ based and do not take
into account the various issues and pitfalls that the .NET
based environment incurs, or otherwise avoids over
unmanaged code, in short, no examples of how to use the
SetupDi* functions in a managed code of any significant
scenario exist.
Of specific interest is how to get the ‘Device Path’
information from SP_DEVICE_INTERFACE_DETAIL_DATA structure
via a managed code example in C# .NET and VB .NET, which
would include examples of how to declare, and use
following API functions…
SetupDiCreateDeviceInfoList()
SetupDIGetClassDevsEx()
SetupDiEnumDeviceInterfaces()
SetupDiGetDeviceInterfaceDetail()
SetupDiDestroyDeviceInfoList()
For example, via only official and proper methods for a
managed code environment, determine the actual number of
tape devices that are present, and which publish
interfaces, and what the device path is for each device,
i.e. \\.\Tape0, \\.\Tape1, etc. etc.