4 * taken and slightly changed from shell
5 * this should replace the icon extraction code in shell32 and shell16 once
6 * it needs a serious test for compliance with the native API
9 #include <stdlib.h> /* abs() */
10 #include <sys/types.h>
18 #include "wine/winbase16.h"
19 #include "cursoricon.h"
21 #include "debugtools.h"
23 DEFAULT_DEBUG_CHANNEL(icon
);
29 BYTE bWidth
; /* Width, in pixels, of the image */
30 BYTE bHeight
; /* Height, in pixels, of the image */
31 BYTE bColorCount
; /* Number of colors in image (0 if >=8bpp) */
32 BYTE bReserved
; /* Reserved ( must be 0) */
33 WORD wPlanes
; /* Color Planes */
34 WORD wBitCount
; /* Bits per pixel */
35 DWORD dwBytesInRes
; /* How many bytes in this resource? */
36 DWORD dwImageOffset
; /* Where in the file is this image? */
37 } icoICONDIRENTRY
, *LPicoICONDIRENTRY
;
41 WORD idReserved
; /* Reserved (must be 0) */
42 WORD idType
; /* Resource Type (RES_ICON or RES_CURSOR) */
43 WORD idCount
; /* How many images */
44 icoICONDIRENTRY idEntries
[1]; /* An entry for each image (idCount of 'em) */
45 } icoICONDIR
, *LPicoICONDIR
;
50 static void dumpIcoDirEnty ( LPicoICONDIRENTRY entry
)
52 TRACE("width = 0x%08x height = 0x%08x\n", entry
->bWidth
, entry
->bHeight
);
53 TRACE("colors = 0x%08x planes = 0x%08x\n", entry
->bColorCount
, entry
->wPlanes
);
54 TRACE("bitcount = 0x%08x bytesinres = 0x%08lx offset = 0x%08lx\n",
55 entry
->wBitCount
, entry
->dwBytesInRes
, entry
->dwImageOffset
);
57 static void dumpIcoDir ( LPicoICONDIR entry
)
59 TRACE("type = 0x%08x count = 0x%08x\n", entry
->idType
, entry
->idCount
);
63 /**********************************************************************
66 * Find an entry by id in a resource directory
67 * Copied from loader/pe_resource.c (FIXME: should use exported resource functions)
69 static const IMAGE_RESOURCE_DIRECTORY
*find_entry_by_id( const IMAGE_RESOURCE_DIRECTORY
*dir
,
70 WORD id
, const void *root
)
72 const IMAGE_RESOURCE_DIRECTORY_ENTRY
*entry
;
75 entry
= (const IMAGE_RESOURCE_DIRECTORY_ENTRY
*)(dir
+ 1);
76 min
= dir
->NumberOfNamedEntries
;
77 max
= min
+ dir
->NumberOfIdEntries
- 1;
80 pos
= (min
+ max
) / 2;
81 if (entry
[pos
].u1
.s2
.Id
== id
)
82 return (IMAGE_RESOURCE_DIRECTORY
*)((char *)root
+ entry
[pos
].u2
.s3
.OffsetToDirectory
);
83 if (entry
[pos
].u1
.s2
.Id
> id
) max
= pos
- 1;
89 /**********************************************************************
92 * Find a default entry in a resource directory
93 * Copied from loader/pe_resource.c (FIXME: should use exported resource functions)
95 static const IMAGE_RESOURCE_DIRECTORY
*find_entry_default( const IMAGE_RESOURCE_DIRECTORY
*dir
,
98 const IMAGE_RESOURCE_DIRECTORY_ENTRY
*entry
;
99 entry
= (const IMAGE_RESOURCE_DIRECTORY_ENTRY
*)(dir
+ 1);
100 return (IMAGE_RESOURCE_DIRECTORY
*)((char *)root
+ entry
->u2
.s3
.OffsetToDirectory
);
103 /*************************************************************************
104 * USER32_GetResourceTable
106 static DWORD
USER32_GetResourceTable(LPBYTE peimage
,DWORD pesize
,LPBYTE
*retptr
)
108 IMAGE_DOS_HEADER
* mz_header
;
110 TRACE("%p %p\n", peimage
, retptr
);
114 mz_header
= (IMAGE_DOS_HEADER
*) peimage
;
116 if (mz_header
->e_magic
!= IMAGE_DOS_SIGNATURE
)
118 if (mz_header
->e_cblp
== 1) /* .ICO file ? */
120 *retptr
= (LPBYTE
)-1; /* ICONHEADER.idType, must be 1 */
124 return 0; /* failed */
126 if (mz_header
->e_lfanew
>= pesize
) {
127 return 0; /* failed, happens with PKZIP DOS Exes for instance. */
129 if (*((DWORD
*)(peimage
+ mz_header
->e_lfanew
)) == IMAGE_NT_SIGNATURE
)
130 return IMAGE_NT_SIGNATURE
;
132 if (*((WORD
*)(peimage
+ mz_header
->e_lfanew
)) == IMAGE_OS2_SIGNATURE
)
134 IMAGE_OS2_HEADER
* ne_header
;
136 ne_header
= (IMAGE_OS2_HEADER
*)(peimage
+ mz_header
->e_lfanew
);
138 if (ne_header
->ne_magic
!= IMAGE_OS2_SIGNATURE
)
141 if( (ne_header
->ne_restab
- ne_header
->ne_rsrctab
) <= sizeof(NE_TYPEINFO
) )
142 *retptr
= (LPBYTE
)-1;
144 *retptr
= peimage
+ mz_header
->e_lfanew
+ ne_header
->ne_rsrctab
;
146 return IMAGE_OS2_SIGNATURE
;
148 return 0; /* failed */
150 /*************************************************************************
151 * USER32_LoadResource
153 static BYTE
* USER32_LoadResource( LPBYTE peimage
, NE_NAMEINFO
* pNInfo
, WORD sizeShift
, ULONG
*uSize
)
155 TRACE("%p %p 0x%08x\n", peimage
, pNInfo
, sizeShift
);
157 *uSize
= (DWORD
)pNInfo
->length
<< sizeShift
;
158 return peimage
+ ((DWORD
)pNInfo
->offset
<< sizeShift
);
161 /*************************************************************************
164 static BYTE
* ICO_LoadIcon( LPBYTE peimage
, LPicoICONDIRENTRY lpiIDE
, ULONG
*uSize
)
166 TRACE("%p %p\n", peimage
, lpiIDE
);
168 *uSize
= lpiIDE
->dwBytesInRes
;
169 return peimage
+ lpiIDE
->dwImageOffset
;
172 /*************************************************************************
173 * ICO_GetIconDirectory
175 * Reads .ico file and build phony ICONDIR struct
176 * see http://www.microsoft.com/win32dev/ui/icons.htm
178 #define HEADER_SIZE (sizeof(CURSORICONDIR) - sizeof (CURSORICONDIRENTRY))
179 #define HEADER_SIZE_FILE (sizeof(icoICONDIR) - sizeof (icoICONDIRENTRY))
181 static BYTE
* ICO_GetIconDirectory( LPBYTE peimage
, LPicoICONDIR
* lplpiID
, ULONG
*uSize
)
183 CURSORICONDIR
* lpcid
; /* icon resource in resource-dir format */
184 CURSORICONDIR
* lpID
; /* icon resource in resource format */
187 TRACE("%p %p\n", peimage
, lplpiID
);
189 lpcid
= (CURSORICONDIR
*)peimage
;
191 if( lpcid
->idReserved
|| (lpcid
->idType
!= 1) || (!lpcid
->idCount
) )
194 /* allocate the phony ICONDIR structure */
195 *uSize
= lpcid
->idCount
* sizeof(CURSORICONDIRENTRY
) + HEADER_SIZE
;
196 if( (lpID
= (CURSORICONDIR
*)HeapAlloc(GetProcessHeap(),0, *uSize
) ))
198 /* copy the header */
199 lpID
->idReserved
= lpcid
->idReserved
;
200 lpID
->idType
= lpcid
->idType
;
201 lpID
->idCount
= lpcid
->idCount
;
203 /* copy the entrys */
204 for( i
=0; i
< lpcid
->idCount
; i
++ )
206 memcpy((void*)&(lpID
->idEntries
[i
]),(void*)&(lpcid
->idEntries
[i
]), sizeof(CURSORICONDIRENTRY
) - 2);
207 lpID
->idEntries
[i
].wResId
= i
;
210 *lplpiID
= (LPicoICONDIR
)peimage
;
216 /*************************************************************************
217 * ICO_ExtractIconExW [internal]
220 * nIcons = 0: returns number of Icons in file
223 * failure:0; success: icon handle or nr of icons (nIconIndex-1)
225 static HRESULT
ICO_ExtractIconExW(
226 LPCWSTR lpszExeFileName
,
233 HGLOBAL hRet
= E_FAIL
;
237 UINT16 iconDirCount
= 0,iconCount
= 0;
243 TRACE("(file %s,start %d,extract %d\n", debugstr_w(lpszExeFileName
), nIconIndex
, nIcons
);
245 hFile
= CreateFileW( lpszExeFileName
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, OPEN_EXISTING
, 0, 0 );
246 if (hFile
== INVALID_HANDLE_VALUE
) return hRet
;
247 fsizel
= GetFileSize(hFile
,&fsizeh
);
250 fmapping
= CreateFileMappingA( hFile
, NULL
, PAGE_READONLY
| SEC_COMMIT
, 0, 0, NULL
);
251 CloseHandle( hFile
);
254 WARN("CreateFileMapping error %ld\n", GetLastError() );
258 if ( !(peimage
= MapViewOfFile(fmapping
,FILE_MAP_READ
,0,0,0)))
260 WARN("MapViewOfFile error %ld\n", GetLastError() );
261 CloseHandle( fmapping
);
264 CloseHandle( fmapping
);
266 sig
= USER32_GetResourceTable(peimage
,fsizel
,&pData
);
269 if( sig
==IMAGE_OS2_SIGNATURE
|| sig
==1 ) /* .ICO file */
272 NE_TYPEINFO
*pTInfo
= (NE_TYPEINFO
*)(pData
+ 2);
273 NE_NAMEINFO
*pIconStorage
= NULL
;
274 NE_NAMEINFO
*pIconDir
= NULL
;
275 LPicoICONDIR lpiID
= NULL
;
277 TRACE("-- OS2/icon Signature (0x%08lx)\n", sig
);
279 if( pData
== (BYTE
*)-1 )
281 /* FIXME: pCIDir is allocated on the heap - memory leak */
282 pCIDir
= ICO_GetIconDirectory(peimage
, &lpiID
, &uSize
); /* check for .ICO file */
285 iconDirCount
= 1; iconCount
= lpiID
->idCount
;
286 TRACE("-- icon found %p 0x%08lx 0x%08x 0x%08x\n", pCIDir
, uSize
, iconDirCount
, iconCount
);
289 else while( pTInfo
->type_id
&& !(pIconStorage
&& pIconDir
) )
291 if( pTInfo
->type_id
== NE_RSCTYPE_GROUP_ICON
) /* find icon directory and icon repository */
293 iconDirCount
= pTInfo
->count
;
294 pIconDir
= ((NE_NAMEINFO
*)(pTInfo
+ 1));
295 TRACE("\tfound directory - %i icon families\n", iconDirCount
);
297 if( pTInfo
->type_id
== NE_RSCTYPE_ICON
)
299 iconCount
= pTInfo
->count
;
300 pIconStorage
= ((NE_NAMEINFO
*)(pTInfo
+ 1));
301 TRACE("\ttotal icons - %i\n", iconCount
);
303 pTInfo
= (NE_TYPEINFO
*)((char*)(pTInfo
+1)+pTInfo
->count
*sizeof(NE_NAMEINFO
));
306 if( (pIconStorage
&& pIconDir
) || lpiID
) /* load resources and create icons */
312 else if( nIconIndex
< iconDirCount
)
315 if( nIcons
> iconDirCount
- nIconIndex
)
316 nIcons
= iconDirCount
- nIconIndex
;
318 for( i
= nIconIndex
; i
< nIconIndex
+ nIcons
; i
++ )
320 /* .ICO files have only one icon directory */
321 if( lpiID
== NULL
) /* *.ico */
322 pCIDir
= USER32_LoadResource( peimage
, pIconDir
+ i
, *(WORD
*)pData
, &uSize
);
323 RetPtr
[i
-nIconIndex
] = LookupIconIdFromDirectoryEx( pCIDir
, TRUE
, cxDesired
, cyDesired
, 0);
326 for( icon
= nIconIndex
; icon
< nIconIndex
+ nIcons
; icon
++ )
330 pCIDir
= ICO_LoadIcon( peimage
, lpiID
->idEntries
+ RetPtr
[icon
-nIconIndex
], &uSize
);
332 for( i
= 0; i
< iconCount
; i
++ )
333 if( pIconStorage
[i
].id
== (RetPtr
[icon
-nIconIndex
] | 0x8000) )
334 pCIDir
= USER32_LoadResource( peimage
, pIconStorage
+ i
,*(WORD
*)pData
, &uSize
);
337 RetPtr
[icon
-nIconIndex
] = (HICON
) CreateIconFromResourceEx(pCIDir
,uSize
,TRUE
,0x00030000, cxDesired
, cyDesired
, LR_DEFAULTCOLOR
);
339 RetPtr
[icon
-nIconIndex
] = 0;
348 else if( sig
== IMAGE_NT_SIGNATURE
)
351 PIMAGE_DOS_HEADER dheader
;
352 PIMAGE_NT_HEADERS pe_header
;
353 PIMAGE_SECTION_HEADER pe_sections
;
354 const IMAGE_RESOURCE_DIRECTORY
*rootresdir
,*iconresdir
,*icongroupresdir
;
355 const IMAGE_RESOURCE_DATA_ENTRY
*idataent
,*igdataent
;
356 const IMAGE_RESOURCE_DIRECTORY_ENTRY
*xresent
;
359 dheader
= (PIMAGE_DOS_HEADER
)peimage
;
360 pe_header
= (PIMAGE_NT_HEADERS
)(peimage
+dheader
->e_lfanew
); /* it is a pe header, USER32_GetResourceTable checked that */
361 pe_sections
= (PIMAGE_SECTION_HEADER
)(((char*)pe_header
)+sizeof(*pe_header
)); /* probably makes problems with short PE headers...*/
364 /* search for the root resource directory */
365 for (i
=0;i
<pe_header
->FileHeader
.NumberOfSections
;i
++)
367 if (pe_sections
[i
].Characteristics
& IMAGE_SCN_CNT_UNINITIALIZED_DATA
)
369 if (fsizel
< pe_sections
[i
].PointerToRawData
+pe_sections
[i
].SizeOfRawData
) {
370 FIXME("File %s too short (section is at %ld bytes, real size is %ld)\n",
371 debugstr_w(lpszExeFileName
),
372 pe_sections
[i
].PointerToRawData
+pe_sections
[i
].SizeOfRawData
,
377 /* FIXME: doesn't work when the resources are not in a seperate section */
378 if (pe_sections
[i
].VirtualAddress
== pe_header
->OptionalHeader
.DataDirectory
[IMAGE_DIRECTORY_ENTRY_RESOURCE
].VirtualAddress
)
380 rootresdir
= (PIMAGE_RESOURCE_DIRECTORY
)(peimage
+pe_sections
[i
].PointerToRawData
);
387 WARN("haven't found section for resource directory.\n");
388 goto end
; /* failure */
391 /* search for the group icon directory */
392 if (!(icongroupresdir
= find_entry_by_id(rootresdir
, LOWORD(RT_GROUP_ICONW
), rootresdir
)))
394 WARN("No Icongroupresourcedirectory!\n");
395 goto end
; /* failure */
397 iconDirCount
= icongroupresdir
->NumberOfNamedEntries
+ icongroupresdir
->NumberOfIdEntries
;
399 /* only number of icons requested */
403 goto end
; /* success */
408 /* search resource id */
410 int iId
= abs(nIconIndex
);
411 PIMAGE_RESOURCE_DIRECTORY_ENTRY xprdeTmp
= (PIMAGE_RESOURCE_DIRECTORY_ENTRY
)(icongroupresdir
+1);
413 while(n
<iconDirCount
&& xprdeTmp
)
415 if(xprdeTmp
->u1
.s2
.Id
== iId
)
425 WARN("resource id %d not found\n", iId
);
426 goto end
; /* failure */
431 /* check nIconIndex to be in range */
432 if (nIconIndex
>= iconDirCount
)
434 WARN("nIconIndex %d is larger than iconDirCount %d\n",nIconIndex
,iconDirCount
);
435 goto end
; /* failure */
439 /* assure we don't get too much */
440 if( nIcons
> iconDirCount
- nIconIndex
)
441 nIcons
= iconDirCount
- nIconIndex
;
443 /* starting from specified index */
444 xresent
= (PIMAGE_RESOURCE_DIRECTORY_ENTRY
)(icongroupresdir
+1) + nIconIndex
;
446 for (i
=0; i
< nIcons
; i
++,xresent
++)
448 const IMAGE_RESOURCE_DIRECTORY
*resdir
;
450 /* go down this resource entry, name */
451 resdir
= (PIMAGE_RESOURCE_DIRECTORY
)((DWORD
)rootresdir
+(xresent
->u2
.s3
.OffsetToDirectory
));
453 /* default language (0) */
454 resdir
= find_entry_default(resdir
,rootresdir
);
455 igdataent
= (PIMAGE_RESOURCE_DATA_ENTRY
)resdir
;
457 /* lookup address in mapped image for virtual address */
460 for (j
=0;j
<pe_header
->FileHeader
.NumberOfSections
;j
++)
462 if (igdataent
->OffsetToData
< pe_sections
[j
].VirtualAddress
)
464 if (igdataent
->OffsetToData
+igdataent
->Size
> pe_sections
[j
].VirtualAddress
+pe_sections
[j
].SizeOfRawData
)
467 if (igdataent
->OffsetToData
-pe_sections
[j
].VirtualAddress
+pe_sections
[j
].PointerToRawData
+igdataent
->Size
> fsizel
) {
468 FIXME("overflow in PE lookup (%s has len %ld, have offset %ld), short file?\n",debugstr_w(lpszExeFileName
),fsizel
,igdataent
->OffsetToData
-pe_sections
[j
].VirtualAddress
+pe_sections
[j
].PointerToRawData
+igdataent
->Size
);
469 goto end
; /* failure */
471 igdata
= peimage
+(igdataent
->OffsetToData
-pe_sections
[j
].VirtualAddress
+pe_sections
[j
].PointerToRawData
);
476 FIXME("no matching real address for icongroup!\n");
477 goto end
; /* failure */
479 RetPtr
[i
] = (HICON
)LookupIconIdFromDirectoryEx(igdata
, TRUE
, cxDesired
, cyDesired
, LR_DEFAULTCOLOR
);
482 if (!(iconresdir
=find_entry_by_id(rootresdir
,LOWORD(RT_ICONW
),rootresdir
)))
484 WARN("No Iconresourcedirectory!\n");
485 goto end
; /* failure */
488 for (i
=0; i
<nIcons
; i
++)
490 const IMAGE_RESOURCE_DIRECTORY
*xresdir
;
491 xresdir
= find_entry_by_id(iconresdir
,RetPtr
[i
],rootresdir
);
492 xresdir
= find_entry_default(xresdir
,rootresdir
);
493 idataent
= (PIMAGE_RESOURCE_DATA_ENTRY
)xresdir
;
496 /* map virtual to address in image */
497 for (j
=0;j
<pe_header
->FileHeader
.NumberOfSections
;j
++)
499 if (idataent
->OffsetToData
< pe_sections
[j
].VirtualAddress
)
501 if (idataent
->OffsetToData
+idataent
->Size
> pe_sections
[j
].VirtualAddress
+pe_sections
[j
].SizeOfRawData
)
503 idata
= peimage
+(idataent
->OffsetToData
-pe_sections
[j
].VirtualAddress
+pe_sections
[j
].PointerToRawData
);
507 WARN("no matching real address found for icondata!\n");
511 RetPtr
[i
] = (HICON
) CreateIconFromResourceEx(idata
,idataent
->Size
,TRUE
,0x00030000, cxDesired
, cyDesired
, LR_DEFAULTCOLOR
);
513 hRet
= S_OK
; /* return first icon */
514 } /* if(sig == IMAGE_NT_SIGNATURE) */
516 end
: UnmapViewOfFile(peimage
); /* success */
520 /***********************************************************************
521 * PrivateExtractIconsW [USER32.@]
524 * nIndex = 1: a small and a large icon are extracted.
525 * the higher word of sizeXY contains the size of the small icon, the lower
526 * word the size of the big icon. phicon points to HICON[2].
529 * nIcons > 0: HRESULT
530 * nIcons = 0: the number of icons
533 HRESULT WINAPI
PrivateExtractIconsW (
538 HICON
* phicon
, /* [???] NOTE: HICON* */
539 DWORD w
, /* [in] NOTE: 0 */
541 DWORD y
) /* [in] NOTE: 0x80 maybe LR_* constant */
544 TRACE("%s 0x%08x 0x%08lx 0x%08lx %p 0x%08lx 0x%08x 0x%08lx\n",
545 debugstr_w(lpwstrFile
),nIndex
, sizeX
,sizeY
,phicon
,w
,nIcons
,y
);
547 if ((nIcons
== 2) && HIWORD(sizeX
) && HIWORD(sizeY
))
549 ret
= ICO_ExtractIconExW(lpwstrFile
, phicon
, nIndex
, 1, sizeX
& 0xffff, sizeY
& 0xffff );
550 if (!SUCCEEDED(ret
)) return ret
;
551 ret
= ICO_ExtractIconExW(lpwstrFile
, phicon
+1, nIndex
, 1, (sizeX
>>16) & 0xffff, (sizeY
>>16) & 0xffff );
553 ret
= ICO_ExtractIconExW(lpwstrFile
, phicon
, nIndex
, nIcons
, sizeX
& 0xffff, sizeY
& 0xffff );
557 /***********************************************************************
558 * PrivateExtractIconsA [USER32.@]
561 HRESULT WINAPI
PrivateExtractIconsA (
567 DWORD w
, /* [in] NOTE: 0 */
569 DWORD y
) /* [in] NOTE: 0x80 */
572 LPWSTR lpwstrFile
= HEAP_strdupAtoW(GetProcessHeap(), 0, lpstrFile
);
574 ret
= PrivateExtractIconsW(
575 lpwstrFile
, nIndex
, sizeX
, sizeY
, phicon
, w
, nIcons
, y
578 HeapFree(GetProcessHeap(), 0, lpwstrFile
);
582 /***********************************************************************
583 * PrivateExtractIconExW [USER32.443]
585 * if nIcons = -1 it returns the number of icons in any case !!!
587 HRESULT WINAPI
PrivateExtractIconExW (
594 DWORD cyicon
, cysmicon
, cxicon
, cxsmicon
;
597 TRACE("%s 0x%08lx %p %p 0x%08x\n",
598 debugstr_w(lpwstrFile
),nIndex
,phIconLarge
, phIconSmall
, nIcons
);
600 if (nIndex
== 1 && phIconSmall
&& phIconLarge
)
603 cxicon
= GetSystemMetrics(SM_CXICON
);
604 cyicon
= GetSystemMetrics(SM_CYICON
);
605 cxsmicon
= GetSystemMetrics(SM_CXSMICON
);
606 cysmicon
= GetSystemMetrics(SM_CYSMICON
);
608 ret
= PrivateExtractIconsW ( lpwstrFile
, nIndex
, cxicon
| (cxsmicon
<<16), cyicon
| (cysmicon
<<16),
609 (HICON
*) &hIcon
, 0, 2, 0 );
610 *phIconLarge
= hIcon
[0];
611 *phIconSmall
= hIcon
[1];
619 /* extract n small icons */
620 cxsmicon
= GetSystemMetrics(SM_CXSMICON
);
621 cysmicon
= GetSystemMetrics(SM_CYSMICON
);
622 ret
= PrivateExtractIconsW ( lpwstrFile
, nIndex
, cxsmicon
, cysmicon
, phIconSmall
, 0, nIcons
, 0 );
626 /* extract n large icons */
627 cxicon
= GetSystemMetrics(SM_CXICON
);
628 cyicon
= GetSystemMetrics(SM_CYICON
);
629 ret
= PrivateExtractIconsW ( lpwstrFile
, nIndex
, cxicon
, cyicon
, phIconLarge
, 0, nIcons
, 0 );
634 /* get the number of icons */
635 return PrivateExtractIconsW ( lpwstrFile
, 0, 0, 0, 0, 0, 0, 0 );
638 /***********************************************************************
639 * PrivateExtractIconExA [USER32.442]
641 HRESULT WINAPI
PrivateExtractIconExA (
649 LPWSTR lpwstrFile
= HEAP_strdupAtoW(GetProcessHeap(), 0, lpstrFile
);
651 TRACE("%s 0x%08lx %p %p 0x%08x\n",
652 lpstrFile
, nIndex
, phIconLarge
, phIconSmall
, nIcons
);
654 ret
= PrivateExtractIconExW(lpwstrFile
,nIndex
,phIconLarge
, phIconSmall
, nIcons
);
656 HeapFree(GetProcessHeap(), 0, lpwstrFile
);