Author: akhaldi
Date: Tue Nov 24 10:38:33 2015
New Revision: 70081
URL:
http://svn.reactos.org/svn/reactos?rev=70081&view=rev
Log:
[COMCTL32_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536
Modified:
trunk/rostests/winetests/comctl32/imagelist.c
trunk/rostests/winetests/comctl32/listview.c
trunk/rostests/winetests/comctl32/misc.c
trunk/rostests/winetests/comctl32/propsheet.c
trunk/rostests/winetests/comctl32/status.c
trunk/rostests/winetests/comctl32/toolbar.c
trunk/rostests/winetests/comctl32/treeview.c
trunk/rostests/winetests/comctl32/v6util.h
Modified: trunk/rostests/winetests/comctl32/imagelist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/imagel…
==============================================================================
--- trunk/rostests/winetests/comctl32/imagelist.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/comctl32/imagelist.c [iso-8859-1] Tue Nov 24 10:38:33 2015
@@ -1258,7 +1258,7 @@
static void test_shell_imagelist(void)
{
- BOOL (WINAPI *pSHGetImageList)(INT, REFIID, void**);
+ HRESULT (WINAPI *pSHGetImageList)(INT, REFIID, void**);
IImageList *iml = NULL;
HMODULE hShell32;
HRESULT hr;
@@ -1278,8 +1278,7 @@
}
/* Get system image list */
- hr = (pSHGetImageList)(SHIL_SYSSMALL, &IID_IImageList, (void**)&iml);
-
+ hr = pSHGetImageList(SHIL_SYSSMALL, &IID_IImageList, (void**)&iml);
ok(SUCCEEDED(hr), "SHGetImageList failed, hr=%x\n", hr);
if (hr != S_OK) {
Modified: trunk/rostests/winetests/comctl32/listview.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/listvi…
==============================================================================
--- trunk/rostests/winetests/comctl32/listview.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/comctl32/listview.c [iso-8859-1] Tue Nov 24 10:38:33 2015
@@ -5345,6 +5345,7 @@
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_ITEMCHANGINGW;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
+ ok(ret == 0, "got %d\n", ret);
parent_header_notify_seq[0].id = HDN_ITEMCHANGINGA;
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq,
"header notify, parent", TRUE);
@@ -5353,6 +5354,7 @@
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_ITEMCHANGEDW;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
+ ok(ret == 0, "got %d\n", ret);
parent_header_notify_seq[0].id = HDN_ITEMCHANGEDA;
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq,
"header notify, parent", TRUE);
@@ -5363,30 +5365,35 @@
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_ITEMCLICKW;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
+ ok(ret == 0, "got %d\n", ret);
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_click_seq,
"header notify, parent", FALSE);
ok(nmhdr.hdr.code == HDN_ITEMCLICKA, "Expected ANSI notification code\n");
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_ITEMDBLCLICKW;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
+ ok(ret == 0, "got %d\n", ret);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
"header notify, parent", FALSE);
ok(nmhdr.hdr.code == HDN_ITEMDBLCLICKW, "Expected Unicode notification
code\n");
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_DIVIDERDBLCLICKW;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
+ ok(ret == 0, "got %d\n", ret);
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_divider_dclick_seq,
"header notify, parent", TRUE);
ok(nmhdr.hdr.code == HDN_DIVIDERDBLCLICKA, "Expected ANSI notification
code\n");
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_BEGINTRACKW;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
+ ok(ret == 0, "got %d\n", ret);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
"header notify, parent", FALSE);
ok(nmhdr.hdr.code == HDN_BEGINTRACKW, "Expected Unicode notification
code\n");
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_ENDTRACKW;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
+ ok(ret == 0, "got %d\n", ret);
parent_header_notify_seq[0].id = HDN_ENDTRACKA;
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq,
"header notify, parent", FALSE);
@@ -5394,6 +5401,7 @@
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_TRACKW;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
+ ok(ret == 0, "got %d\n", ret);
parent_header_notify_seq[0].id = HDN_TRACKA;
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq,
"header notify, parent", FALSE);
@@ -5401,17 +5409,20 @@
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_BEGINDRAG;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
+ ok(ret == 1, "got %d\n", ret);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
"header notify, parent", FALSE);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_ENDDRAG;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
+ ok(ret == 0, "got %d\n", ret);
parent_header_notify_seq[0].id = HDN_ENDDRAG;
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq,
"header notify, parent", FALSE);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_FILTERCHANGE;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
+ ok(ret == 0, "got %d\n", ret);
parent_header_notify_seq[0].id = HDN_FILTERCHANGE;
parent_header_notify_seq[0].flags |= optional; /* NT4 does not send this message */
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq,
@@ -5420,21 +5431,25 @@
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_BEGINFILTEREDIT;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
+ ok(ret == 0, "got %d\n", ret);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
"header notify, parent", FALSE);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_ENDFILTEREDIT;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
+ ok(ret == 0, "got %d\n", ret);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
"header notify, parent", FALSE);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_ITEMSTATEICONCLICK;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
+ ok(ret == 0, "got %d\n", ret);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
"header notify, parent", FALSE);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_ITEMKEYDOWN;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
+ ok(ret == 0, "got %d\n", ret);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
"header notify, parent", FALSE);
@@ -5745,6 +5760,76 @@
ok(proc1 == proc2, "got %p, expected %p\n", proc1, proc2);
DestroyWindow(hdr);
+ DestroyWindow(hwnd);
+}
+
+static void flush_events(void)
+{
+ MSG msg;
+ int diff = 200;
+ int min_timeout = 100;
+ DWORD time = GetTickCount() + diff;
+
+ while (diff > 0)
+ {
+ if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) ==
WAIT_TIMEOUT) break;
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg
);
+ diff = time - GetTickCount();
+ }
+}
+
+static void test_oneclickactivate(void)
+{
+ TRACKMOUSEEVENT track;
+ char item1[] = "item1";
+ LVITEMA item;
+ HWND hwnd, fg;
+ RECT rect;
+ INT r;
+
+ hwnd = CreateWindowExA(0, "SysListView32", "foo",
WS_VISIBLE|WS_CHILD|LVS_LIST,
+ 10, 10, 100, 200, hwndparent, NULL, NULL, NULL);
+ ok(hwnd != NULL, "failed to create listview window\n");
+ r = SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_ONECLICKACTIVATE);
+ ok(r == 0, "should return zero\n");
+
+ SetForegroundWindow(hwndparent);
+ flush_events();
+ fg = GetForegroundWindow();
+ if (fg != hwndparent)
+ {
+ skip("Window is not in the foreground. Skipping oneclickactivate
tests.\n");
+ DestroyWindow(hwnd);
+ return;
+ }
+
+ item.mask = LVIF_TEXT;
+ item.iItem = 0;
+ item.iSubItem = 0;
+ item.iImage = 0;
+ item.pszText = item1;
+ r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item);
+ ok(r == 0, "should not fail\n");
+
+ GetWindowRect(hwnd, &rect);
+ SetCursorPos(rect.left+5, rect.top+5);
+ flush_events();
+ r = SendMessageA(hwnd, WM_MOUSEMOVE, MAKELONG(1, 1), 0);
+ expect(0, r);
+
+ track.cbSize = sizeof(track);
+ track.dwFlags = TME_QUERY;
+ _TrackMouseEvent(&track);
+ ok(track.hwndTrack == hwnd, "hwndTrack != hwnd\n");
+ ok(track.dwFlags == TME_LEAVE, "dwFlags = %x\n", track.dwFlags);
+
+ r = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
+ expect(0, r);
+ r = SendMessageA(hwnd, WM_MOUSEHOVER, MAKELONG(1, 1), 0);
+ expect(0, r);
+ r = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
+ expect(1, r);
+
DestroyWindow(hwnd);
}
@@ -5817,6 +5902,7 @@
test_deleteitem();
test_insertitem();
test_header_proc();
+ test_oneclickactivate();
if (!load_v6_module(&ctx_cookie, &hCtx))
{
Modified: trunk/rostests/winetests/comctl32/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/misc.c…
==============================================================================
--- trunk/rostests/winetests/comctl32/misc.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/comctl32/misc.c [iso-8859-1] Tue Nov 24 10:38:33 2015
@@ -37,9 +37,19 @@
static INT (WINAPI * pStr_GetPtrW)(LPCWSTR, LPWSTR, INT);
static BOOL (WINAPI * pStr_SetPtrW)(LPWSTR, LPCWSTR);
-static HRESULT (WINAPI * LoadIconMetric)(HINSTANCE, PCWSTR, INT, HICON*);
-
static HMODULE hComctl32 = 0;
+
+static char testicon_data[] =
+{
+ 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x00,
+ 0x20, 0x00, 0x40, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x28, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x12, 0x0b,
+ 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xde, 0xde, 0xde, 0xff, 0xde, 0xde, 0xde, 0xff, 0xde, 0xde,
+ 0xde, 0xff, 0xde, 0xde, 0xde, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00
+};
#define COMCTL32_GET_PROC(ordinal, func) \
p ## func = (void*)GetProcAddress(hComctl32, (LPSTR)ordinal); \
@@ -215,90 +225,148 @@
ok(ptr == ptr2, "got wrong pointer for ordinal 345, %p expected %p\n",
ptr2, ptr);
}
-static void test_LoadIconMetric(void)
-{
- static const WCHAR nonExistingFile[] =
{'d','o','e','s','n','o','t','e','x','i','s','t','.','i','c','o','\0'};
- HINSTANCE hinst;
+static void test_LoadIconWithScaleDown(void)
+{
+ static const WCHAR nonexisting_fileW[] =
{'n','o','n','e','x','i','s','t','i','n','g','.','i','c','o',0};
+ static const WCHAR nonexisting_resourceW[] =
{'N','o','n','e','x','i','s','t','i','n','g',0};
+ static const WCHAR prefixW[] = {'I','C','O',0};
+ HRESULT (WINAPI *pLoadIconMetric)(HINSTANCE, const WCHAR *, int, HICON *);
+ HRESULT (WINAPI *pLoadIconWithScaleDown)(HINSTANCE, const WCHAR *, int, int, HICON
*);
+ WCHAR tmp_path[MAX_PATH], icon_path[MAX_PATH];
+ ICONINFO info;
+ HMODULE hinst;
+ HANDLE handle;
+ DWORD written;
+ HRESULT hr;
+ BITMAP bmp;
+ HICON icon;
void *ptr;
- HICON icon;
- HRESULT result;
- ICONINFO info;
+ int bytes;
BOOL res;
- INT bytes;
- BITMAP bmp;
hinst = LoadLibraryA("comctl32.dll");
-
- LoadIconMetric = (void *)GetProcAddress(hinst, "LoadIconMetric");
- if (!LoadIconMetric)
+ pLoadIconMetric = (void *)GetProcAddress(hinst, "LoadIconMetric");
+ pLoadIconWithScaleDown = (void *)GetProcAddress(hinst,
"LoadIconWithScaleDown");
+ if (!pLoadIconMetric || !pLoadIconWithScaleDown)
{
#ifdef __REACTOS__
- /* Skipped on 2k3 */
- skip("TaskDialogIndirect not exported by name\n");
+ skip("LoadIconMetric or pLoadIconWithScaleDown not exported by
name\n");
#else
- win_skip("LoadIconMetric not exported by name\n");
+ win_skip("LoadIconMetric or pLoadIconWithScaleDown not exported by
name\n");
#endif
+ FreeLibrary(hinst);
return;
}
- ptr = GetProcAddress(hinst, (const CHAR*)380);
- ok(ptr == LoadIconMetric, "got wrong pointer for ordinal 380, %p expected
%p\n",
- ptr, LoadIconMetric);
-
- result = LoadIconMetric(NULL, (PCWSTR)IDI_APPLICATION, LIM_SMALL, &icon);
- ok(result == S_OK, "Expected S_OK, got %x\n", result);
- if (result == S_OK)
- {
- res = GetIconInfo(icon, &info);
- ok(res, "Failed to get icon info\n");
- if (res && info.hbmColor)
- {
- bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp);
- ok(bytes > 0, "Failed to get bitmap info for icon\n");
- if (bytes > 0)
- {
- ok(bmp.bmWidth == GetSystemMetrics( SM_CXSMICON ), "Wrong icon
width\n");
- ok(bmp.bmHeight == GetSystemMetrics( SM_CYSMICON ), "Wrong icon
height\n");
- }
- }
- DestroyIcon(icon);
- }
-
- result = LoadIconMetric(NULL, (PCWSTR)IDI_APPLICATION, LIM_LARGE, &icon);
- ok(result == S_OK, "Expected S_OK, got %x\n", result);
- if (result == S_OK)
- {
- res = GetIconInfo(icon, &info);
- ok(res, "Failed to get icon info\n");
- if (res && info.hbmColor)
- {
- bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp);
- ok(bytes > 0, "Failed to get bitmap info for icon\n");
- if (bytes > 0)
- {
- ok(bmp.bmWidth == GetSystemMetrics( SM_CXICON ), "Wrong icon
width\n");
- ok(bmp.bmHeight == GetSystemMetrics( SM_CYICON ), "Wrong icon
height\n");
- }
- }
- DestroyIcon(icon);
- }
-
- result = LoadIconMetric(NULL, (PCWSTR)IDI_APPLICATION, 0x100, &icon);
- ok(result == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", result);
- if (result == S_OK) DestroyIcon(icon);
-
+ GetTempPathW(MAX_PATH, tmp_path);
+ GetTempFileNameW(tmp_path, prefixW, 0, icon_path);
+ handle = CreateFileW(icon_path, GENERIC_READ | GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+ ok(handle != INVALID_HANDLE_VALUE, "CreateFileW failed with error %u\n",
GetLastError());
+ res = WriteFile(handle, testicon_data, sizeof(testicon_data), &written, NULL);
+ ok(res && written == sizeof(testicon_data), "Failed to write icon
file\n");
+ CloseHandle(handle);
+
+ /* test ordinals */
+ ptr = GetProcAddress(hinst, (const char *)380);
+ ok(ptr == pLoadIconMetric,
+ "got wrong pointer for ordinal 380, %p expected %p\n", ptr,
pLoadIconMetric);
+
+ ptr = GetProcAddress(hinst, (const char *)381);
+ ok(ptr == pLoadIconWithScaleDown,
+ "got wrong pointer for ordinal 381, %p expected %p\n", ptr,
pLoadIconWithScaleDown);
+
+ /* invalid arguments */
icon = (HICON)0x1234;
- result = LoadIconMetric(NULL, NULL, LIM_LARGE, &icon);
- ok(result == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", result);
- ok(icon == (HICON)0, "Expected 0x0, got %p\n", icon);
- if (result == S_OK) DestroyIcon(icon);
-
- result = LoadIconMetric(NULL, nonExistingFile, LIM_LARGE, &icon);
- ok(result == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND),
- "Expected 80070715, got %x\n", result);
- if (result == S_OK) DestroyIcon(icon);
-}
-
+ hr = pLoadIconMetric(NULL, (LPWSTR)IDI_APPLICATION, 0x100, &icon);
+ ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", hr);
+ ok(icon == NULL, "Expected NULL, got %p\n", icon);
+
+ icon = (HICON)0x1234;
+ hr = pLoadIconMetric(NULL, NULL, LIM_LARGE, &icon);
+ ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", hr);
+ ok(icon == NULL, "Expected NULL, got %p\n", icon);
+
+ icon = (HICON)0x1234;
+ hr = pLoadIconWithScaleDown(NULL, NULL, 32, 32, &icon);
+ ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", hr);
+ ok(icon == NULL, "Expected NULL, got %p\n", icon);
+
+ /* non-existing filename */
+ hr = pLoadIconMetric(NULL, nonexisting_fileW, LIM_LARGE, &icon);
+ todo_wine
+ ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND),
+ "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n",
hr);
+
+ hr = pLoadIconWithScaleDown(NULL, nonexisting_fileW, 32, 32, &icon);
+ todo_wine
+ ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND),
+ "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n",
hr);
+
+ /* non-existing resource name */
+ hr = pLoadIconMetric(hinst, nonexisting_resourceW, LIM_LARGE, &icon);
+ ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND),
+ "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n",
hr);
+
+ hr = pLoadIconWithScaleDown(hinst, nonexisting_resourceW, 32, 32, &icon);
+ ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND),
+ "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n",
hr);
+
+ /* load icon using predefined identifier */
+ hr = pLoadIconMetric(NULL, (LPWSTR)IDI_APPLICATION, LIM_SMALL, &icon);
+ ok(hr == S_OK, "Expected S_OK, got %x\n", hr);
+ res = GetIconInfo(icon, &info);
+ ok(res, "Failed to get icon info, error %u\n", GetLastError());
+ bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp);
+ ok(bytes > 0, "Failed to get bitmap info for icon\n");
+ ok(bmp.bmWidth == GetSystemMetrics(SM_CXSMICON), "Wrong icon width %d\n",
bmp.bmWidth);
+ ok(bmp.bmHeight == GetSystemMetrics(SM_CYSMICON), "Wrong icon height %d\n",
bmp.bmHeight);
+ DestroyIcon(icon);
+
+ hr = pLoadIconMetric(NULL, (LPWSTR)IDI_APPLICATION, LIM_LARGE, &icon);
+ ok(hr == S_OK, "Expected S_OK, got %x\n", hr);
+ res = GetIconInfo(icon, &info);
+ ok(res, "Failed to get icon info, error %u\n", GetLastError());
+ bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp);
+ ok(bytes > 0, "Failed to get bitmap info for icon\n");
+ ok(bmp.bmWidth == GetSystemMetrics(SM_CXICON), "Wrong icon width %d\n",
bmp.bmWidth);
+ ok(bmp.bmHeight == GetSystemMetrics(SM_CYICON), "Wrong icon height %d\n",
bmp.bmHeight);
+ DestroyIcon(icon);
+
+ hr = pLoadIconWithScaleDown(NULL, (LPWSTR)IDI_APPLICATION, 42, 42, &icon);
+ ok(hr == S_OK, "Expected S_OK, got %x\n", hr);
+ res = GetIconInfo(icon, &info);
+ ok(res, "Failed to get icon info, error %u\n", GetLastError());
+ bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp);
+ ok(bytes > 0, "Failed to get bitmap info for icon\n");
+ ok(bmp.bmWidth == 42, "Wrong icon width %d\n", bmp.bmWidth);
+ ok(bmp.bmHeight == 42, "Wrong icon height %d\n", bmp.bmHeight);
+ DestroyIcon(icon);
+
+ /* load icon from file */
+ hr = pLoadIconMetric(NULL, icon_path, LIM_SMALL, &icon);
+ ok(hr == S_OK, "Expected S_OK, got %x\n", hr);
+ res = GetIconInfo(icon, &info);
+ ok(res, "Failed to get icon info, error %u\n", GetLastError());
+ bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp);
+ ok(bytes > 0, "Failed to get bitmap info for icon\n");
+ ok(bmp.bmWidth == GetSystemMetrics(SM_CXSMICON), "Wrong icon width %d\n",
bmp.bmWidth);
+ ok(bmp.bmHeight == GetSystemMetrics(SM_CYSMICON), "Wrong icon height %d\n",
bmp.bmHeight);
+ DestroyIcon(icon);
+
+ hr = pLoadIconWithScaleDown(NULL, icon_path, 42, 42, &icon);
+ ok(hr == S_OK, "Expected S_OK, got %x\n", hr);
+ res = GetIconInfo(icon, &info);
+ ok(res, "Failed to get icon info, error %u\n", GetLastError());
+ bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp);
+ ok(bytes > 0, "Failed to get bitmap info for icon\n");
+ ok(bmp.bmWidth == 42, "Wrong icon width %d\n", bmp.bmWidth);
+ ok(bmp.bmHeight == 42, "Wrong icon height %d\n", bmp.bmHeight);
+ DestroyIcon(icon);
+
+ DeleteFileW(icon_path);
+ FreeLibrary(hinst);
+}
START_TEST(misc)
{
@@ -315,7 +383,7 @@
return;
test_TaskDialogIndirect();
- test_LoadIconMetric();
+ test_LoadIconWithScaleDown();
unload_v6_module(ctx_cookie, hCtx);
}
Modified: trunk/rostests/winetests/comctl32/propsheet.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/propsh…
==============================================================================
--- trunk/rostests/winetests/comctl32/propsheet.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/comctl32/propsheet.c [iso-8859-1] Tue Nov 24 10:38:33 2015
@@ -303,7 +303,7 @@
CBT_CREATEWNDW *c = (CBT_CREATEWNDW *)lp;
/* The first dialog created will be the parent dialog */
- if (!done && c->lpcs->lpszClass == MAKEINTRESOURCEW(WC_DIALOG))
+ if (!done && c->lpcs->lpszClass == (LPWSTR)WC_DIALOG)
{
old_nav_dialog_proc = (WNDPROC)SetWindowLongPtrW( (HWND)wp, GWLP_WNDPROC,
(LONG_PTR)new_nav_dialog_proc );
done = TRUE;
@@ -809,7 +809,7 @@
psp.pfnDlgProc = page_dlg_proc_messages;
psp.lParam = 0;
- /* two page with the same data */
+ /* multiple pages with the same data */
hpsp[0] = CreatePropertySheetPageA(&psp);
hpsp[1] = CreatePropertySheetPageA(&psp);
hpsp[2] = CreatePropertySheetPageA(&psp);
@@ -872,6 +872,100 @@
/* test PSP_PREMATURE flag with incorrect property sheet page */
ret = SendMessageA(hdlg, PSM_ADDPAGE, 0, (LPARAM)hpsp[4]);
+ ok(ret == FALSE, "got %d\n", ret);
+
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
+ ok(r == 3, "got %d\n", r);
+
+ DestroyPropertySheetPage(hpsp[4]);
+ DestroyWindow(hdlg);
+}
+
+static void test_PSM_INSERTPAGE(void)
+{
+ HPROPSHEETPAGE hpsp[5];
+ PROPSHEETPAGEA psp;
+ PROPSHEETHEADERA psh;
+ HWND hdlg, tab;
+ BOOL ret;
+ DWORD r;
+
+ memset(&psp, 0, sizeof(psp));
+ psp.dwSize = sizeof(psp);
+ psp.dwFlags = 0;
+ psp.hInstance = GetModuleHandleA(NULL);
+ U(psp).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_MESSAGE_TEST);
+ U2(psp).pszIcon = NULL;
+ psp.pfnDlgProc = page_dlg_proc_messages;
+ psp.lParam = 0;
+
+ /* multiple pages with the same data */
+ hpsp[0] = CreatePropertySheetPageA(&psp);
+ hpsp[1] = CreatePropertySheetPageA(&psp);
+ hpsp[2] = CreatePropertySheetPageA(&psp);
+
+ U(psp).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_ERROR);
+ hpsp[3] = CreatePropertySheetPageA(&psp);
+
+ psp.dwFlags = PSP_PREMATURE;
+ hpsp[4] = CreatePropertySheetPageA(&psp);
+
+ memset(&psh, 0, sizeof(psh));
+ psh.dwSize = PROPSHEETHEADERA_V1_SIZE;
+ psh.dwFlags = PSH_MODELESS;
+ psh.pszCaption = "test caption";
+ psh.nPages = 1;
+ psh.hwndParent = GetDesktopWindow();
+ U3(psh).phpage = hpsp;
+
+ hdlg = (HWND)PropertySheetA(&psh);
+ ok(hdlg != INVALID_HANDLE_VALUE, "got invalid handle %p\n", hdlg);
+
+ /* add pages one by one */
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 5, (LPARAM)hpsp[1]);
+ ok(ret == TRUE, "got %d\n", ret);
+
+ /* try with invalid values */
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, 0);
+ ok(ret == FALSE, "got %d\n", ret);
+
+if (0)
+{
+ /* crashes on native */
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, (LPARAM)INVALID_HANDLE_VALUE);
+}
+
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, (LPARAM)INVALID_HANDLE_VALUE,
(LPARAM)hpsp[2]);
+ ok(ret == FALSE, "got %d\n", ret);
+
+ /* check item count */
+ tab = (HWND)SendMessageA(hdlg, PSM_GETTABCONTROL, 0, 0);
+
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
+ ok(r == 2, "got %d\n", r);
+
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, (WPARAM)hpsp[1], (LPARAM)hpsp[2]);
+ ok(ret == TRUE, "got %d\n", ret);
+
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
+ ok(r == 3, "got %d\n", r);
+
+ /* add property sheet page that can't be created */
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 1, (LPARAM)hpsp[3]);
+ ok(ret == TRUE, "got %d\n", ret);
+
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
+ ok(r == 4, "got %d\n", r);
+
+ /* select page that can't be created */
+ ret = SendMessageA(hdlg, PSM_SETCURSEL, 1, 0);
+ ok(ret == TRUE, "got %d\n", ret);
+
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
+ ok(r == 3, "got %d\n", r);
+
+ /* test PSP_PREMATURE flag with incorrect property sheet page */
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, (LPARAM)hpsp[4]);
ok(ret == FALSE, "got %d\n", ret);
r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
@@ -891,4 +985,5 @@
test_custom_default_button();
test_messages();
test_PSM_ADDPAGE();
-}
+ test_PSM_INSERTPAGE();
+}
Modified: trunk/rostests/winetests/comctl32/status.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/status…
==============================================================================
--- trunk/rostests/winetests/comctl32/status.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/comctl32/status.c [iso-8859-1] Tue Nov 24 10:38:33 2015
@@ -346,6 +346,7 @@
r = SendMessageA(hWndStatus, SB_SETTEXTA, 0, (LPARAM)chstr);
expect(TRUE,r);
r = SendMessageA(hWndStatus, SB_GETTEXTA, 0, (LPARAM)charArray);
+ ok(r == strlen(charArray), "got %d\n", r);
/* substitution with single space */
if (ch > 0x00 && ch < 0x20 && ch != '\t')
chstr[5] = ' ';
Modified: trunk/rostests/winetests/comctl32/toolbar.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/toolba…
==============================================================================
--- trunk/rostests/winetests/comctl32/toolbar.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/comctl32/toolbar.c [iso-8859-1] Tue Nov 24 10:38:33 2015
@@ -1536,7 +1536,6 @@
/* Single non-BTNS_AUTOSIZE button with string with TBSTYLE_EX_MIXEDBUTTONS set. */
rebuild_toolbar(&hToolbar);
SendMessageA(hToolbar, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS);
- style = SendMessageA(hToolbar, TB_GETSTYLE, 0, 0);
ok(SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons4[1]) == 1,
"TB_ADDBUTTONSA failed\n");
ok(SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(40, 20)) == 1,
"TB_SETBUTTONSIZE failed\n");
SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0 );
@@ -1545,7 +1544,6 @@
/* Single non-BTNS_AUTOSIZE, BTNS_SHOWTEXT button with string with
TBSTYLE_EX_MIXEDBUTTONS set. */
rebuild_toolbar(&hToolbar);
SendMessageA(hToolbar, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS);
- style = SendMessageA(hToolbar, TB_GETSTYLE, 0, 0);
ok(SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons4[2]) == 1,
"TB_ADDBUTTONSA failed\n");
ok(SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(40, 20)) == 1,
"TB_SETBUTTONSIZE failed\n");
SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0 );
Modified: trunk/rostests/winetests/comctl32/treeview.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/treevi…
==============================================================================
--- trunk/rostests/winetests/comctl32/treeview.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/comctl32/treeview.c [iso-8859-1] Tue Nov 24 10:38:33 2015
@@ -904,6 +904,13 @@
ret = SendMessageA(hTree2, TVM_GETITEMA, 0, (LPARAM)&tviRoot);
expect(TRUE, ret);
ok(tviRoot.state == TVIS_FOCUSED, "got state 0x%0x\n", tviRoot.state);
+
+ /* invalid item pointer, nt4 crashes here but later versions just return 0 */
+ tviRoot.hItem = (HTREEITEM)0xdeadbeef;
+ tviRoot.mask = TVIF_STATE;
+ tviRoot.state = 0;
+ ret = SendMessageA(hTree2, TVM_GETITEMA, 0, (LPARAM)&tviRoot);
+ expect(FALSE, ret);
DestroyWindow(hTree);
DestroyWindow(hTree2);
Modified: trunk/rostests/winetests/comctl32/v6util.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/v6util…
==============================================================================
--- trunk/rostests/winetests/comctl32/v6util.h [iso-8859-1] (original)
+++ trunk/rostests/winetests/comctl32/v6util.h [iso-8859-1] Tue Nov 24 10:38:33 2015
@@ -26,6 +26,10 @@
#define ARCH "x86"
#elif defined __x86_64__
#define ARCH "amd64"
+#elif defined __arm__
+#define ARCH "arm"
+#elif defined __aarch64__
+#define ARCH "arm64"
#else
#define ARCH "none"
#endif