diff --git a/modules/rostests/apitests/shell32/ExtractIconEx.cpp b/modules/rostests/apitests/shell32/ExtractIconEx.cpp index e32f3ac34d2..29ff93d2212 100644 --- a/modules/rostests/apitests/shell32/ExtractIconEx.cpp +++ b/modules/rostests/apitests/shell32/ExtractIconEx.cpp @@ -22,16 +22,30 @@ 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} }; 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); + } } diff --git a/modules/rostests/win32/user32/sysicon/CMakeLists.txt b/modules/rostests/win32/user32/sysicon/CMakeLists.txt index 55d70ab239d..618e74ec203 100644 --- a/modules/rostests/win32/user32/sysicon/CMakeLists.txt +++ b/modules/rostests/win32/user32/sysicon/CMakeLists.txt @@ -8,3 +8,4 @@ target_link_libraries(sysicon ${PSEH_LIB}) set_module_type(sysicon win32gui UNICODE) add_importlibs(sysicon gdi32 user32 msvcrt kernel32) add_rostests_file(TARGET sysicon SUBDIR suppl) +add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/sysicon.ico")