Module: wine
Branch: master
Commit: 5ce3af5b37b3e4cc3461f4e4daff41599feb8167
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5ce3af5b37b3e4cc3461f4e4d…
Author: Owen Rudge <orudge(a)codeweavers.com>
Date: Wed Nov 18 15:35:07 2009 -0600
comctl32/tests: Use SHIL_SYSSMALL instead of LARGE, and compare with system metrics.
This patch fixes a test failure if a user has a non-standard icon size
set. Windows 7, for instance, offers more variation than previous
versions of Windows in icon scaling. We should get the system icon
metric and compare our icon size against that.
---
dlls/comctl32/tests/imagelist.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/dlls/comctl32/tests/imagelist.c b/dlls/comctl32/tests/imagelist.c
index ef5034c..22286d3 100644
--- a/dlls/comctl32/tests/imagelist.c
+++ b/dlls/comctl32/tests/imagelist.c
@@ -998,6 +998,7 @@ static void test_shell_imagelist(void)
HRESULT hr;
int out = 0;
RECT rect;
+ int cx, cy;
/* Try to load function from shell32 */
hShell32 = LoadLibrary("shell32.dll");
@@ -1010,7 +1011,7 @@ static void test_shell_imagelist(void)
}
/* Get system image list */
- hr = (pSHGetImageList)(SHIL_LARGE, &IID_IImageList, (void**)&iml);
+ hr = (pSHGetImageList)(SHIL_SYSSMALL, &IID_IImageList, (void**)&iml);
ok(SUCCEEDED(hr), "SHGetImageList failed, hr=%x\n", hr);
@@ -1020,11 +1021,13 @@ static void test_shell_imagelist(void)
IImageList_GetImageCount(iml, &out);
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 */
+ /* Fetch the small icon size */
+ cx = GetSystemMetrics(SM_CXSMICON);
+ cy = GetSystemMetrics(SM_CYSMICON);
+
+ /* Check icon size matches */
IImageList_GetImageRect(iml, 0, &rect);
- ok((((rect.right == 32) && (rect.bottom == 32)) ||
- ((rect.right == 48) && (rect.bottom == 48))),
+ ok(((rect.right == cx) && (rect.bottom == cy)),
"IImageList_GetImageRect returned r:%d,b:%d\n",
rect.right, rect.bottom);
Module: wine
Branch: master
Commit: 8d93b9cee893b99d5bff2ea73602e33edc86023e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8d93b9cee893b99d5bff2ea73…
Author: Owen Rudge <orudge(a)codeweavers.com>
Date: Wed Nov 18 15:33:36 2009 -0600
shell32: Implement support for SHIL_SYSSMALL in SHGetImageList.
---
dlls/shell32/shellord.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/shell32/shellord.c b/dlls/shell32/shellord.c
index be601a1..940633e 100644
--- a/dlls/shell32/shellord.c
+++ b/dlls/shell32/shellord.c
@@ -2181,7 +2181,8 @@ void WINAPI SHFlushSFCache(void)
*
* 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.
+ * only supports the traditional small and large image lists, so requests
+ * for the others will currently fail.
*/
HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
{
@@ -2190,7 +2191,7 @@ HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
HRESULT ret = E_FAIL;
/* Wine currently only maintains large and small image lists */
- if ((iImageList != SHIL_LARGE) && (iImageList != SHIL_SMALL))
+ if ((iImageList != SHIL_LARGE) && (iImageList != SHIL_SMALL) && (iImageList != SHIL_SYSSMALL))
{
FIXME("Unsupported image list %i requested\n", iImageList);
return E_FAIL;