// Token: 0x0600002A RID: 42 RVA: 0x00003F40 File Offset: 0x00002140 private static string GetDevicePath(IntPtr hInfoSet, ref Win32Usb.DeviceInterfaceData oInterface) { uint nDeviceInterfaceDetailDataSize = 0u; if (!Win32Usb.SetupDiGetDeviceInterfaceDetail(hInfoSet, ref oInterface, IntPtr.Zero, 0u, ref nDeviceInterfaceDetailDataSize, IntPtr.Zero)) { Win32Usb.DeviceInterfaceDetailData deviceInterfaceDetailData = default(Win32Usb.DeviceInterfaceDetailData); deviceInterfaceDetailData.Size = 5; if (Win32Usb.SetupDiGetDeviceInterfaceDetail(hInfoSet, ref oInterface, ref deviceInterfaceDetailData, nDeviceInterfaceDetailDataSize, ref nDeviceInterfaceDetailDataSize, IntPtr.Zero)) { return(deviceInterfaceDetailData.DevicePath); } } return(null); }
private static string GetDevicePath(IntPtr hInfoSet, ref Win32Usb.DeviceInterfaceData oInterface) { uint nRequiredSize = 0; if (!Win32Usb.SetupDiGetDeviceInterfaceDetail(hInfoSet, ref oInterface, IntPtr.Zero, 0, ref nRequiredSize, IntPtr.Zero)) { Win32Usb.DeviceInterfaceDetailData oDetailData = new Win32Usb.DeviceInterfaceDetailData { Size = 5 }; if (Win32Usb.SetupDiGetDeviceInterfaceDetail(hInfoSet, ref oInterface, ref oDetailData, nRequiredSize, ref nRequiredSize, IntPtr.Zero)) { return(oDetailData.DevicePath); } } return(null); }
protected static extern bool SetupDiGetDeviceInterfaceDetail(IntPtr lpDeviceInfoSet, ref Win32Usb.DeviceInterfaceData oInterfaceData, ref Win32Usb.DeviceInterfaceDetailData oDetailData, uint nDeviceInterfaceDetailDataSize, ref uint nRequiredSize, IntPtr lpDeviceInfoData);