[SETUPAPI]
[reactos.git] / reactos / dll / win32 / setupapi / devclass.c
index 446ac91..2bdd6e9 100644 (file)
@@ -486,6 +486,7 @@ SetupDiGetClassImageListExW(
         HICON hIcon;
         DWORD size;
         INT i, bpp;
+        UINT idx;
 
         /* Get list of all class GUIDs in given computer */
         ret = SetupDiBuildClassInfoListExW(
@@ -589,6 +590,19 @@ SetupDiGetClassImageListExW(
                 list->IconIndexes[i] = -1; /* Special value to indicate that the icon is unavailable */
         }
 
+        /* Finally, add the overlay icons to the image list */
+        for (i = 0; i < 2; i++)
+        {
+            hIcon = LoadImage(hInstance, MAKEINTRESOURCE(500 + i), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
+            if (hIcon)
+            {
+                idx = ImageList_AddIcon(ClassImageListData->ImageList, hIcon);
+                if (idx != -1)
+                    ImageList_SetOverlayImage(ClassImageListData->ImageList, idx, i);
+                DestroyIcon(hIcon);
+            }
+        }
+
         ret = TRUE;
 
 cleanup:
@@ -1255,6 +1269,19 @@ SetupDiGetClassDevPropertySheetsW(
             goto cleanup;
         }
 
+        if (DeviceInfoData)
+        {
+            struct DeviceInfo *devInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
+            devInfo->hmodDevicePropPageProvider = hModule;
+            devInfo->pDevicePropPageProvider = pPropPageProvider;
+        }
+        else
+        {
+            struct DeviceInfoSet *devInfoSet = (struct DeviceInfoSet *)DeviceInfoSet;
+            devInfoSet->hmodClassPropPageProvider = hModule;
+            devInfoSet->pClassPropPageProvider = pPropPageProvider;
+        }
+
         InitialNumberOfPages = PropertySheetHeader->nPages;
 
         Request.cbSize = sizeof(SP_PROPSHEETPAGE_REQUEST);
@@ -1285,7 +1312,6 @@ cleanup:
         if (hKey != INVALID_HANDLE_VALUE)
             RegCloseKey(hKey);
         HeapFree(GetProcessHeap(), 0, PropPageProvider);
-        FreeFunctionPointer(hModule, pPropPageProvider);
     }
 
     TRACE("Returning %d\n", ret);