No subject
Tue Aug 30 15:12:41 CDT 2005
that it first registers a class, defined in a resource file, with
RegisterClassEx. Then it tries to create a dialog of this class using
CreateDialogParam. Wine doesn't like this, and crashes in
DIALOG_CreateIndirect (windows/dialog.c). The attached tests recreate this
behavior and work just fine under my Windows ME installation.
Note: My copy of wine-devel.pdf has no mention of writing tests that cause
wine to crash other than a FIXME note, so I just used wine_todo. Therefore
these new tests WILL cause wine to crash.
Changelog:
Added tests for registering a dialog box created by using the CLASS
directive in a resource file, then creating the dialog using
CreateDialogParam.
------=_NextPart_000_0078_01C4611B.A2D81D20
Content-Type: text/plain;
name="class.diff.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="class.diff.txt"
Index: .cvsignore=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /home/wine/wine/dlls/user/tests/.cvsignore,v=0A=
retrieving revision 1.15=0A=
diff -u -r1.15 .cvsignore=0A=
--- .cvsignore 25 Jun 2004 02:55:37 -0000 1.15=0A=
+++ .cvsignore 3 Jul 2004 12:51:10 -0000=0A=
@@ -1,5 +1,6 @@=0A=
Makefile=0A=
class.ok=0A=
+class.res=0A=
clipboard.ok=0A=
dde.ok=0A=
dialog.ok=0A=
Index: Makefile.in=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /home/wine/wine/dlls/user/tests/Makefile.in,v=0A=
retrieving revision 1.10=0A=
diff -u -r1.10 Makefile.in=0A=
--- Makefile.in 25 Jun 2004 02:55:37 -0000 1.10=0A=
+++ Makefile.in 3 Jul 2004 12:51:10 -0000=0A=
@@ -19,7 +19,9 @@=0A=
win.c \=0A=
wsprintf.c=0A=
=0A=
-RC_SRCS =3D resource.rc=0A=
+RC_SRCS =3D \=0A=
+ resource.rc \=0A=
+ class.rc=0A=
=0A=
@MAKE_TEST_RULES@=0A=
=0A=
Index: class.c=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /home/wine/wine/dlls/user/tests/class.c,v=0A=
retrieving revision 1.15=0A=
diff -u -r1.15 class.c=0A=
--- class.c 28 May 2004 19:27:17 -0000 1.15=0A=
+++ class.c 3 Jul 2004 12:51:11 -0000=0A=
@@ -32,6 +32,7 @@=0A=
#include "winreg.h"=0A=
#include "wingdi.h"=0A=
#include "winuser.h"=0A=
+#include "class.h"=0A=
=0A=
#define NUMCLASSWORDS 4=0A=
=0A=
@@ -523,6 +524,59 @@=0A=
check_thread_instance( "EDIT", (HINSTANCE)0x12345678, =
(HINSTANCE)0x12345678, (HINSTANCE)0xdeadbeef );=0A=
}=0A=
=0A=
+LRESULT WINAPI TestDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM =
lParam)=0A=
+{=0A=
+ return DefWindowProc(hWnd, uMsg, wParam, lParam); =0A=
+}=0A=
+=0A=
+BOOL RegisterTestDialog(HINSTANCE hInstance) =0A=
+{ =0A=
+ WNDCLASSEX wcx;=0A=
+ ATOM atom =3D 0;=0A=
+ =0A=
+ ZeroMemory(&wcx, sizeof(WNDCLASSEX));=0A=
+ wcx.cbSize =3D sizeof(wcx);=0A=
+ wcx.lpfnWndProc =3D TestDlgProc;=0A=
+ wcx.cbClsExtra =3D 0;=0A=
+ wcx.cbWndExtra =3D DLGWINDOWEXTRA;=0A=
+ wcx.hInstance =3D hInstance;=0A=
+ wcx.hIcon =3D LoadIcon(NULL, IDI_APPLICATION);=0A=
+ wcx.hCursor =3D LoadCursor(NULL, IDC_ARROW);=0A=
+ wcx.hbrBackground =3D (HBRUSH)GetStockObject(WHITE_BRUSH);=0A=
+ wcx.lpszClassName =3D "TestDialog";=0A=
+ wcx.lpszMenuName =3D "TestDialog";=0A=
+ wcx.hIconSm =3D (HICON)LoadImage(hInstance, MAKEINTRESOURCE(5),=0A=
+ IMAGE_ICON, =0A=
+ GetSystemMetrics(SM_CXSMICON),=0A=
+ GetSystemMetrics(SM_CYSMICON),=0A=
+ LR_DEFAULTCOLOR); =0A=
+ =0A=
+ atom =3D RegisterClassEx(&wcx);=0A=
+ ok(atom !=3D 0, "RegisterClassEx returned 0\n");=0A=
+=0A=
+ return atom; =0A=
+}=0A=
+=0A=
+/* test registering a dialog box created by using the CLASS directive =
in a=0A=
+ resource file, then test creating the dialog using =
CreateDialogParam. */=0A=
+void WINAPI CreateDialogParamTest(HINSTANCE hInstance) =0A=
+{=0A=
+ HWND hWndMain;=0A=
+=0A=
+ if (RegisterTestDialog(hInstance))=0A=
+ {=0A=
+ /* This next todo makes wine crash on a NULL pointer reference =
in=0A=
+ DIALOG_CreateIndirect (within the call to =
CreateDialogParam). */=0A=
+ todo_wine=0A=
+ {=0A=
+ hWndMain =3D CreateDialogParam(hInstance,=0A=
+ MAKEINTRESOURCE(IDD_TESTDIALOG), NULL, 0, 0);=0A=
+ ok(hWndMain !=3D NULL, "CreateDialogParam returned NULL\n");=0A=
+ ShowWindow(hWndMain, SW_SHOW);=0A=
+ }=0A=
+ }=0A=
+}=0A=
+=0A=
START_TEST(class)=0A=
{=0A=
HANDLE hInstance =3D GetModuleHandleA( NULL );=0A=
@@ -535,6 +589,7 @@=0A=
=0A=
ClassTest(hInstance,FALSE);=0A=
ClassTest(hInstance,TRUE);=0A=
+ CreateDialogParamTest(hInstance);=0A=
test_styles();=0A=
test_instances();=0A=
}=0A=
--- /dev/null 2004-06-03 23:18:02.000000000 +0300=0A=
+++ class.h 2004-07-03 15:48:30.000000000 +0300=0A=
@@ -0,0 +1,27 @@=0A=
+/* Unit test suite for window classes.=0A=
+ *=0A=
+ * Copyright 2004 Sami Aario=0A=
+ *=0A=
+ * This library is free software; you can redistribute it and/or=0A=
+ * modify it under the terms of the GNU Lesser General Public=0A=
+ * License as published by the Free Software Foundation; either=0A=
+ * version 2.1 of the License, or (at your option) any later version.=0A=
+ *=0A=
+ * This library is distributed in the hope that it will be useful,=0A=
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of=0A=
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A=
+ * Lesser General Public License for more details.=0A=
+ *=0A=
+ * You should have received a copy of the GNU Lesser General Public=0A=
+ * License along with this library; if not, write to the Free Software=0A=
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 =
USA=0A=
+ */=0A=
+=0A=
+#ifndef __WINE_CLASS_H=0A=
+#define __WINE_CLASS_H=0A=
+=0A=
+#define IDD_MODALDIALOG 101=0A=
+#define IDD_TESTDIALOG 101=0A=
+#define IDC_CLOSE 1000=0A=
+=0A=
+#endif=0A=
--- /dev/null 2004-06-03 23:18:02.000000000 +0300=0A=
+++ class.rc 2004-07-03 15:48:31.000000000 +0300=0A=
@@ -0,0 +1,32 @@=0A=
+/* Unit test suite for window classes.=0A=
+ *=0A=
+ * Copyright 2004 Sami Aario=0A=
+ *=0A=
+ * This library is free software; you can redistribute it and/or=0A=
+ * modify it under the terms of the GNU Lesser General Public=0A=
+ * License as published by the Free Software Foundation; either=0A=
+ * version 2.1 of the License, or (at your option) any later version.=0A=
+ *=0A=
+ * This library is distributed in the hope that it will be useful,=0A=
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of=0A=
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A=
+ * Lesser General Public License for more details.=0A=
+ *=0A=
+ * You should have received a copy of the GNU Lesser General Public=0A=
+ * License along with this library; if not, write to the Free Software=0A=
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 =
USA=0A=
+ */=0A=
+=0A=
+#include "windef.h"=0A=
+#include "winuser.h"=0A=
+#include "class.h"=0A=
+=0A=
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL=0A=
+=0A=
+IDD_TESTDIALOG DIALOG DISCARDABLE 0, 0, 91, 28=0A=
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU=0A=
+CAPTION "CreateDialogParams Test"=0A=
+CLASS "TestDialog"=0A=
+FONT 8, "System"=0A=
+BEGIN=0A=
+END=0A=
------=_NextPart_000_0078_01C4611B.A2D81D20--
More information about the wine-patches
mailing list