comctl32/imagelist: Make IImageList_Merge() crash like it does on native.
This commit is contained in:
parent
84a6598290
commit
eb2aae669c
|
@ -3365,15 +3365,14 @@ static HRESULT WINAPI ImageListImpl_Copy(IImageList *iface, int iDst,
|
|||
}
|
||||
|
||||
static HRESULT WINAPI ImageListImpl_Merge(IImageList *iface, int i1,
|
||||
IUnknown *punk2, int i2, int dx, int dy, REFIID riid, PVOID *ppv)
|
||||
IUnknown *punk2, int i2, int dx, int dy, REFIID riid, void **ppv)
|
||||
{
|
||||
HIMAGELIST This = (HIMAGELIST) iface;
|
||||
IImageList *iml2 = NULL;
|
||||
HIMAGELIST hNew;
|
||||
HRESULT ret = E_FAIL;
|
||||
|
||||
if (!punk2 || !ppv)
|
||||
return E_FAIL;
|
||||
TRACE("(%p)->(%d %p %d %d %d %s %p)\n", iface, i1, punk2, i2, dx, dy, debugstr_guid(riid), ppv);
|
||||
|
||||
/* TODO: Add test for IID_ImageList2 too */
|
||||
if (FAILED(IImageList_QueryInterface(punk2, &IID_IImageList,
|
||||
|
|
|
@ -1674,6 +1674,13 @@ static void test_IImageList_Merge(void)
|
|||
ret = -1;
|
||||
ok( IImageList_ReplaceIcon(imgl2, -1, hicon1, &ret) == S_OK && (ret == 0),"add icon1 to himl2 failed\n");
|
||||
|
||||
if (0)
|
||||
{
|
||||
/* null cases that crash on native */
|
||||
hr = IImageList_Merge(imgl1, -1, NULL, 0, 0, 0, &IID_IImageList, (void**)&merge);
|
||||
hr = IImageList_Merge(imgl1, -1, (IUnknown*) imgl2, 0, 0, 0, &IID_IImageList, NULL);
|
||||
}
|
||||
|
||||
/* If himl1 has no images, merge still succeeds */
|
||||
hr = IImageList_Merge(imgl1, -1, (IUnknown *) imgl2, 0, 0, 0, &IID_IImageList, (void **) &merge);
|
||||
ok(hr == S_OK, "merge himl1,-1 failed\n");
|
||||
|
|
Loading…
Reference in New Issue