Rebase against 083dea7fce4372840ac18176496a7d05dadd5ad8.

This commit is contained in:
Alistair Leslie-Hughes
2022-03-18 11:29:35 +11:00
parent cd68f05ab3
commit 62db3313d5
10 changed files with 72 additions and 94 deletions

View File

@@ -1,8 +1,8 @@
From c40265799ed2dd422b06cce9560b7b855304cbf1 Mon Sep 17 00:00:00 2001
From f5f76efccaf16896cfaf455c3f8e5383675a5b79 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Wed, 15 Jun 2016 14:57:10 +0800
Subject: user32: Do not initialize dialog info for every window passed to
DefDlgProc.
Subject: [PATCH] user32: Do not initialize dialog info for every window passed
to DefDlgProc.
The tests in the last patch in the series use
DefDlgProcA(parent, DM_GETDEFID, 0, 0);
@@ -18,10 +18,10 @@ has been forced, so passing TRUE to DIALOG_get_info() is redundant there.
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/user32/defdlg.c b/dlls/user32/defdlg.c
index 00a73c6..258c3a9 100644
index 3c7a8a78855..b7d30a7f1cf 100644
--- a/dlls/user32/defdlg.c
+++ b/dlls/user32/defdlg.c
@@ -364,7 +364,7 @@ LRESULT WINAPI DefDlgProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
@@ -361,7 +361,7 @@ static LRESULT USER_DefDlgProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
LRESULT result = 0;
/* Perform DIALOGINFO initialization if not done */
@@ -30,7 +30,7 @@ index 00a73c6..258c3a9 100644
SetWindowLongPtrW( hwnd, DWLP_MSGRESULT, 0 );
@@ -422,7 +422,7 @@ LRESULT WINAPI DefDlgProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
@@ -415,7 +415,7 @@ static LRESULT USER_DefDlgProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
LRESULT result = 0;
/* Perform DIALOGINFO initialization if not done */
@@ -40,10 +40,10 @@ index 00a73c6..258c3a9 100644
SetWindowLongPtrW( hwnd, DWLP_MSGRESULT, 0 );
diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c
index 9cb4b8d..b84784f 100644
index a3efd5b6742..a226c764c49 100644
--- a/dlls/user32/dialog.c
+++ b/dlls/user32/dialog.c
@@ -216,7 +216,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
@@ -212,7 +212,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
static BOOL DIALOG_CreateControls32( HWND hwnd, LPCSTR template, const DLG_TEMPLATE *dlgTemplate,
HINSTANCE hInst, BOOL unicode )
{
@@ -53,5 +53,5 @@ index 9cb4b8d..b84784f 100644
HWND hwndCtrl, hwndDefButton = 0;
INT items = dlgTemplate->nbItems;
--
2.8.0
2.35.1

View File

@@ -1,7 +1,8 @@
From d068cb5331e7dee5ceb0c14a3eff9ef2c273865d Mon Sep 17 00:00:00 2001
From f612886526cf2a07f02794c2d41e6284e39d251d Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Wed, 15 Jun 2016 15:07:39 +0800
Subject: user32: Use root dialog for DM_SETDEFID/DM_GETDEFID in DefDlgProc.
Subject: [PATCH] user32: Use root dialog for DM_SETDEFID/DM_GETDEFID in
DefDlgProc.
This patch fixes DM_SETDEFID/DM_GETDEFID handling in complex dialog
structures such as a property sheet.
@@ -10,7 +11,7 @@ structures such as a property sheet.
1 file changed, 25 insertions(+)
diff --git a/dlls/user32/defdlg.c b/dlls/user32/defdlg.c
index 258c3a9..6765a51 100644
index b7d30a7f1cf..5b7f59cd3c7 100644
--- a/dlls/user32/defdlg.c
+++ b/dlls/user32/defdlg.c
@@ -209,6 +209,25 @@ static BOOL DEFDLG_SetDefButton( HWND hwndDlg, DIALOGINFO *dlgInfo, HWND hwndNew
@@ -58,5 +59,5 @@ index 258c3a9..6765a51 100644
{
HWND hwndDefId;
--
2.8.0
2.35.1

View File

@@ -1,18 +1,18 @@
From 44670a4e2f5d3434d8546ed32724b58a24b4399e Mon Sep 17 00:00:00 2001
From 71f0da0e3f84845fc5e5352b9279de0cd30a717d Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Wed, 15 Jun 2016 15:09:46 +0800
Subject: user32/tests: Add a bunch of tests for DM_SETDEFID/DM_GETDEFID
handling by a DefDlgProc.
Subject: [PATCH] user32/tests: Add a bunch of tests for
DM_SETDEFID/DM_GETDEFID handling by a DefDlgProc.
---
dlls/user32/tests/win.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++++
dlls/user32/tests/win.c | 87 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 87 insertions(+)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index c135fdf..23e98e0 100644
index 49bbd5894a9..3458f812394 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -4228,15 +4228,65 @@ static void test_window_styles(void)
@@ -5157,15 +5157,65 @@ static void test_window_styles(void)
}
}
@@ -78,7 +78,7 @@ index c135fdf..23e98e0 100644
return 0;
}
@@ -4255,6 +4305,16 @@ static INT_PTR WINAPI empty_dlg_proc2(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
@@ -5184,6 +5234,16 @@ static INT_PTR WINAPI empty_dlg_proc2(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
struct dialog_param *param = (struct dialog_param *)lparam;
BOOL parent_is_child;
HWND disabled_hwnd;
@@ -95,9 +95,9 @@ index c135fdf..23e98e0 100644
parent_is_child = (GetWindowLongA(param->parent, GWL_STYLE) & (WS_POPUP | WS_CHILD)) == WS_CHILD;
@@ -4296,6 +4356,25 @@ static INT_PTR WINAPI empty_dlg_proc2(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
@@ -5225,6 +5285,25 @@ static INT_PTR WINAPI empty_dlg_proc2(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, hwnd, empty_dlg_proc3, 0);
ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
ok(IsWindowEnabled(hwnd), "wrong state for %p (%08lx)\n", hwnd, style);
+ param->dlg_data->style |= DS_CONTROL;
+ DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, hwnd, empty_dlg_proc3, 0);
@@ -121,7 +121,7 @@ index c135fdf..23e98e0 100644
EndDialog(hwnd, 0);
}
return 0;
@@ -4314,6 +4393,7 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou
@@ -5243,6 +5322,7 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou
DWORD style, ex_style;
HWND hwnd, grand_parent = 0, parent = 0;
struct dialog_param param;
@@ -129,9 +129,9 @@ index c135fdf..23e98e0 100644
if (style_in & WS_CHILD)
{
@@ -4341,6 +4421,13 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou
@@ -5270,6 +5350,13 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou
hwnd = CreateDialogIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, parent, empty_dlg_proc, 0);
ok(hwnd != 0, "dialog creation failed, style %#x, exstyle %#x\n", style_in, ex_style_in);
ok(hwnd != 0, "dialog creation failed, style %#lx, exstyle %#lx\n", style_in, ex_style_in);
+ id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
+ ok(id == MAKELONG(IDOK,DC_HASDEFID), "expected (IDOK,DC_HASDEFID), got %08lx\n", id);
@@ -144,5 +144,5 @@ index c135fdf..23e98e0 100644
style = GetWindowLongA(hwnd, GWL_STYLE);
--
2.8.0
2.35.1