# HG changeset patch # User Ivo Smits # Date 1394649222 -3600 # Node ID 9096f62d18c488dfae553579697a3a8eabc272be # Parent c9da306e06c93168f21d3725be57868cb0bcc71f USBLib: allow to locate Windows Device Node for removed device diff -r c9da306e06c9 -r 9096f62d18c4 USBLib/Windows/Devices/DeviceNode.cs --- a/USBLib/Windows/Devices/DeviceNode.cs Tue Mar 11 17:45:48 2014 +0100 +++ b/USBLib/Windows/Devices/DeviceNode.cs Wed Mar 12 19:33:42 2014 +0100 @@ -29,7 +29,8 @@ } public static DeviceNode GetDevice(String deviceID) { UInt32 node; - CR ret = SetupApi.CM_Locate_DevNode(out node, deviceID, 0); + CR ret = SetupApi.CM_Locate_DevNode(out node, deviceID, 4); + if (ret == CR.NO_SUCH_DEVNODE) return null; CMException.Throw(ret, "CM_Locate_DevNode"); return new DeviceNode(node); }