diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index ab9d0684..fe05debf 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -335,6 +335,7 @@ patch_enable_all () enable_user32_WM_MDICALCCHILDSCROLL="$1" enable_user32_WM_NOTIFY="$1" enable_user32_WndProc="$1" + enable_user32_lpCreateParams="$1" enable_uxtheme_GTK_Theming="$1" enable_version_GetFileVersionInfoSizeExW="$1" enable_version_VerFindFileA="$1" @@ -1174,6 +1175,9 @@ patch_enable () user32-WndProc) enable_user32_WndProc="$2" ;; + user32-lpCreateParams) + enable_user32_lpCreateParams="$2" + ;; uxtheme-GTK_Theming) enable_uxtheme_GTK_Theming="$2" ;; @@ -2012,6 +2016,13 @@ if test "$enable_uxtheme_GTK_Theming" -eq 1; then enable_ntdll_DllRedirects=1 fi +if test "$enable_user32_MessageBox_WS_EX_TOPMOST" -eq 1; then + if test "$enable_user32_lpCreateParams" -gt 1; then + abort "Patchset user32-lpCreateParams disabled, but user32-MessageBox_WS_EX_TOPMOST depends on that." + fi + enable_user32_lpCreateParams=1 +fi + if test "$enable_stdole32_tlb_SLTG_Typelib" -eq 1; then if test "$enable_widl_SLTG_Typelib_Support" -gt 1; then abort "Patchset widl-SLTG_Typelib_Support disabled, but stdole32.tlb-SLTG_Typelib depends on that." @@ -6648,8 +6659,30 @@ if test "$enable_user32_ListBox_Size" -eq 1; then ) >> "$patchlist" fi +# Patchset user32-lpCreateParams +# | +# | This patchset fixes the following Wine bugs: +# | * [#40303] Fix pointer to custom dialog control data +# | +# | Modified files: +# | * dlls/user32/dialog.c, dlls/user32/tests/dialog.c, dlls/user32/tests/resource.rc, tools/wrc/genres.c +# | +if test "$enable_user32_lpCreateParams" -eq 1; then + patch_apply user32-lpCreateParams/0001-user32-tests-Add-a-test-for-custom-dialog-control-da.patch + patch_apply user32-lpCreateParams/0002-tools-wrc-Fix-generation-of-custom-dialog-control-da.patch + patch_apply user32-lpCreateParams/0003-user32-Fix-the-pointer-to-custom-dialog-control-data.patch + ( + echo '+ { "Dmitry Timoshkov", "user32/tests: Add a test for custom dialog control data.", 1 },'; + echo '+ { "Dmitry Timoshkov", "tools/wrc: Fix generation of custom dialog control data.", 1 },'; + echo '+ { "Dmitry Timoshkov", "user32: Fix the pointer to custom dialog control data.", 1 },'; + ) >> "$patchlist" +fi + # Patchset user32-MessageBox_WS_EX_TOPMOST # | +# | This patchset has the following (direct or indirect) dependencies: +# | * user32-lpCreateParams +# | # | Modified files: # | * dlls/user32/msgbox.c, dlls/user32/tests/dialog.c # | diff --git a/patches/user32-MessageBox_WS_EX_TOPMOST/0001-user32-tests-Add-some-tests-to-see-when-MessageBox-g.patch b/patches/user32-MessageBox_WS_EX_TOPMOST/0001-user32-tests-Add-some-tests-to-see-when-MessageBox-g.patch index 91cb2f4c..a265f1a2 100644 --- a/patches/user32-MessageBox_WS_EX_TOPMOST/0001-user32-tests-Add-some-tests-to-see-when-MessageBox-g.patch +++ b/patches/user32-MessageBox_WS_EX_TOPMOST/0001-user32-tests-Add-some-tests-to-see-when-MessageBox-g.patch @@ -1,4 +1,4 @@ -From 53e12fde2c97a0beb5f83b243caffb7db393624d Mon Sep 17 00:00:00 2001 +From 7a0cb3382e4d57adf72203c381105340d893d21b Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Thu, 18 Feb 2016 10:17:46 +0800 Subject: user32/tests: Add some tests to see when MessageBox gains @@ -9,11 +9,11 @@ Subject: user32/tests: Add some tests to see when MessageBox gains 1 file changed, 113 insertions(+) diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c -index a6cd1be..4be1ae7 100644 +index 4289b3f..945d971 100644 --- a/dlls/user32/tests/dialog.c +++ b/dlls/user32/tests/dialog.c -@@ -1472,12 +1472,125 @@ static void test_timer_message(void) - DialogBoxA(g_hinst, "RADIO_TEST_DIALOG", NULL, timer_message_dlg_proc); +@@ -1508,12 +1508,125 @@ static void test_dialog_custom_data(void) + DialogBoxA(g_hinst, "CUSTOM_TEST_DIALOG", NULL, custom_test_dialog_proc); } +struct create_window_params @@ -135,9 +135,9 @@ index a6cd1be..4be1ae7 100644 if (!RegisterWindowClasses()) assert(0); + test_MessageBox(); + test_dialog_custom_data(); test_GetNextDlgItem(); test_IsDialogMessage(); - test_WM_NEXTDLGCTL(); -- 2.7.1 diff --git a/patches/user32-MessageBox_WS_EX_TOPMOST/definition b/patches/user32-MessageBox_WS_EX_TOPMOST/definition index 42facfbf..8e9b6f47 100644 --- a/patches/user32-MessageBox_WS_EX_TOPMOST/definition +++ b/patches/user32-MessageBox_WS_EX_TOPMOST/definition @@ -1 +1,2 @@ Fixes: MessageBox should be topmost when MB_SYSTEMMODAL style is set +Depends: user32-lpCreateParams diff --git a/patches/user32-lpCreateParams/0001-user32-tests-Add-a-test-for-custom-dialog-control-da.patch b/patches/user32-lpCreateParams/0001-user32-tests-Add-a-test-for-custom-dialog-control-da.patch new file mode 100644 index 00000000..55a4f3d0 --- /dev/null +++ b/patches/user32-lpCreateParams/0001-user32-tests-Add-a-test-for-custom-dialog-control-da.patch @@ -0,0 +1,103 @@ +From a0fec83a02fde13d4486ee1ea7ff61513b6f4fc1 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Tue, 15 Mar 2016 12:31:22 +0800 +Subject: user32/tests: Add a test for custom dialog control data. + +--- + dlls/user32/tests/dialog.c | 38 ++++++++++++++++++++++++++++++++++++++ + dlls/user32/tests/resource.rc | 9 +++++++++ + 2 files changed, 47 insertions(+) + +diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c +index a6cd1be..2715b6b 100644 +--- a/dlls/user32/tests/dialog.c ++++ b/dlls/user32/tests/dialog.c +@@ -539,6 +539,27 @@ static LRESULT CALLBACK testDlgWinProc (HWND hwnd, UINT uiMsg, WPARAM wParam, + return DefDlgProcA (hwnd, uiMsg, wParam, lParam); + } + ++static LRESULT CALLBACK test_control_procA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) ++{ ++ switch(msg) ++ { ++ case WM_CREATE: ++ { ++ static const short sample[] = { 10,1,2,3,4,5 }; ++ CREATESTRUCTA *cs = (CREATESTRUCTA *)lparam; ++ short *data = cs->lpCreateParams; ++todo_wine ++ ok(!memcmp(data, sample, sizeof(sample)), "data mismatch: %d,%d,%d,%d,%d\n", data[0], data[1], data[2], data[3], data[4]); ++ } ++ return 0; ++ ++ default: ++ break; ++ } ++ ++ return DefWindowProcA(hwnd, msg, wparam, lparam); ++} ++ + static BOOL RegisterWindowClasses (void) + { + WNDCLASSA cls; +@@ -558,7 +579,10 @@ static BOOL RegisterWindowClasses (void) + + cls.lpfnWndProc = main_window_procA; + cls.lpszClassName = "IsDialogMessageWindowClass"; ++ if (!RegisterClassA (&cls)) return FALSE; + ++ cls.lpfnWndProc = test_control_procA; ++ cls.lpszClassName = "TESTCONTROL"; + if (!RegisterClassA (&cls)) return FALSE; + + GetClassInfoA(0, "#32770", &cls); +@@ -1472,12 +1496,26 @@ static void test_timer_message(void) + DialogBoxA(g_hinst, "RADIO_TEST_DIALOG", NULL, timer_message_dlg_proc); + } + ++static INT_PTR CALLBACK custom_test_dialog_proc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) ++{ ++ if (msg == WM_INITDIALOG) ++ EndDialog(hdlg, 0); ++ ++ return FALSE; ++} ++ ++static void test_dialog_custom_data(void) ++{ ++ DialogBoxA(g_hinst, "CUSTOM_TEST_DIALOG", NULL, custom_test_dialog_proc); ++} ++ + START_TEST(dialog) + { + g_hinst = GetModuleHandleA (0); + + if (!RegisterWindowClasses()) assert(0); + ++ test_dialog_custom_data(); + test_GetNextDlgItem(); + test_IsDialogMessage(); + test_WM_NEXTDLGCTL(); +diff --git a/dlls/user32/tests/resource.rc b/dlls/user32/tests/resource.rc +index f116b85..bfe8b9c 100644 +--- a/dlls/user32/tests/resource.rc ++++ b/dlls/user32/tests/resource.rc +@@ -200,6 +200,15 @@ FONT 8, "MS Shell Dlg" + EDITTEXT 1000, 5, 5, 150, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_MULTILINE | WS_VSCROLL | ES_AUTOVSCROLL | ES_READONLY + } + ++CUSTOM_TEST_DIALOG DIALOGEX 6, 15, 207, 111 ++STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU ++CAPTION "Custom Test Dialog" ++FONT 8, "MS Sans Serif" ++{ ++ CONTROL "evenlengthtext", -1, "TESTCONTROL", WS_CHILD|WS_VISIBLE|WS_BORDER|WS_TABSTOP, 10,10,100,50 { 1,2,3,4,5 } ++ CONTROL "oddlengthtext", -1, "TESTCONTROL", WS_CHILD|WS_VISIBLE|WS_BORDER|WS_TABSTOP, 10,60,100,50 { 1,2,3,4,5 } ++} ++ + /* @makedep: test_mono.bmp */ + 100 BITMAP test_mono.bmp + +-- +2.7.1 + diff --git a/patches/user32-lpCreateParams/0002-tools-wrc-Fix-generation-of-custom-dialog-control-da.patch b/patches/user32-lpCreateParams/0002-tools-wrc-Fix-generation-of-custom-dialog-control-da.patch new file mode 100644 index 00000000..3aa23a6b --- /dev/null +++ b/patches/user32-lpCreateParams/0002-tools-wrc-Fix-generation-of-custom-dialog-control-da.patch @@ -0,0 +1,26 @@ +From 21a9d3d446f2c30e7f3c2bd3208c3f077c49b7f9 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Tue, 15 Mar 2016 12:32:38 +0800 +Subject: tools/wrc: Fix generation of custom dialog control data. + +--- + tools/wrc/genres.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/tools/wrc/genres.c b/tools/wrc/genres.c +index 5b7e24c..b97717a 100644 +--- a/tools/wrc/genres.c ++++ b/tools/wrc/genres.c +@@ -726,8 +726,7 @@ static res_t *dialog2res(name_id_t *name, dialog_t *dlg) + put_word(res, 0); + if(ctrl->extra) + { +- put_word(res, ctrl->extra->size+2); +- put_pad(res); ++ put_word(res, ctrl->extra->size); + put_raw_data(res, ctrl->extra, 0); + } + else +-- +2.7.1 + diff --git a/patches/user32-lpCreateParams/0003-user32-Fix-the-pointer-to-custom-dialog-control-data.patch b/patches/user32-lpCreateParams/0003-user32-Fix-the-pointer-to-custom-dialog-control-data.patch new file mode 100644 index 00000000..7a359b93 --- /dev/null +++ b/patches/user32-lpCreateParams/0003-user32-Fix-the-pointer-to-custom-dialog-control-data.patch @@ -0,0 +1,39 @@ +From f878f67e54ac0b53f9aff8abe86cf3397a3cccc3 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Tue, 15 Mar 2016 12:37:16 +0800 +Subject: user32: Fix the pointer to custom dialog control data. + +The fix is suggested by vendor2013@herdsoft.com. +--- + dlls/user32/dialog.c | 2 +- + dlls/user32/tests/dialog.c | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c +index 3ea426d..738709d 100644 +--- a/dlls/user32/dialog.c ++++ b/dlls/user32/dialog.c +@@ -197,7 +197,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info, + TRACE("\n"); + TRACE(" END\n" ); + } +- info->data = p + 1; ++ info->data = p; + p += GET_WORD(p) / sizeof(WORD); + } + else info->data = NULL; +diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c +index 2715b6b..4289b3f 100644 +--- a/dlls/user32/tests/dialog.c ++++ b/dlls/user32/tests/dialog.c +@@ -548,7 +548,6 @@ static LRESULT CALLBACK test_control_procA(HWND hwnd, UINT msg, WPARAM wparam, L + static const short sample[] = { 10,1,2,3,4,5 }; + CREATESTRUCTA *cs = (CREATESTRUCTA *)lparam; + short *data = cs->lpCreateParams; +-todo_wine + ok(!memcmp(data, sample, sizeof(sample)), "data mismatch: %d,%d,%d,%d,%d\n", data[0], data[1], data[2], data[3], data[4]); + } + return 0; +-- +2.7.1 + diff --git a/patches/user32-lpCreateParams/definition b/patches/user32-lpCreateParams/definition new file mode 100644 index 00000000..9645a0e6 --- /dev/null +++ b/patches/user32-lpCreateParams/definition @@ -0,0 +1 @@ +Fixes: [40303] Fix pointer to custom dialog control data