Desktop Functions: Smart Device Functions:
|
SetupDiEnumDeviceInterfaces (setupapi)
C# Signature:
[DllImport(@"setupapi.dll", CharSet=CharSet.Auto, SetLastError = true)] VB Signature:
Declare Function SetupDiEnumDeviceInterfaces Lib "setupapi.dll" (TODO) As TODO User-Defined Types:None. Alternative Managed API:Do you know one? Please contribute it! Notes:None. Tips & Tricks:
[StructLayout(LayoutKind.Sequential)] //You need to create a structure for the deviceInterfaceData like this....
public struct SP_DEVICE_INTERFACE_DATA //Then initialize the cbSize value like this in your calling method SP_DEVICE_INTERFACE_DATA devData = new SP_DEVICE_INTERFACE_DATA(); devData.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(devData); // failure to do so will always return false (which is the value you'll also get if the device is not connected) // Here's what the call looks like... bool result = Win32Calls.SetupDiEnumDeviceInterfaces(ipDeviceHndl, iLU, ref DeviceGUID, 0, ref devData); // The DeviceGUID parameter will be device dependant. Look in the Manufacturer's sdk or api for the correct guid for your device Sample Code:
class Win32Calls Please edit this page!Do you have...
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more). |
|