[SHELL32] Do not return -1 if a file is not valid or not found - ExtractIconEx()...
authorBișoc George <fraizeraust99@gmail.com>
Wed, 11 Dec 2019 23:24:20 +0000 (00:24 +0100)
committerKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Wed, 11 Dec 2019 23:24:20 +0000 (08:24 +0900)
commit8ec05f5fa1108a50f378e57b76b5015ab7613ffe
tree6c319d7737845e236787addc94b896affcfe0815
parentcfdd483c0ee168529efc702c0711b285cf558453
[SHELL32] Do not return -1 if a file is not valid or not found - ExtractIconEx() (#2113)

ExtractIconEx() returns the number of successfully extracted icons from a file. The routine may return 0 in case no icons could be extracted but it could also return 0 if the file is not a valid PE image file or the file couldn't be found.

PrivateExtractIcons and the internal USER32 routine, ICO_ExtractIconExW(), return -1 in such scenarios. The behaviour is correct however we do not want that ExtractIconEx() returns -1 as well as it doesn't comply with the general documentation. In such cases, simply return 0 as no successful icons have been extracted due to related file failures.

CORE-16535
dll/win32/shell32/iconcache.cpp
modules/rostests/apitests/shell32/CMakeLists.txt
modules/rostests/apitests/shell32/ExtractIconEx.cpp [new file with mode: 0644]
modules/rostests/apitests/shell32/testlist.c