@@ -1102,8 +1102,10 @@ internal static string GetStringDeviceProperty(string deviceInstanceId,
1102
1102
1103
1103
Guid hidGuid = new Guid ( ) ;
1104
1104
NativeMethods . HidD_GetHidGuid ( ref hidGuid ) ;
1105
- IntPtr deviceInfoSet = NativeMethods . SetupDiGetClassDevs ( IntPtr . Zero , deviceInstanceId , 0 , extraFlags | NativeMethods . DIGCF_DEVICEINTERFACE | NativeMethods . DIGCF_ALLCLASSES ) ;
1106
- NativeMethods . SetupDiEnumDeviceInfo ( deviceInfoSet , 0 , ref deviceInfoData ) ;
1105
+ //IntPtr deviceInfoSet = NativeMethods.SetupDiGetClassDevs(IntPtr.Zero, deviceInstanceId, 0, extraFlags | NativeMethods.DIGCF_DEVICEINTERFACE | NativeMethods.DIGCF_ALLCLASSES);
1106
+ IntPtr deviceInfoSet = NativeMethods . SetupDiCreateDeviceInfoList ( IntPtr . Zero , 0 ) ;
1107
+ //NativeMethods.SetupDiEnumDeviceInfo(deviceInfoSet, 0, ref deviceInfoData);
1108
+ NativeMethods . SetupDiOpenDeviceInfo ( deviceInfoSet , deviceInstanceId , IntPtr . Zero , 0 , ref deviceInfoData ) ;
1107
1109
NativeMethods . SetupDiGetDeviceProperty ( deviceInfoSet , ref deviceInfoData , ref prop , ref propertyType ,
1108
1110
null , 0 , ref requiredSize , 0 ) ;
1109
1111
@@ -1244,8 +1246,10 @@ internal static string[] GetStringArrayDeviceProperty(string deviceInstanceId,
1244
1246
var requiredSize = 0 ;
1245
1247
1246
1248
IntPtr zero = IntPtr . Zero ;
1247
- IntPtr deviceInfoSet = NativeMethods . SetupDiGetClassDevs ( zero , deviceInstanceId , 0 , extraFlags | NativeMethods . DIGCF_DEVICEINTERFACE | NativeMethods . DIGCF_ALLCLASSES ) ;
1248
- NativeMethods . SetupDiEnumDeviceInfo ( deviceInfoSet , 0 , ref deviceInfoData ) ;
1249
+ //IntPtr deviceInfoSet = NativeMethods.SetupDiGetClassDevs(zero, deviceInstanceId, 0, extraFlags | NativeMethods.DIGCF_DEVICEINTERFACE | NativeMethods.DIGCF_ALLCLASSES);
1250
+ IntPtr deviceInfoSet = NativeMethods . SetupDiCreateDeviceInfoList ( IntPtr . Zero , 0 ) ;
1251
+ //NativeMethods.SetupDiEnumDeviceInfo(deviceInfoSet, 0, ref deviceInfoData);
1252
+ NativeMethods . SetupDiOpenDeviceInfo ( deviceInfoSet , deviceInstanceId , IntPtr . Zero , 0 , ref deviceInfoData ) ;
1249
1253
NativeMethods . SetupDiGetDeviceProperty ( deviceInfoSet , ref deviceInfoData , ref prop , ref propertyType ,
1250
1254
null , 0 , ref requiredSize , 0 ) ;
1251
1255
0 commit comments