Re: [try 2] Test for window messages of a property sheet with custom dialog proc (bug 12104)
Am Donnerstag 11 November 2010 schrieben Sie: On 11/06/2010 11:16 AM, Bernhard Übelacker wrote: Hello, this patch checks for correct arrival of messages to a subclassed property page. For this bug http://bugs.winehq.org/show_bug.cgi?id=12104 specifically the first WM_SIZE message is interesting which is not sent in wine. I have changed the patch based on the feedback I got on my first mail. (http://www.winehq.org/pipermail/wine-devel/2010-October/087474.html) Now I am using the msg.h facilities for checking the messages. Kind regards, Bernhard Hi, Ever since this patch the shell32:shlexec tests fail on NT4 and W2K: http://test.winehq.org/data/tests/shell32:shlexec.html I can reproduce easily by running (on a clean Windows box): winetest-latest.exe comctl32:propsheet shell32:shlexec This will throw some error dialog boxes and I'm also unable to double-click items in the Windows Explorer. Thoughts/Ideas/Suggestions? Hello, I can also reproduce this on a nt4 virtualbox. When running an older winetest-latest from 2010-11-05 [1] then there is already a crash in explorer.exe happening. When running a winetest-latest from 2010-11-08 [2] there is this crash also but then winetest-shell sleeps some time. After this for example a double click on my computer does not open an explorer window. When I run both tests as single files from a make crosstest I was not able to reproduce neither the explorer crash or the explorer windows not opening. Can someone provide some pointers how the winetest-latest.exe at the testbot is built? [1] http://testbot.winehq.org/JobDetails.pl?Key=6831#k104 [2] http://testbot.winehq.org/JobDetails.pl?Key=6895#k104 Kind regards, Bernhard
Re: [try 2] Test for window messages of a property sheet with custom dialog proc (bug 12104)
On 11/13/2010 10:59 AM, Bernhard Übelacker wrote: When I run both tests as single files from a make crosstest I was not able to reproduce neither the explorer crash or the explorer windows not opening. I didn't see a crash but maybe this is because I'm testing on W2K. I can still reliably get the double-clicking out of order when just running the cross-compiled comctl32 tests ('make crosstest' on my own box). There is also something 'fundamentally' wrong with the tests: +hdlg = (HWND)PropertySheetA(psh); +if (hdlg == INVALID_HANDLE_VALUE) +{ +win_skip(comctl32 4.70 needs dwSize adjustment\n); +psh.dwSize = sizeof(psh) - sizeof(HBITMAP) - sizeof(HPALETTE) - sizeof(HBITMAP); +hdlg = (HWND)PropertySheetA(psh); +} +ShowWindow(hdlg,SW_NORMAL); + +ok_sequence(sequences, PROPSHEET_SEQ_INDEX, property_sheet_seq, property sheet with custom window proc, TRUE); + +DestroyWindow(hdlg); The PropertySheet call will create a modal (not a modeless) property sheet and thus the return value is not a handle (see also MSDN). You can easily check by adding some traces (see http://testbot.winehq.org/JobDetails.pl?Key=7013). hdlg is always 0 and destroying the window will give you an error ERROR_INVALID_WINDOW_HANDLE. Will investigate further but any help is welcome. -- Cheers, Paul.
Re: [try 2] Test for window messages of a property sheet with custom dialog proc (bug 12104)
On 11/06/2010 11:16 AM, Bernhard Übelacker wrote: Hello, this patch checks for correct arrival of messages to a subclassed property page. For this bug http://bugs.winehq.org/show_bug.cgi?id=12104 specifically the first WM_SIZE message is interesting which is not sent in wine. I have changed the patch based on the feedback I got on my first mail. (http://www.winehq.org/pipermail/wine-devel/2010-October/087474.html) Now I am using the msg.h facilities for checking the messages. Kind regards, Bernhard Hi, Ever since this patch the shell32:shlexec tests fail on NT4 and W2K: http://test.winehq.org/data/tests/shell32:shlexec.html I can reproduce easily by running (on a clean Windows box): winetest-latest.exe comctl32:propsheet shell32:shlexec This will throw some error dialog boxes and I'm also unable to double-click items in the Windows Explorer. Thoughts/Ideas/Suggestions? -- Cheers, Paul.
Test for window messages of a property sheet with custom dialog proc (bug 12104)
Hello, the attached patch consists of a test case for following bug: http://bugs.winehq.org/show_bug.cgi?id=12104 This test shows how cygwin's setup checks if a WM_SIZE message was received (by the custom window proc). In wine only the property page gets such a message - not the sheet. If I got it right, tests which would fail in wine are prefixed with todo_wine? I want to ask if this patch looks right for inclusion and if the location (dlls/comctl32/tests/) is right? Kind regards, Bernhard From e89af2359528a559deec7cc35cbc017ab977f079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20=C3=9Cbelacker?= bernha...@vr-web.de Date: Sun, 24 Oct 2010 13:17:01 +0200 Subject: Test for window messages of a property sheet with custom dialog proc. (As seen in bug 12104 - Cygwin's setup.exe doesn't resize properly) --- dlls/comctl32/tests/propsheet.c | 122 +++ dlls/comctl32/tests/resources.h |1 + dlls/comctl32/tests/rsrc.rc |7 ++ 3 files changed, 130 insertions(+), 0 deletions(-) diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c index bfbaaa0..6232442 100644 --- a/dlls/comctl32/tests/propsheet.c +++ b/dlls/comctl32/tests/propsheet.c @@ -525,6 +525,127 @@ static void test_custom_default_button(void) DestroyWindow(hdlg); } +static WNDPROC oldWndProc; +static BOOL clientRectValid; +struct message_entry { +UINT msg; +CHAR source[10]; +}; +static const struct message_entry message_array[] = { +{ PSCB_PRECREATE, sheet_cb }, +{ PSCB_INITIALIZED, sheet_cb }, +{ WM_WINDOWPOSCHANGING, sheet_wp }, +{ WM_NCCALCSIZE,sheet_wp }, +{ WM_WINDOWPOSCHANGED, sheet_wp }, +{ WM_MOVE, sheet_wp }, +{ WM_SIZE, sheet_wp } +}; + +static void check_message(HWND hwnd, UINT msg, PCHAR source) +{ +static UINT msg_count; + +/*trace(check_message: msg[0x%08x] received by %s\n, msg, source);*/ + +if (msg_count sizeof(message_array)/sizeof(message_array[0])) +{ +/* disabled because todo_wine would fail because some messages arrive correct in wine +ok(message_array[msg_count].msg == msg, +received message 0x%x when expecting 0x%x\n, +msg, message_array[msg_count].msg); +ok(strcmp(message_array[msg_count].source, source) == 0, +receiver is %s when expecting %s\n, +source, message_array[msg_count].source); +*/ + +msg_count++; +} +} + +static LRESULT CALLBACK sheet_callback_messages_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ +check_message(hwnd, msg, sheet_wp); + +switch (msg) +{ +case WM_SIZE: +/*trace(sheet_callback_messages_proc: clientRectValid[%d]\n, clientRectValid);*/ +clientRectValid = TRUE; +break; +case WM_CTLCOLORSTATIC: +keybd_event(VK_ESCAPE, 0, 0, 0); +break; +} + +return CallWindowProc (oldWndProc, hwnd, msg, wParam, lParam); +} + +static int CALLBACK sheet_callback_messages(HWND hwnd, UINT msg, LPARAM lparam) +{ +check_message(hwnd, msg, sheet_cb); + +switch (msg) +{ +case PSCB_INITIALIZED: +oldWndProc = (WNDPROC)GetWindowLongPtr (hwnd, GWLP_WNDPROC); +SetWindowLongPtr (hwnd, GWLP_WNDPROC, (LONG_PTR)sheet_callback_messages_proc); +return TRUE; +} + +return TRUE; +} + +static INT_PTR CALLBACK page_dlg_proc_messages(HWND hwnd, UINT msg, WPARAM wparam, + LPARAM lparam) +{ +check_message(hwnd, msg, page); + +return FALSE; +} + +static void test_messages(void) +{ +HPROPSHEETPAGE hpsp[1]; +PROPSHEETPAGEA psp; +PROPSHEETHEADERA psh; +HWND hdlg; + +memset(psp, 0, sizeof(psp)); +psp.dwSize = sizeof(psp); +psp.dwFlags = 0; +psp.hInstance = GetModuleHandleA(NULL); +U(psp).pszTemplate = MAKEINTRESOURCE(IDD_PROP_PAGE_MESSAGE_TEST); +U2(psp).pszIcon = NULL; +psp.pfnDlgProc = page_dlg_proc_messages; +psp.lParam = 0; + +hpsp[0] = CreatePropertySheetPageA(psp); + +memset(psh, 0, sizeof(psh)); +psh.dwSize = sizeof(psh); +psh.dwFlags = PSH_NOAPPLYNOW | PSH_WIZARD | PSH_USECALLBACK + /*| PSH_MODELESS */ | PSH_USEICONID; +psh.pszCaption = test caption; +psh.nPages = 1; +psh.hwndParent = GetDesktopWindow(); +U3(psh).phpage = hpsp; +psh.pfnCallback = sheet_callback_messages; + +hdlg = (HWND)PropertySheetA(psh); +if (hdlg == INVALID_HANDLE_VALUE) +{ +win_skip(comctl32 4.70 needs dwSize adjustment\n); +psh.dwSize = sizeof(psh) - sizeof(HBITMAP) - sizeof(HPALETTE) - sizeof(HBITMAP); +hdlg = (HWND)PropertySheetA(psh); +} +ShowWindow(hdlg,SW_NORMAL); + +todo_wine +ok(clientRectValid, The required WM_SIZE was never sent to the sheet.\n); + +DestroyWindow(hdlg); +} + START_TEST(propsheet) { test_title(); @@ -533,4 +654,5 @@
Re: Test for window messages of a property sheet with custom dialog proc (bug 12104)
On 10/24/2010 05:20 AM, Bernhard Übelacker wrote: If I got it right, tests which would fail in wine are prefixed with todo_wine? I want to ask if this patch looks right for inclusion and if the location (dlls/comctl32/tests/) is right? +/* disabled because todo_wine would fail because some messages arrive correct in wine No, it doesn't look right. If you testing for missing messages, then you should test all messages as done in some other places. See dlls/comctl32/tests/msg.h and where it's used. Vitaliy.