From ce162db686ffc7c84639f13008f3dadd3df3c11e Mon Sep 17 00:00:00 2001 From: Ged Murphy Date: Mon, 3 Sep 2007 14:51:06 +0000 Subject: [PATCH] - load icon resources using LoadImage. ExtractIcon loads sequential numbers, not resource numbers. - fixes the device image list svn path=/trunk/; revision=28816 --- reactos/dll/win32/setupapi/devclass.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/setupapi/devclass.c b/reactos/dll/win32/setupapi/devclass.c index 36890a9fe49..a6406498ba7 100644 --- a/reactos/dll/win32/setupapi/devclass.c +++ b/reactos/dll/win32/setupapi/devclass.c @@ -1449,7 +1449,7 @@ SetupDiGetClassImageListExW( /* Prepare a HIMAGELIST */ InitCommonControls(); - ClassImageListData->ImageList = ImageList_Create(16, 16, ILC_COLOR, 100, 10); + ClassImageListData->ImageList = ImageList_Create(16, 16, ILC_COLOR32, 100, 10); if (!ClassImageListData->ImageList) goto cleanup; @@ -1464,7 +1464,10 @@ SetupDiGetClassImageListExW( &hIcon, NULL); if (ret) + { list->IconIndexes[i] = ImageList_AddIcon(ClassImageListData->ImageList, hIcon); + DestroyIcon(hIcon); + } else list->IconIndexes[i] = -1; /* Special value to tell that icon is unavailable */ } @@ -1612,7 +1615,8 @@ SetupDiLoadClassIcon( TRACE("Icon index %d, dll name %s\n", iconIndex, debugstr_w(DllName)); if (LargeIcon) { - if (1 != ExtractIconEx(DllName, iconIndex, LargeIcon, NULL, 1)) + *LargeIcon = LoadImage(hInstance, MAKEINTRESOURCE(iconIndex), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); + if (!*LargeIcon) { SetLastError(ERROR_INVALID_INDEX); goto cleanup;