https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9e947e2b2be05d01590f42741413b8b90f911071

commit 9e947e2b2be05d01590f42741413b8b90f911071
Author:     Eric Kohl <eric.k...@reactos.org>
AuthorDate: Fri Apr 16 23:45:08 2021 +0200
Commit:     Eric Kohl <eric.k...@reactos.org>
CommitDate: Fri Apr 16 23:45:08 2021 +0200

    [DEVMGR] Get rid of the unknown device class hack
    
    Treat the unknown device class like any other device class.
    
    CORE-17527
---
 dll/win32/devmgr/devmgmt/DeviceView.cpp | 39 +++++----------------------------
 1 file changed, 5 insertions(+), 34 deletions(-)

diff --git a/dll/win32/devmgr/devmgmt/DeviceView.cpp 
b/dll/win32/devmgr/devmgmt/DeviceView.cpp
index 1bb0fab7dee..a0906e1657a 100644
--- a/dll/win32/devmgr/devmgmt/DeviceView.cpp
+++ b/dll/win32/devmgr/devmgmt/DeviceView.cpp
@@ -351,23 +351,11 @@ CDeviceView::GetNextClass(
     if (cr != CR_SUCCESS)
         return false;
 
-    // Check if this is the unknown class
-    if (IsEqualGUID(*ClassGuid, GUID_DEVCLASS_UNKNOWN))
-    {
-        // Get device info for all devices
-        *hDevInfo = SetupDiGetClassDevsW(NULL,
-                                         NULL,
-                                         NULL,
-                                         DIGCF_ALLCLASSES);
-    }
-    else
-    {
-        // We only want the devices for this class
-        *hDevInfo = SetupDiGetClassDevsW(ClassGuid,
-                                         NULL,
-                                         NULL,
-                                         DIGCF_PRESENT);
-    }
+    // We only want the devices for this class
+    *hDevInfo = SetupDiGetClassDevsW(ClassGuid,
+                                     NULL,
+                                     NULL,
+                                     DIGCF_PRESENT);
 
     return (hDevInfo != INVALID_HANDLE_VALUE);
 }
@@ -449,7 +437,6 @@ CDeviceView::ListDevicesByType()
         bClassSuccess = GetNextClass(ClassIndex, &ClassGuid, &hDevInfo);
         if (bClassSuccess)
         {
-            bool bClassUnknown = false;
             bool AddedParent = false;
             INT DeviceIndex = 0;
             bool MoreItems = false;
@@ -462,10 +449,6 @@ CDeviceView::ListDevicesByType()
                 continue;
             }
 
-            // Set a flag is this is the (special case) unknown class
-            if (IsEqualGUID(ClassGuid, GUID_DEVCLASS_UNKNOWN))
-                bClassUnknown = true;
-
             // Check if this is a hidden class
             if (IsEqualGUID(ClassGuid, GUID_DEVCLASS_LEGACYDRIVER) ||
                 IsEqualGUID(ClassGuid, GUID_DEVCLASS_VOLUME))
@@ -494,18 +477,6 @@ CDeviceView::ListDevicesByType()
                 {
                     MoreItems = true;
 
-                    // The unknown class handle contains all devices on the 
system,
-                    // and we're just looking for the ones with a null GUID
-                    if (bClassUnknown)
-                    {
-                        if (IsEqualGUID(DeviceInfoData.ClassGuid, GUID_NULL) 
== FALSE)
-                        {
-                            // This is a known device, we aren't interested in 
it
-                            DeviceIndex++;
-                            continue;
-                        }
-                    }
-
                     // Get the cached device node
                     DeviceNode = GetDeviceNode(DeviceInfoData.DevInst);
                     if (DeviceNode == nullptr)

Reply via email to