Alexander Morozov : setupapi: Add a check of "#" for interface subkey names .

Alexandre Julliard julliard at winehq.org
Mon Mar 31 09:15:39 CDT 2008


Module: wine
Branch: master
Commit: bae4ebb7d72aeeeea4dd69a24cb4551814bbc6be
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=bae4ebb7d72aeeeea4dd69a24cb4551814bbc6be

Author: Alexander Morozov <amorozov at etersoft.ru>
Date:   Fri Mar 28 18:49:34 2008 +0300

setupapi: Add a check of "#" for interface subkey names.

---

 dlls/setupapi/devinst.c |   31 +++++++++++++++++--------------
 1 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
index 936f6a7..60da5e8 100644
--- a/dlls/setupapi/devinst.c
+++ b/dlls/setupapi/devinst.c
@@ -1986,21 +1986,24 @@ static void SETUPDI_AddDeviceInterfaces(SP_DEVINFO_DATA *dev, HKEY key,
             HKEY subKey;
             SP_DEVICE_INTERFACE_DATA *iface = NULL;
 
-            /* The subkey name is the reference string, with a '#' prepended */
-            SETUPDI_AddInterfaceInstance(dev, interface, subKeyName + 1,
-                    &iface);
-            l = RegOpenKeyExW(key, subKeyName, 0, KEY_READ, &subKey);
-            if (!l)
+            if (*subKeyName == '#')
             {
-                WCHAR symbolicLink[MAX_PATH];
-                DWORD dataType;
-
-                len = sizeof(symbolicLink);
-                l = RegQueryValueExW(subKey, SymbolicLink, NULL, &dataType,
-                        (BYTE *)symbolicLink, &len);
-                if (!l && dataType == REG_SZ)
-                    SETUPDI_SetInterfaceSymbolicLink(iface, symbolicLink);
-                RegCloseKey(subKey);
+                /* The subkey name is the reference string, with a '#' prepended */
+                SETUPDI_AddInterfaceInstance(dev, interface, subKeyName + 1,
+                        &iface);
+                l = RegOpenKeyExW(key, subKeyName, 0, KEY_READ, &subKey);
+                if (!l)
+                {
+                    WCHAR symbolicLink[MAX_PATH];
+                    DWORD dataType;
+
+                    len = sizeof(symbolicLink);
+                    l = RegQueryValueExW(subKey, SymbolicLink, NULL, &dataType,
+                            (BYTE *)symbolicLink, &len);
+                    if (!l && dataType == REG_SZ)
+                        SETUPDI_SetInterfaceSymbolicLink(iface, symbolicLink);
+                    RegCloseKey(subKey);
+                }
             }
             /* Allow enumeration to continue */
             l = ERROR_SUCCESS;




More information about the wine-cvs mailing list