[PATCH v4 0/2] MR6146: comctl32/propsheet: Create pages with PSP_PREMATURE on initialization.
The UK Kalender program was crashing when a new event was created as stated in the bug report. The fix is to create all the property sheet pages from the beginning instead of when they are selected. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54861 -- v4: comctl32/propsheet: Create pages with PSP_PREMATURE on initialization. comctl32/tests: Add test for propsheet page creation when propsheet gets initialized. https://gitlab.winehq.org/wine/wine/-/merge_requests/6146
From: Jacob Czekalla <jczekalla(a)codeweavers.com> --- dlls/comctl32/tests/propsheet.c | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c index 9bd1c08bd6a..510fe4e9317 100644 --- a/dlls/comctl32/tests/propsheet.c +++ b/dlls/comctl32/tests/propsheet.c @@ -1388,6 +1388,46 @@ static void test_invalid_hpropsheetpage(void) DestroyWindow(hdlg); } +static void test_init_page_creation(void) +{ + PROPSHEETPAGEA psp[3]; + PROPSHEETHEADERA psh; + HWND hp; + HWND page; + + memset(&psh, 0, sizeof(psh)); + memset(psp, 0, sizeof(psp)); + + for (int p = 0; p < 3; p++) + { + psp[p].dwSize = sizeof(PROPSHEETPAGEA); + psp[p].dwFlags = PSP_USETITLE; + psp[p].hInstance = GetModuleHandleA(NULL); + psp[p].pszTemplate = (const char *)MAKEINTRESOURCE(IDD_PROP_PAGE_EDIT); + psp[p].pszIcon = NULL; + psp[p].pfnDlgProc = (DLGPROC) page_dlg_proc; + psp[p].pszTitle = "page title"; + psp[p].lParam = 0; + } + + psh.dwSize = sizeof(PROPSHEETHEADERA); + psh.dwFlags = PSH_PROPSHEETPAGE | PSH_MODELESS; + psh.hwndParent = GetDesktopWindow(); + psh.pszCaption = "test caption"; + psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGEA); + psh.ppsp = (LPCPROPSHEETPAGEA)&psp; + + hp = (HWND)pPropertySheetA(&psh); + + for (int p = 0; p < 3; p++) + { + hwnd_page = (HWND)SendMessageA(hp, PSM_INDEXTOHWND, p, 0); + todo_wine ok(hwnd_page != NULL, "Page %d not created.\n", p); + } + + DestroyWindow(hp); +} + static void init_comctl32_functions(void) { HMODULE hComCtl32 = LoadLibraryA("comctl32.dll"); @@ -1442,6 +1482,7 @@ START_TEST(propsheet) test_CreatePropertySheetPage(); test_page_dialog_texture(); test_invalid_hpropsheetpage(); + test_init_page_creation(); if (!load_v6_module(&ctx_cookie, &ctx)) return; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6146
From: Jacob Czekalla <jczekalla(a)codeweavers.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54861 --- dlls/comctl32/propsheet.c | 8 ++++++++ dlls/comctl32/tests/propsheet.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c index b530a1a8094..230c3218510 100644 --- a/dlls/comctl32/propsheet.c +++ b/dlls/comctl32/propsheet.c @@ -3625,6 +3625,14 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) psInfo->ppshheader.pszCaption); } + for (int index = 0; index < psInfo->nPages;) + { + DWORD premature = HPSP_get_flags(psInfo->proppage[index].hpage) & PSP_PREMATURE; + if (premature && !PROPSHEET_CreatePage(hwnd, index, psInfo, psInfo->proppage[index].hpage)) + PROPSHEET_RemovePage(hwnd, index, NULL); + else + index++; + } if (psInfo->useCallback) (*(psInfo->ppshheader.pfnCallback))(hwnd, PSCB_INITIALIZED, 0); diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c index 510fe4e9317..fa01d59a661 100644 --- a/dlls/comctl32/tests/propsheet.c +++ b/dlls/comctl32/tests/propsheet.c @@ -1422,7 +1422,7 @@ static void test_init_page_creation(void) for (int p = 0; p < 3; p++) { hwnd_page = (HWND)SendMessageA(hp, PSM_INDEXTOHWND, p, 0); - todo_wine ok(hwnd_page != NULL, "Page %d not created.\n", p); + ok(hwnd_page != NULL, "Page %d not created.\n", p); } DestroyWindow(hp); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6146
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=147466 Your paranoid android. === build (build log) === ../wine/dlls/comctl32/tests/propsheet.c:1424:9: error: ‘hwnd_page’ undeclared (first use in this function) Task: The exe32 Wine build failed === debian11 (build log) === ../wine/dlls/comctl32/tests/propsheet.c:1424:9: error: ‘hwnd_page’ undeclared (first use in this function) Task: The win32 Wine build failed === debian11b (build log) === ../wine/dlls/comctl32/tests/propsheet.c:1424:9: error: ‘hwnd_page’ undeclared (first use in this function) Task: The wow64 Wine build failed
It doesn't pass the build stage in Gitlab CI. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6146#note_77508
participants (4)
-
Jacob Czekalla -
Jacob Czekalla (@JacobCzekalla) -
Marvin -
Zhiyi Zhang (@zhiyi)