reactos/lib/shell32
diff -u -r1.6 -r1.7
--- iconcache.c 27 Mar 2004 09:08:10 -0000 1.6
+++ iconcache.c 21 Sep 2004 20:48:02 -0000 1.7
@@ -102,7 +102,7 @@
lpsice = (LPSIC_ENTRY) SHAlloc (sizeof (SIC_ENTRY));
- GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL);
+ GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL);
lpsice->sSourceFile = HeapAlloc( GetProcessHeap(), 0, (strlenW(path)+1)*sizeof(WCHAR) );
strcpyW( lpsice->sSourceFile, path );
@@ -211,29 +211,6 @@
LeaveCriticalSection(&SHELL32_SicCS);
return ret;
}
-/****************************************************************************
- * SIC_GetIcon [internal]
- *
- * NOTES
- * retrieves the specified icon from the iconcache.
- */
-static HICON WINE_UNUSED SIC_GetIcon (LPCWSTR sSourceFile, INT dwSourceIndex, BOOL bSmallIcon )
-{ INT index;
-
- TRACE("%s %i\n", debugstr_w(sSourceFile), dwSourceIndex);
-
- index = SIC_GetIconIndex(sSourceFile, dwSourceIndex);
-
- if (INVALID_INDEX == index)
- {
- return (HICON)INVALID_INDEX;
- }
-
- if (bSmallIcon)
- return ImageList_GetIcon(ShellSmallIconList, index, ILD_NORMAL);
-
- return ImageList_GetIcon(ShellBigIconList, index, ILD_NORMAL);
-}
/*****************************************************************************
* SIC_Initialize [internal]
*
@@ -309,10 +286,15 @@
if (sic_hdpa) DPA_DestroyCallback(sic_hdpa, sic_free, NULL );
sic_hdpa = NULL;
+ ImageList_Destroy(ShellSmallIconList);
+ ShellSmallIconList = 0;
+ ImageList_Destroy(ShellBigIconList);
+ ShellBigIconList = 0;
LeaveCriticalSection(&SHELL32_SicCS);
DeleteCriticalSection(&SHELL32_SicCS);
}
+
/*************************************************************************
* Shell_GetImageList [SHELL32.71]
*
@@ -449,7 +431,7 @@
/*************************************************************************
* ExtractIconExW [SHELL32.@]
- * RETURNS:
+ * RETURNS
* 0 no icon found
* -1 file is not valid
* or number of icons extracted
@@ -528,8 +510,12 @@
else
*lpiIcon = 6; /* generic icon - found nothing */
- GetModuleFileNameA(hInst, lpIconPath, 0x80);
- hIcon = LoadIconA( hInst, MAKEINTRESOURCEA(*lpiIcon));
+ if (GetModuleFileNameA(hInst, lpIconPath, 0x80))
+ {
+ /* terminate string (GetModuleFileName doesn't do if buffer is too small) */
+ lpIconPath[0x80 - 1] = '\0';
+ hIcon = LoadIconA( hInst, MAKEINTRESOURCEA(*lpiIcon));
+ }
}
return hIcon;
}