shell32: SHGetFileInfo should clear hIcon in some cases

Dan Kegel dank at
Sat Jul 12 18:58:00 CDT 2008

msdn says:
"If SHGetFileInfo returns an icon handle in the hIcon member of the
SHFILEINFO structure pointed to by psfi, you are responsible
for freeing it with DestroyIcon when you no longer need it."

While valgrinding picasa, I noticed that the caller of SHGetFileInfo
was following this advice, but SHGetFileIcon had not actually modified
hIcon, leading to garbage being compared (and possibly passed to

So I added a number of tests to see when SHGetFileInfo[WA]
sets the fields of SHFILEINFO, and added narrow fixes for
the two problems this exposed in how we set hIcon.
(I found a few other problems, but left them marked todo_wine,
since I haven't seen them come up in a real app yet.)

Tests pass on Windows XP and Wine.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hicon.patch
Type: text/x-diff
Size: 6588 bytes
Desc: not available
Url : 

More information about the wine-patches mailing list