diff --git a/dlls/comctl32/tests/imagelist.c b/dlls/comctl32/tests/imagelist.c index 36d0aeac725..38a3b482081 100644 --- a/dlls/comctl32/tests/imagelist.c +++ b/dlls/comctl32/tests/imagelist.c @@ -1012,18 +1012,18 @@ static void test_shell_imagelist(void) /* Get system image list */ hr = (pSHGetImageList)(SHIL_LARGE, &IID_IImageList, (void**)&iml); - todo_wine ok(SUCCEEDED(hr), "SHGetImageList failed, hr=%x\n", hr); + ok(SUCCEEDED(hr), "SHGetImageList failed, hr=%x\n", hr); if (hr != S_OK) return; IImageList_GetImageCount(iml, &out); - todo_wine ok(out > 0, "IImageList_GetImageCount returned out <= 0\n"); + ok(out > 0, "IImageList_GetImageCount returned out <= 0\n"); /* right and bottom should be 32x32 for large icons, or 48x48 if larger icons enabled in control panel */ IImageList_GetImageRect(iml, 0, &rect); - todo_wine ok((((rect.right == 32) && (rect.bottom == 32)) || + ok((((rect.right == 32) && (rect.bottom == 32)) || ((rect.right == 48) && (rect.bottom == 48))), "IImageList_GetImageRect returned r:%d,b:%d\n", rect.right, rect.bottom); diff --git a/dlls/shell32/shellord.c b/dlls/shell32/shellord.c index 29b77df4094..7aa3a0c5d41 100644 --- a/dlls/shell32/shellord.c +++ b/dlls/shell32/shellord.c @@ -46,6 +46,7 @@ #include "pidl.h" #include "shlwapi.h" #include "commdlg.h" +#include "commoncontrols.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); WINE_DECLARE_DEBUG_CHANNEL(pidl); @@ -2173,10 +2174,41 @@ void WINAPI SHFlushSFCache(void) { } +/************************************************************************* + * SHGetImageList (SHELL32.727) + * + * Returns a copy of a shell image list. + * + * NOTES + * Windows XP features 4 sizes of image list, and Vista 5. Wine currently + * only supports 2, so requests for the others will currently fail. + */ HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv) { - FIXME("STUB: %i %s\n",iImageList,debugstr_guid(riid)); - return E_NOINTERFACE; + HIMAGELIST hLarge, hSmall; + HIMAGELIST hNew; + HRESULT ret = E_FAIL; + + /* Wine currently only maintains large and small image lists */ + if ((iImageList != SHIL_LARGE) && (iImageList != SHIL_SMALL)) + { + FIXME("Unsupported image list %i requested\n", iImageList); + return E_FAIL; + } + + Shell_GetImageList(&hLarge, &hSmall); + hNew = ImageList_Duplicate(iImageList == SHIL_LARGE ? hLarge : hSmall); + + /* Get the interface for the new image list */ + if (hNew) + { + ret = HIMAGELIST_QueryInterface(hNew, riid, ppv); + + if (!SUCCEEDED(ret)) + ImageList_Destroy(hNew); + } + + return ret; } /*************************************************************************