# HG changeset patch # User Ivo Smits # Date 1380579879 -7200 # Node ID d4778c3232ada787e6f6aae3ff03de3e51263187 # Parent e3f37686b15aab9c0a263a063b1bb83db54a5944 Prevent exception in HWLib diff -r e3f37686b15a -r d4778c3232ad USBLib/Communication/WindowsUsbDeviceRegistry.cs --- a/USBLib/Communication/WindowsUsbDeviceRegistry.cs Mon Sep 30 21:24:35 2013 +0200 +++ b/USBLib/Communication/WindowsUsbDeviceRegistry.cs Tue Oct 01 00:24:39 2013 +0200 @@ -10,7 +10,7 @@ public DeviceNode DeviceNode { get; private set; } public static Boolean DecodeDeviceIDs(DeviceNode device, out int vendorID, out int productID, out int revision, out int interfaceID) { - String[] hwids = device.GetPropertyStringArray(CMRDP.HARDWAREID); + String[] hwids = device.HardwareID; String hwid = null; if (hwids == null || hwids.Length < 1 || hwids[0].Length == 0) { hwid = device.DeviceID; diff -r e3f37686b15a -r d4778c3232ad USBLib/Windows/Devices/DeviceNode.cs --- a/USBLib/Windows/Devices/DeviceNode.cs Mon Sep 30 21:24:35 2013 +0200 +++ b/USBLib/Windows/Devices/DeviceNode.cs Tue Oct 01 00:24:39 2013 +0200 @@ -112,7 +112,7 @@ uint proplength = 0; uint proptype; CR ret = SetupApi.CM_Get_DevNode_Registry_Property(DevInst, property, out proptype, null, ref proplength, 0); - if (ret == CR.NO_SUCH_VALUE) return null; + if (ret == CR.NO_SUCH_VALUE || ret == CR.NO_SUCH_DEVNODE) return null; if (ret != CR.BUFFER_SMALL) CMException.Throw(ret, "CM_Get_DevNode_Registry_Property"); Byte[] propbuffer = new Byte[proplength]; ret = SetupApi.CM_Get_DevNode_Registry_Property(DevInst, property, out proptype, propbuffer, ref proplength, 0);