comctl32/imagelist: Fix return value from IImageList_SetBkColor().

This commit is contained in:
Nikolay Sivov 2010-08-21 19:22:34 +04:00 committed by Alexandre Julliard
parent 1c82b3491a
commit 9b77425f6a
2 changed files with 32 additions and 4 deletions

View File

@ -3458,11 +3458,8 @@ static HRESULT WINAPI ImageListImpl_SetImageCount(IImageList *iface,
static HRESULT WINAPI ImageListImpl_SetBkColor(IImageList *iface, COLORREF clrBk,
COLORREF *pclr)
{
if (!pclr)
return E_FAIL;
*pclr = ImageList_SetBkColor((HIMAGELIST) iface, clrBk);
return *pclr == CLR_NONE ? E_FAIL : S_OK;
return S_OK;
}
static HRESULT WINAPI ImageListImpl_GetBkColor(IImageList *iface, COLORREF *pclr)

View File

@ -1833,6 +1833,36 @@ if (0)
IImageList_Release(imgl);
}
static void test_IImageList_SetBkColor(void)
{
IImageList *imgl;
HIMAGELIST himl;
COLORREF color;
HRESULT hr;
himl = ImageList_Create(16, 16, ILC_COLOR16, 0, 3);
imgl = (IImageList*)himl;
if (0)
{
/* crashes on native */
hr = IImageList_SetBkColor(imgl, RGB(0, 0, 0), NULL);
}
hr = IImageList_SetBkColor(imgl, CLR_NONE, &color);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IImageList_SetBkColor(imgl, CLR_NONE, &color);
ok(hr == S_OK, "got 0x%08x\n", hr);
color = 0xdeadbeef;
hr = IImageList_GetBkColor(imgl, &color);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(color == CLR_NONE, "got %x\n", color);
IImageList_Release(imgl);
}
START_TEST(imagelist)
{
ULONG_PTR ctx_cookie;
@ -1887,6 +1917,7 @@ START_TEST(imagelist)
test_IImageList_Merge();
test_IImageList_Clone();
test_IImageList_GetBkColor();
test_IImageList_SetBkColor();
CoUninitialize();