File tree Expand file tree Collapse file tree 1 file changed +20
-16
lines changed
Expand file tree Collapse file tree 1 file changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -54,22 +54,25 @@ public List<DriverStoreEntry> EnumeratePackages()
5454
5555 try
5656 {
57- {
58- GCHandle handle = GCHandle . Alloc ( devicesInfo ) ;
59- try
60- {
61- NativeMethods . DriverStoreEnumObjects (
62- ptr ,
63- DriverStoreObjectType . DeviceNode ,
64- DRIVERSTORE_LOCK_LEVEL . NONE ,
65- EnumDeviceObjects ,
66- GCHandle . ToIntPtr ( handle ) ) ;
67- }
68- finally
69- {
70- handle . Free ( ) ;
71- }
72- }
57+ // Switch to ConfigManager API since the native driver store API didn't return all the devices.
58+ // Need to investigate the reason.
59+ devicesInfo = ConfigManager . GetDeviceDriverInfo ( ) ;
60+ //{
61+ // GCHandle handle = GCHandle.Alloc(devicesInfo);
62+ // try
63+ // {
64+ // NativeMethods.DriverStoreEnumObjects(
65+ // ptr,
66+ // DriverStoreObjectType.DeviceNode,
67+ // DRIVERSTORE_LOCK_LEVEL.NONE,
68+ // EnumDeviceObjects,
69+ // GCHandle.ToIntPtr(handle));
70+ // }
71+ // finally
72+ // {
73+ // handle.Free();
74+ // }
75+ //}
7376
7477 {
7578 GCHandle handle = GCHandle . Alloc ( driverStoreEntries ) ;
@@ -167,6 +170,7 @@ internal static bool EnumDeviceObjects(
167170 string ObjectName ,
168171 IntPtr lParam )
169172 {
173+ Debug . WriteLine ( ObjectName ) ;
170174 var devicesInfo = ( List < DeviceDriverInfo > ) GCHandle . FromIntPtr ( lParam ) . Target ;
171175
172176 devicesInfo . Add ( new DeviceDriverInfo (
You can’t perform that action at this time.
0 commit comments