diff --git "a/modules/rostests/apitests/shell32/ExtractIconEx.cpp" "b/modules/rostests/apitests/shell32/ExtractIconEx.cpp" index e32f3ac34d2..8c66ce14984 100644 --- "a/modules/rostests/apitests/shell32/ExtractIconEx.cpp" +++ "b/modules/rostests/apitests/shell32/ExtractIconEx.cpp" @@ -22,16 +22,33 @@ EXTRACTICONTESTS IconTests[] = {L"%SystemRoot%\\System32\\autochk.exe", 0}, /* Non-existing files */ - {L"%SystemRoot%\\non-existent-file.sdf", 0} + {L"%SystemRoot%\\non-existent-file.sdf", 0}, + + /* Multiple icons in the same ICO file (6 icons) */ + {L"%SystemRoot%\\bin\\sysicon.ico", 1}, + + /* Multiple icons in the same EXE file (18 icons) */ + {L"%SystemRoot%\\explorer.exe", 18}, + + /* ICO file with both normal and PNG icons */ + {L"%SystemRoot%\\bin\\ROS.ico", 0}, }; START_TEST(ExtractIconEx) { - UINT i, nReturnedIcons; + UINT i, nReturnedIcons, nExtractedIcons; + /* Check count of icons returned */ for (i = 0; i < _countof(IconTests); ++i) { - nReturnedIcons = ExtractIconExW(IconTests[i].pszFilePath, 0, NULL, NULL, IconTests[i].nIcons); + nReturnedIcons = ExtractIconExW(IconTests[i].pszFilePath, -1, NULL, NULL, 0); ok(nReturnedIcons == IconTests[i].nIcons, "ExtractIconExW(%u): Expected %u icons, got %u\n", i, IconTests[i].nIcons, nReturnedIcons); } + + /* Check if the 0th icon can be extracted successfully */ + for (i = 0; i < _countof(IconTests); ++i) + { + nExtractedIcons = ExtractIconExW(IconTests[i].pszFilePath, 0, NULL, NULL, 1); + ok(nExtractedIcons == IconTests[i].nIcons, "ExtractIconExW(%u): Expected %u icons, got %u\n", i, IconTests[i].nIcons, nExtractedIcons); + } }