[SETUPAPI] Fix broken control definition.
[reactos.git] / dll / win32 / setupapi / driver.c
index 0e14f03..2b4476d 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "setupapi_private.h"
 
-WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
-
 /* Unicode constants */
 static const WCHAR BackSlash[] = {'\\',0};
 static const WCHAR ClassGUID[]  = {'C','l','a','s','s','G','U','I','D',0};
@@ -567,7 +565,7 @@ done:
     return Result;
 }
 
-#if WIN32_WINNT < 0x0600
+#if _WIN32_WINNT < 0x0600
 /* WARNING:
  * This code has been copied from advapi32/reg/reg.c,
  * so this dll can be tested as is on Windows XP
@@ -810,13 +808,7 @@ SetupDiBuildDriverInfoList(
             strcatW(InfFileName, InfDirectory);
 
             /* Read some information from registry, before creating the driver structure */
-            hDriverKey = SetupDiOpenDevRegKey(
-                DeviceInfoSet,
-                DeviceInfoData,
-                DICS_FLAG_GLOBAL,
-                0,
-                DIREG_DRV,
-                KEY_QUERY_VALUE);
+            hDriverKey = SETUPDI_OpenDrvKey(((struct DeviceInfoSet *)DeviceInfoSet)->HKLM, devInfo, KEY_QUERY_VALUE);
             if (hDriverKey == INVALID_HANDLE_VALUE)
                 goto done;
             RequiredSize = (len - strlenW(InfFileName)) * sizeof(WCHAR);
@@ -1111,23 +1103,26 @@ SetupDiBuildDriverInfoList(
                                 }
                                 /* FIXME: Check ExcludeFromSelect list */
                                 DriverAlreadyAdded = FALSE;
-                                for (DriverRank = 0, currentId = (LPCWSTR)HardwareIDs; !DriverAlreadyAdded && *currentId; currentId += strlenW(currentId) + 1, DriverRank++)
+                                if (HardwareIDs)
                                 {
-                                    if (strcmpiW(DeviceId, currentId) == 0)
+                                    for (DriverRank = 0, currentId = (LPCWSTR)HardwareIDs; !DriverAlreadyAdded && *currentId; currentId += strlenW(currentId) + 1, DriverRank++)
                                     {
-                                        AddDriverToList(
-                                            pDriverListHead,
-                                            DriverType,
-                                            &ClassGuid,
-                                            ContextDevice,
-                                            currentInfFileDetails,
-                                            FullInfFileName,
-                                            ProviderName,
-                                            ManufacturerName,
-                                            currentId,
-                                            DriverDate, DriverVersion,
-                                            DriverRank  + (i == 2 ? 0 : 0x1000 + i - 3));
-                                        DriverAlreadyAdded = TRUE;
+                                        if (strcmpiW(DeviceId, currentId) == 0)
+                                        {
+                                            AddDriverToList(
+                                                pDriverListHead,
+                                                DriverType,
+                                                &ClassGuid,
+                                                ContextDevice,
+                                                currentInfFileDetails,
+                                                FullInfFileName,
+                                                ProviderName,
+                                                ManufacturerName,
+                                                currentId,
+                                                DriverDate, DriverVersion,
+                                                DriverRank  + (i == 2 ? 0 : 0x1000 + i - 3));
+                                            DriverAlreadyAdded = TRUE;
+                                        }
                                     }
                                 }
                                 if (CompatibleIDs)