On Tue, Oct 9, 2018 at 8:47 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Also, is it possible to have a test for this? Loading single icon size, and testing if the remaining sizes are created too?
I'm not sure how to go about making this test. The function SIC_LoadIcon loads all sizes by itself, it's only when PrivateExtractIconsW fails to load only some of the icon sizes (but not all) that this happens. But I don't know how to make PrivateExtractIconsW fail only on some icon sizes but not others, which would be needed for a test.
Also note that PrivateExtractIconsW can return non-zero *even* if the icon failed to load (so it's still NULL). Checking its return value is not reliable at all for this context. I don't know if that's a bug in the function or not, but it's safer this way.