shell32: Implement SHGetImageList and remove todo_wine from imagelist tests.

This commit is contained in:
Owen Rudge 2009-11-16 13:27:32 -06:00 committed by Alexandre Julliard
parent c0a6c5cd3f
commit 9db87f13d3
2 changed files with 37 additions and 5 deletions

View File

@ -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);

View File

@ -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;
}
/*************************************************************************