[SETUPAPI]

SetupDiLoadClassIcon: Return the handle to or index of the default icon (Other devices icon) if no valid ClassGuid was provided by the caller.
With this patch, the class icon of 'Other devices' appears in the device property sheets in the device manager.

svn path=/trunk/; revision=57884
This commit is contained in:
Eric Kohl 2012-12-11 22:47:35 +00:00
parent fec6076d61
commit 3ac627bfd8

View file

@ -646,23 +646,19 @@ SetupDiLoadClassIcon(
OUT HICON *LargeIcon OPTIONAL,
OUT PINT MiniIconIndex OPTIONAL)
{
BOOL ret = FALSE;
if (!ClassGuid)
SetLastError(ERROR_INVALID_PARAMETER);
else
{
LPWSTR Buffer = NULL;
LPCWSTR DllName;
INT iconIndex = 0;
INT iconIndex = -18;
HKEY hKey = INVALID_HANDLE_VALUE;
hKey = SetupDiOpenClassRegKey(ClassGuid, KEY_QUERY_VALUE);
if (hKey == INVALID_HANDLE_VALUE)
goto cleanup;
BOOL ret = FALSE;
if (!SETUP_GetIconIndex(hKey, &iconIndex))
goto cleanup;
if (ClassGuid)
{
hKey = SetupDiOpenClassRegKey(ClassGuid, KEY_QUERY_VALUE);
if (hKey != INVALID_HANDLE_VALUE)
SETUP_GetIconIndex(hKey, &iconIndex);
}
if (iconIndex > 0)
{
@ -746,8 +742,9 @@ SetupDiLoadClassIcon(
cleanup:
if (hKey != INVALID_HANDLE_VALUE)
RegCloseKey(hKey);
if (Buffer != NULL)
MyFree(Buffer);
}
TRACE("Returning %d\n", ret);
return ret;