You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Added patch to fix pointer to custom dialog control data.
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
From a0fec83a02fde13d4486ee1ea7ff61513b6f4fc1 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
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
|
||||
|
@@ -0,0 +1,26 @@
|
||||
From 21a9d3d446f2c30e7f3c2bd3208c3f077c49b7f9 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
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
|
||||
|
@@ -0,0 +1,39 @@
|
||||
From f878f67e54ac0b53f9aff8abe86cf3397a3cccc3 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
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
|
||||
|
1
patches/user32-lpCreateParams/definition
Normal file
1
patches/user32-lpCreateParams/definition
Normal file
@@ -0,0 +1 @@
|
||||
Fixes: [40303] Fix pointer to custom dialog control data
|
Reference in New Issue
Block a user