Mercurial > hg > ucis.core
comparison USBLib/Windows/Devices/DeviceNode.cs @ 89:9096f62d18c4
USBLib: allow to locate Windows Device Node for removed device
author | Ivo Smits <Ivo@UCIS.nl> |
---|---|
date | Wed, 12 Mar 2014 19:33:42 +0100 |
parents | 309c705d7460 |
children | 57b4c2f895d1 |
comparison
equal
deleted
inserted
replaced
88:c9da306e06c9 | 89:9096f62d18c4 |
---|---|
27 return new DeviceNode(node); | 27 return new DeviceNode(node); |
28 } | 28 } |
29 } | 29 } |
30 public static DeviceNode GetDevice(String deviceID) { | 30 public static DeviceNode GetDevice(String deviceID) { |
31 UInt32 node; | 31 UInt32 node; |
32 CR ret = SetupApi.CM_Locate_DevNode(out node, deviceID, 0); | 32 CR ret = SetupApi.CM_Locate_DevNode(out node, deviceID, 4); |
33 if (ret == CR.NO_SUCH_DEVNODE) return null; | |
33 CMException.Throw(ret, "CM_Locate_DevNode"); | 34 CMException.Throw(ret, "CM_Locate_DevNode"); |
34 return new DeviceNode(node); | 35 return new DeviceNode(node); |
35 } | 36 } |
36 private static IList<DeviceNode> GetDevicesInSet(SafeDeviceInfoSetHandle dis) { | 37 private static IList<DeviceNode> GetDevicesInSet(SafeDeviceInfoSetHandle dis) { |
37 List<DeviceNode> list = new List<DeviceNode>(); | 38 List<DeviceNode> list = new List<DeviceNode>(); |