Author: khornicek
Date: Thu Nov 6 19:11:03 2014
New Revision: 65297
URL:
http://svn.reactos.org/svn/reactos?rev=65297&view=rev
Log:
[USER32]
- add ICO files support for PrivateExtractIcons(Ex)
- fixes Juice and ICO files now show their icons in explorer
CORE-4021
Modified:
trunk/reactos/win32ss/user/user32/misc/exticon.c
Modified: trunk/reactos/win32ss/user/user32/misc/exticon.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/misc/e…
==============================================================================
--- trunk/reactos/win32ss/user/user32/misc/exticon.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/misc/exticon.c [iso-8859-1] Thu Nov 6 19:11:03
2014
@@ -221,7 +221,7 @@
LPBYTE pData;
DWORD sig;
HANDLE hFile;
- UINT16 iconDirCount = 0; //,iconCount = 0;
+ UINT16 iconDirCount = 0, iconCount = 0;
LPBYTE peimage;
HANDLE fmapping;
DWORD fsizeh,fsizel;
@@ -360,12 +360,48 @@
}
}
}
+#else
+ if (sig == 1) /* .ICO file */
+ {
+ TRACE("-- icon Signature (0x%08x)\n", sig);
+
+ if (pData == (BYTE*)-1)
+ {
+ INT dataOffset;
+ LPICONIMAGE entry;
+ CURSORICONDIR *lpcid = (CURSORICONDIR*)peimage;
+ INT cx[2] = {cx1, cx2}, cy[2] = {cy1, cy2};
+ INT index;
+
+ if (lpcid->idType != 1)
+ return 0;
+
+ for(index = 0; index < 2; index++)
+ {
+ dataOffset = LookupIconIdFromDirectoryEx(peimage, TRUE, cx[index],
cy[index], flags);
+
+ if (dataOffset)
+ {
+ HICON icon;
+ entry = (LPICONIMAGE)(peimage + dataOffset);
+ icon = CreateIconFromResourceEx(peimage + dataOffset,
entry->icHeader.biSizeImage, TRUE, 0x00030000, cx[index], cy[index], flags);
+
+ if (icon)
+ {
+ RetPtr[index] = icon;
+ iconCount = 1;
+ }
+ }
+ }
+
+ }
+ ret = iconCount; /* return number of retrieved icons */
+ }
+#endif
/* end ico file */
/* exe/dll */
else if( sig == IMAGE_NT_SIGNATURE )
-#endif
- if( sig == IMAGE_NT_SIGNATURE )
{
BYTE *idata, *igdata;
const IMAGE_RESOURCE_DIRECTORY *rootresdir, *iconresdir, *icongroupresdir;