Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46494 Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/user32/dialog.c | 4 ++-- dlls/user32/tests/dialog.c | 41 +++++++++++++++++++++++++++++++++++ dlls/user32/tests/resource.rc | 9 ++++++++ dlls/user32/user_private.h | 1 + 4 files changed, 53 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c index 72e6eee02f..deaeb84556 100644 --- a/dlls/user32/dialog.c +++ b/dlls/user32/dialog.c @@ -131,8 +131,8 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
if (dialogEx) { - /* id is a DWORD for DIALOGEX */ - info->id = GET_DWORD(p); + /* id is 4 bytes for DIALOGEX */ + info->id = GET_LONG(p); p += 2; } else diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c index 8c9bd21482..070ddcebb7 100644 --- a/dlls/user32/tests/dialog.c +++ b/dlls/user32/tests/dialog.c @@ -1181,9 +1181,47 @@ static void test_GetDlgItemText(void) "string retrieved using GetDlgItemText should have been NULL terminated\n"); }
+static INT_PTR CALLBACK getdlgitem_test_dialog_proc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if (msg == WM_INITDIALOG) + { + char text[64]; + LONG_PTR val; + HWND hwnd; + BOOL ret; + + hwnd = GetDlgItem(hdlg, -1); + ok(hwnd != NULL, "Expected dialog item.\n"); + + *text = 0; + ret = GetDlgItemTextA(hdlg, -1, text, ARRAY_SIZE(text)); + ok(ret && !strcmp(text, "Text1"), "Unexpected item text.\n"); + + val = GetWindowLongA(hwnd, GWLP_ID); + ok(val == -1, "Unexpected id.\n"); + + val = GetWindowLongPtrA(hwnd, GWLP_ID); + ok(val == -1, "Unexpected id %ld.\n", val); + + hwnd = GetDlgItem(hdlg, -2); + ok(hwnd != NULL, "Expected dialog item.\n"); + + val = GetWindowLongA(hwnd, GWLP_ID); + ok(val == -2, "Unexpected id.\n"); + + val = GetWindowLongPtrA(hwnd, GWLP_ID); + ok(val == -2, "Unexpected id %ld.\n", val); + + EndDialog(hdlg, 0xdead); + } + + return FALSE; +} + static void test_GetDlgItem(void) { HWND hwnd, child1, child2, hwnd2; + INT_PTR retval; BOOL ret;
hwnd = CreateWindowA("button", "parent", WS_VISIBLE, 0, 0, 100, 100, NULL, 0, g_hinst, NULL); @@ -1230,6 +1268,9 @@ static void test_GetDlgItem(void) DestroyWindow(child1); DestroyWindow(child2); DestroyWindow(hwnd); + + retval = DialogBoxParamA(g_hinst, "GETDLGITEM_TEST_DIALOG", NULL, getdlgitem_test_dialog_proc, 0); + ok(retval == 0xdead, "Unexpected return value.\n"); }
static INT_PTR CALLBACK DestroyDlgWinProc (HWND hDlg, UINT uiMsg, diff --git a/dlls/user32/tests/resource.rc b/dlls/user32/tests/resource.rc index 3823ed39e4..4301af6d68 100644 --- a/dlls/user32/tests/resource.rc +++ b/dlls/user32/tests/resource.rc @@ -237,6 +237,15 @@ FONT 8, "MS Sans Serif" CONTROL "oddlengthtext", -1, "TESTCONTROL", WS_CHILD|WS_VISIBLE|WS_BORDER|WS_TABSTOP, 10,60,100,50 { 1,2,3,4,5 } }
+GETDLGITEM_TEST_DIALOG DIALOGEX 6, 15, 207, 111 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Test Dialog" +FONT 8, "MS Shell Dlg" +{ + LTEXT "Text1",-1,10,10,100,50 + LTEXT "Text2",-2,10,10,100,50 +} + /* @makedep: test_mono.bmp */ 100 BITMAP test_mono.bmp
diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index bf02ee5b0b..514cf6753f 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -33,6 +33,7 @@
#define GET_WORD(ptr) (*(const WORD *)(ptr)) #define GET_DWORD(ptr) (*(const DWORD *)(ptr)) +#define GET_LONG(ptr) (*(const LONG *)(ptr))
#define WM_SYSTIMER 0x0118 #define WM_POPUPSYSTEMMENU 0x0313
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=46567
Your paranoid android.
=== wvistau64_zh_CN (32 bit report) ===
user32: dce.c:648: Test failed: wrong window
=== w2003std (32 bit report) ===
user32: dde: Timeout
=== w7pro64 (64 bit report) ===
user32: menu.c:794: Test failed: width of owner drawn menu item is wrong. Got 53 expected 24 menu.c:798: Test failed: Height of owner drawn menu item is wrong. Got 10 expected 19
=== w2003std (32 bit report) ===
user32: sysparams: Timeout
=== w8 (32 bit report) ===
user32: sysparams.c:2514: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2525: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w8adm (32 bit report) ===
user32: sysparams.c:2514: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2525: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w864 (32 bit report) ===
user32: sysparams.c:2514: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2525: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== debian9 (32 bit report) ===
user32: input.c:2566: Test failed: 200: wrong originId 1/2 input.c:2575: Test failed: 200: wrong originId 1/2 input.c:2566: Test failed: 200: wrong originId 1/2 input.c:2575: Test failed: 200: wrong originId 1/2
=== debian9 (32 bit WoW report) ===
user32: msg.c:8713: Test failed: WaitForSingleObject failed 102 msg.c:8719: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8719: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8719: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
On 1/24/19 1:58 PM, Marvin wrote:
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=46567
Your paranoid android.
All that is unrelated.