Author: jimtabor
Date: Thu Jul 7 17:22:10 2016
New Revision: 71849
URL:
http://svn.reactos.org/svn/reactos?rev=71849&view=rev
Log:
[USER32_WINETEST] Sync with Wine Staging 1.9.11 Part 3. CORE-11368
Modified:
trunk/rostests/winetests/user32/dialog.c
trunk/rostests/winetests/user32/resource.rc
Modified: trunk/rostests/winetests/user32/dialog.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/dialog.c…
==============================================================================
--- trunk/rostests/winetests/user32/dialog.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/dialog.c [iso-8859-1] Thu Jul 7 17:22:10 2016
@@ -539,6 +539,26 @@
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;
+ 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 +578,10 @@
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);
@@ -1220,6 +1243,11 @@
ok(ERROR_RESOURCE_NAME_NOT_FOUND == GetLastError() ||
broken(GetLastError() == 0xdeadbeef),
"got %d, expected ERROR_RESOURCE_NAME_NOT_FOUND\n",GetLastError());
+
+ SetLastError(0xdeadbeef);
+ ret = DialogBoxParamA(GetModuleHandleA(NULL), "TEST_DIALOG_INVALID_CLASS",
0, DestroyDlgWinProc, 0);
+ ok(ret == -1, "DialogBoxParamA returned %ld, expected -1\n", ret);
+ ok(GetLastError() == 0, "got %d\n", GetLastError());
SetLastError(0xdeadbeef);
ret = DefDlgProcA(0, WM_ERASEBKGND, 0, 0);
@@ -1472,6 +1500,19 @@
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);
+}
+
struct create_window_params
{
BOOL owner;
@@ -1516,6 +1557,7 @@
}
}
+ Sleep(50);
return hwnd;
}
@@ -1551,7 +1593,7 @@
hwnd = wait_for_window(params.caption);
ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
- ok((ex_style & test[i].ex_style) == test[i].ex_style, "%d: got window
ex_style %#x\n", i, ex_style);
+ ok((ex_style & WS_EX_TOPMOST) == test[i].ex_style, "%d: got window
ex_style %#x\n", i, ex_style);
PostMessageA(hwnd, WM_COMMAND, IDCANCEL, 0);
@@ -1572,7 +1614,7 @@
hwnd = wait_for_window(params.caption);
ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
- ok((ex_style & test[i].ex_style) == test[i].ex_style, "%d: got window
ex_style %#x\n", i, ex_style);
+ ok((ex_style & WS_EX_TOPMOST) == test[i].ex_style, "%d: got window
ex_style %#x\n", i, ex_style);
PostMessageA(hwnd, WM_COMMAND, IDCANCEL, 0);
@@ -1588,6 +1630,7 @@
if (!RegisterWindowClasses()) assert(0);
test_MessageBox();
+ test_dialog_custom_data();
test_GetNextDlgItem();
test_IsDialogMessage();
test_WM_NEXTDLGCTL();
Modified: trunk/rostests/winetests/user32/resource.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/resource…
==============================================================================
--- trunk/rostests/winetests/user32/resource.rc [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/resource.rc [iso-8859-1] Thu Jul 7 17:22:10 2016
@@ -124,6 +124,12 @@
EDITTEXT 200,4,4,50,14
}
+TEST_DIALOG_INVALID_CLASS DIALOG 0, 0, 60, 30
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+{
+ CONTROL "",1,"wine invalid class",WS_CHILD,0,0,40,10
+}
+
IDD_DIALOG DIALOG 0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
@@ -198,6 +204,15 @@
PUSHBUTTON "OK", IDOK, 20, 60, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 100, 60, 50, 14, WS_CHILD | WS_VISIBLE |
WS_TABSTOP
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 */