Author: cfinck Date: Wed Sep 5 16:44:07 2007 New Revision: 28874
URL: http://svn.reactos.org/svn/reactos?rev=28874&view=rev Log: Merge in 28862 and 28817 (Device Manager icon stuff)
Modified: branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/devclass.c branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/devinst.c branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/res/icons/20.ico branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/res/icons/23.ico branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/res/icons/9.ico branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/res/icons/Icon_Licence/Tango.txt branches/ros-branch-0_3_3-new/reactos/media/inf/keyboard.inf
Modified: branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/devclass.c URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3-new/reactos/dll... ============================================================================== --- branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/devclass.c (original) +++ branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/devclass.c Wed Sep 5 16:44:07 2007 @@ -1449,7 +1449,7 @@
/* Prepare a HIMAGELIST */ InitCommonControls(); - ClassImageListData->ImageList = ImageList_Create(16, 16, ILC_COLOR, 100, 10); + ClassImageListData->ImageList = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 100, 10); if (!ClassImageListData->ImageList) goto cleanup;
@@ -1459,14 +1459,25 @@ * and put their index in the image list in the IconIndexes array */ for (i = 0; i < list->NumberOfGuids; i++) { + INT miniIconIndex; + ret = SetupDiLoadClassIcon( &list->Guids[i], - &hIcon, - NULL); + NULL, + &miniIconIndex); if (ret) - list->IconIndexes[i] = ImageList_AddIcon(ClassImageListData->ImageList, hIcon); + { + hIcon = LoadImage(hInstance, MAKEINTRESOURCE(miniIconIndex), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); + if (hIcon) + { + list->IconIndexes[i] = ImageList_AddIcon(ClassImageListData->ImageList, hIcon); + DestroyIcon(hIcon); + } + else + list->IconIndexes[i] = -1; + } else - list->IconIndexes[i] = -1; /* Special value to tell that icon is unavailable */ + list->IconIndexes[i] = -1; /* Special value to indicate that the icon is unavailable */ }
ret = TRUE; @@ -1612,7 +1623,8 @@ 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, 32, 32, LR_DEFAULTCOLOR); + if (!*LargeIcon) { SetLastError(ERROR_INVALID_INDEX); goto cleanup;
Modified: branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/devinst.c URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3-new/reactos/dll... ============================================================================== --- branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/devinst.c (original) +++ branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/devinst.c Wed Sep 5 16:44:07 2007 @@ -2710,7 +2710,7 @@ { struct DeviceInfoSet *list; HKEY hEnumKey, hKey = NULL; - DWORD rc; + DWORD rc, dwSize; BOOL ret = FALSE;
TRACE("%p %s %p %lx %p\n", @@ -2738,7 +2738,7 @@ struct DeviceInfoElement *deviceInfo = NULL; /* Search if device already exists in DeviceInfoSet. * If yes, return the existing element - * If no, create a new element using informations in registry + * If no, create a new element using information in registry */ PLIST_ENTRY ItemList = list->ListHead.Flink; while (ItemList != &list->ListHead) @@ -2757,6 +2757,9 @@ } else { + GUID ClassGUID; + WCHAR szClassGuid[MAX_GUID_STRING_LEN]; + /* Open supposed registry key */ rc = RegOpenKeyExW( list->HKLM, @@ -2784,11 +2787,25 @@ goto cleanup; }
- /* FIXME: try to get ClassGUID from registry, instead of - * sending GUID_NULL to CreateDeviceInfoElement - */ - if (!CreateDeviceInfoElement(list, DeviceInstanceId, &GUID_NULL, &deviceInfo)) + ClassGUID = GUID_NULL; + dwSize = MAX_GUID_STRING_LEN * sizeof(WCHAR); + + if (RegQueryValueExW(hKey, + REGSTR_VAL_CLASSGUID, + NULL, + NULL, + (LPBYTE)szClassGuid, + &dwSize) == ERROR_SUCCESS) + { + szClassGuid[MAX_GUID_STRING_LEN - 2] = UNICODE_NULL; + + /* Convert a string to a ClassGuid */ + UuidFromStringW(&szClassGuid[1], &ClassGUID); + } + + if (!CreateDeviceInfoElement(list, DeviceInstanceId, &ClassGUID, &deviceInfo)) goto cleanup; + InsertTailList(&list->ListHead, &deviceInfo->ListEntry);
ret = TRUE;
Modified: branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/res/icons/20.ico URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3-new/reactos/dll... ============================================================================== Binary files - no diff available.
Modified: branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/res/icons/23.ico URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3-new/reactos/dll... ============================================================================== Binary files - no diff available.
Modified: branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/res/icons/9.ico URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3-new/reactos/dll... ============================================================================== Binary files - no diff available.
Modified: branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/res/icons/Icon_Licence/Tango.txt URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3-new/reactos/dll... ============================================================================== --- branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/res/icons/Icon_Licence/Tango.txt (original) +++ branches/ros-branch-0_3_3-new/reactos/dll/win32/setupapi/res/icons/Icon_Licence/Tango.txt Wed Sep 5 16:44:07 2007 @@ -13,115 +13,35 @@ 9.ico 10.ico 11.ico -12.ico -13.ico -14.ico -15.ico -16.ico -17.ico 18.ico 19.ico -20.ico 21.ico 22.ico 23.ico 24.ico 25.ico 28.ico -29.ico -30.ico -32.ico -33.ico -35.ico -36.ico -37.ico -38.ico -39.ico +40.ico 41.ico -44.ico -45.ico -46.ico -47.ico -48.ico +42.ico +43.ico +50.ico +51.ico +52.ico +53.ico 54.ico -137.ico -138.ico -151.ico -152.ico -153.ico -154.ico -155.ico -156.ico -157.ico -160.ico +105.ico +159.ico 161.ico -172.ico -173.ico -191.ico -192.ico -210.ico -220.ico -221.ico -222.ico -224.ico -225.ico -226.ico -228.ico -233.ico -235.ico -236.ico -237.ico -238.ico -240.ico -245.ico -246.ico -248.ico -249.ico -250.ico -252.ico -254.ico -255.ico -263.ico -265.ico -268.ico -269.ico -270.ico -271.ico -277.ico -279.ico -289.ico -290.ico -291.ico -292.ico -293.ico -294.ico -295.ico -296.ico -297.ico -298.ico -299.ico -302.ico -304.ico -305.ico -309.ico -315.ico -317.ico -318.ico -319.ico -322.ico -323.ico -324.ico -325.ico -326.ico -327.ico -328.ico -329.ico -330.ico -1001.ico -1004.ico -8240.ico -16710.ico -16715.ico -16717.ico -16718.ico -16721.ico +500.ico +501.ico +502.ico +5012.ico + +The following icons are the property of the VMware, Inc and are +released under Creative Commons Attribution-ShareAlike 2.5 License. +(http://www.chipx86.com/blog/?p=206) +Please see COPYING for details + +20.ico +23.ico
Modified: branches/ros-branch-0_3_3-new/reactos/media/inf/keyboard.inf URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3-new/reactos/med... ============================================================================== --- branches/ros-branch-0_3_3-new/reactos/media/inf/keyboard.inf (original) +++ branches/ros-branch-0_3_3-new/reactos/media/inf/keyboard.inf Wed Sep 5 16:44:07 2007 @@ -19,7 +19,7 @@
[KeyboardClass.NT.AddReg] HKR, , , 0, %KeyboardClassName% -HKR, , Icon, 0, "-2" +HKR, , Icon, 0, "-3" HKR, , Installer32, 0, "syssetup.dll,KeyboardClassInstaller" HKR, , NoInstallClass, 0, 1 HKR, , UpperFilters, 0x00010000, "kbdclass"