Mercurial > hg > ucis.core
diff USBLib/Windows/Devices/DeviceNode.cs @ 52:d4778c3232ad
Prevent exception in HWLib
author | Ivo Smits <Ivo@UCIS.nl> |
---|---|
date | Tue, 01 Oct 2013 00:24:39 +0200 |
parents | 556b4fb511bd |
children | 309c705d7460 |
line wrap: on
line diff
--- 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);