Commit 9db87f13 authored by Owen Rudge's avatar Owen Rudge Committed by Alexandre Julliard

shell32: Implement SHGetImageList and remove todo_wine from imagelist tests.

parent c0a6c5cd
...@@ -1012,18 +1012,18 @@ static void test_shell_imagelist(void) ...@@ -1012,18 +1012,18 @@ static void test_shell_imagelist(void)
/* Get system image list */ /* Get system image list */
hr = (pSHGetImageList)(SHIL_LARGE, &IID_IImageList, (void**)&iml); 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) if (hr != S_OK)
return; return;
IImageList_GetImageCount(iml, &out); 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 /* right and bottom should be 32x32 for large icons, or 48x48 if larger
icons enabled in control panel */ icons enabled in control panel */
IImageList_GetImageRect(iml, 0, &rect); 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))), ((rect.right == 48) && (rect.bottom == 48))),
"IImageList_GetImageRect returned r:%d,b:%d\n", "IImageList_GetImageRect returned r:%d,b:%d\n",
rect.right, rect.bottom); rect.right, rect.bottom);
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include "pidl.h" #include "pidl.h"
#include "shlwapi.h" #include "shlwapi.h"
#include "commdlg.h" #include "commdlg.h"
#include "commoncontrols.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell); WINE_DEFAULT_DEBUG_CHANNEL(shell);
WINE_DECLARE_DEBUG_CHANNEL(pidl); WINE_DECLARE_DEBUG_CHANNEL(pidl);
...@@ -2173,10 +2174,41 @@ void WINAPI SHFlushSFCache(void) ...@@ -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) HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
{ {
FIXME("STUB: %i %s\n",iImageList,debugstr_guid(riid)); HIMAGELIST hLarge, hSmall;
return E_NOINTERFACE; 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;
} }
/************************************************************************* /*************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment