[ros-diffs] [ekohl] 45578: [DEVMGR] Display Matching Device ID.

ekohl at svn.reactos.org ekohl at svn.reactos.org
Thu Feb 11 21:23:48 CET 2010


Author: ekohl
Date: Thu Feb 11 21:23:48 2010
New Revision: 45578

URL: http://svn.reactos.org/svn/reactos?rev=45578&view=rev
Log:
[DEVMGR]
Display Matching Device ID.

Modified:
    trunk/reactos/dll/win32/devmgr/advprop.c

Modified: trunk/reactos/dll/win32/devmgr/advprop.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/advprop.c?rev=45578&r1=45577&r2=45578&view=diff
==============================================================================
--- trunk/reactos/dll/win32/devmgr/advprop.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr/advprop.c [iso-8859-1] Thu Feb 11 21:23:48 2010
@@ -852,6 +852,52 @@
 
 
 static VOID
+DisplayMatchingDeviceId(IN PDEVADVPROP_INFO dap,
+                        IN HWND hwndListView)
+{
+    HDEVINFO DeviceInfoSet;
+    PSP_DEVINFO_DATA DeviceInfoData;
+    WCHAR szBuffer[256];
+    HKEY hKey;
+    DWORD dwSize;
+    DWORD dwType;
+
+    if (dap->CurrentDeviceInfoSet != INVALID_HANDLE_VALUE)
+    {
+        DeviceInfoSet = dap->CurrentDeviceInfoSet;
+        DeviceInfoData = &dap->CurrentDeviceInfoData;
+    }
+    else
+    {
+        DeviceInfoSet = dap->DeviceInfoSet;
+        DeviceInfoData = &dap->DeviceInfoData;
+    }
+
+    hKey = SetupDiOpenDevRegKey(DeviceInfoSet,
+                                DeviceInfoData,
+                                DICS_FLAG_GLOBAL,
+                                0,
+                                DIREG_DRV,
+                                KEY_QUERY_VALUE);
+    if (hKey != INVALID_HANDLE_VALUE)
+    {
+        dwSize = 256 * sizeof(WCHAR);
+        if (RegQueryValueEx(hKey,
+                            L"MatchingDeviceId",
+                            NULL,
+                            &dwType,
+                            (LPBYTE)szBuffer,
+                            &dwSize) == ERROR_SUCCESS)
+        {
+            SetListViewText(hwndListView, 0, szBuffer);
+        }
+
+        RegCloseKey(hKey);
+    }
+}
+
+
+static VOID
 DisplayDeviceProperties(IN PDEVADVPROP_INFO dap,
                         IN HWND hwndComboBox,
                         IN HWND hwndListView)
@@ -873,7 +919,6 @@
             SetListViewText(hwndListView, 0, dap->szDeviceID);
             break;
 
-
         case 1: /* Hardware ID */
             DisplayDevicePropertyText(dap,
                                       hwndListView,
@@ -886,10 +931,10 @@
                                       SPDRP_COMPATIBLEIDS);
             break;
 
-#if 0
         case 3: /* Matching ID */
+            DisplayMatchingDeviceId(dap,
+                                    hwndListView);
             break;
-#endif
 
         case 4: /* Service */
             DisplayDevicePropertyText(dap,




More information about the Ros-diffs mailing list