Commit acbd6320 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/imagelist: Fix return value for IImageList_GetIconSize().

parent 9b77425f
......@@ -3431,7 +3431,7 @@ static HRESULT WINAPI ImageListImpl_GetIconSize(IImageList *iface, int *cx,
{
HIMAGELIST This = (HIMAGELIST) iface;
return ImageList_GetIconSize(This, cx, cy) ? S_OK : E_FAIL;
return ImageList_GetIconSize(This, cx, cy) ? S_OK : E_INVALIDARG;
}
static HRESULT WINAPI ImageListImpl_SetIconSize(IImageList *iface, int cx,
......@@ -3442,9 +3442,6 @@ static HRESULT WINAPI ImageListImpl_SetIconSize(IImageList *iface, int cx,
static HRESULT WINAPI ImageListImpl_GetImageCount(IImageList *iface, int *pi)
{
if (!pi)
return E_FAIL;
*pi = ImageList_GetImageCount((HIMAGELIST) iface);
return S_OK;
}
......
......@@ -1863,6 +1863,52 @@ if (0)
IImageList_Release(imgl);
}
static void test_IImageList_GetImageCount(void)
{
IImageList *imgl;
HIMAGELIST himl;
int count;
HRESULT hr;
himl = ImageList_Create(16, 16, ILC_COLOR16, 0, 3);
imgl = (IImageList*)himl;
if (0)
{
/* crashes on native */
hr = IImageList_GetImageCount(imgl, NULL);
}
count = -1;
hr = IImageList_GetImageCount(imgl, &count);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(count == 0, "got %d\n", count);
IImageList_Release(imgl);
}
static void test_IImageList_GetIconSize(void)
{
IImageList *imgl;
HIMAGELIST himl;
int cx, cy;
HRESULT hr;
himl = ImageList_Create(16, 16, ILC_COLOR16, 0, 3);
imgl = (IImageList*)himl;
hr = IImageList_GetIconSize(imgl, NULL, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
hr = IImageList_GetIconSize(imgl, &cx, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
hr = IImageList_GetIconSize(imgl, NULL, &cy);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
IImageList_Release(imgl);
}
START_TEST(imagelist)
{
ULONG_PTR ctx_cookie;
......@@ -1918,6 +1964,8 @@ START_TEST(imagelist)
test_IImageList_Clone();
test_IImageList_GetBkColor();
test_IImageList_SetBkColor();
test_IImageList_GetImageCount();
test_IImageList_GetIconSize();
CoUninitialize();
......
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