mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 02:36:13 +00:00
[USER32]
- add ICO files support for PrivateExtractIcons(Ex) - fixes Juice and ICO files now show their icons in explorer CORE-4021 svn path=/trunk/; revision=65297
This commit is contained in:
parent
5eaf6cc648
commit
5b5d036b35
1 changed files with 39 additions and 3 deletions
|
@ -221,7 +221,7 @@ static UINT ICO_ExtractIconExW(
|
||||||
LPBYTE pData;
|
LPBYTE pData;
|
||||||
DWORD sig;
|
DWORD sig;
|
||||||
HANDLE hFile;
|
HANDLE hFile;
|
||||||
UINT16 iconDirCount = 0; //,iconCount = 0;
|
UINT16 iconDirCount = 0, iconCount = 0;
|
||||||
LPBYTE peimage;
|
LPBYTE peimage;
|
||||||
HANDLE fmapping;
|
HANDLE fmapping;
|
||||||
DWORD fsizeh,fsizel;
|
DWORD fsizeh,fsizel;
|
||||||
|
@ -360,12 +360,48 @@ static UINT ICO_ExtractIconExW(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#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 */
|
/* end ico file */
|
||||||
|
|
||||||
/* exe/dll */
|
/* exe/dll */
|
||||||
else if( sig == IMAGE_NT_SIGNATURE )
|
else if( sig == IMAGE_NT_SIGNATURE )
|
||||||
#endif
|
|
||||||
if( sig == IMAGE_NT_SIGNATURE )
|
|
||||||
{
|
{
|
||||||
BYTE *idata, *igdata;
|
BYTE *idata, *igdata;
|
||||||
const IMAGE_RESOURCE_DIRECTORY *rootresdir, *iconresdir, *icongroupresdir;
|
const IMAGE_RESOURCE_DIRECTORY *rootresdir, *iconresdir, *icongroupresdir;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue