Dmitry Timoshkov wrote:
"Dmitry Timoshkov" <[email protected]> wrote:

+    #ifdef _WIN64
+    ok(cls.cbWndExtra == 8, "expected 6, got %d\n", cls.cbWndExtra);
+    #else
+    ok(cls.cbWndExtra == 6, "expected 6, got %d\n", cls.cbWndExtra);
+    #endif
+}
+}

You should check the return value of GetClassInfoEx() and put todo_wine
only around the failing ok() call (otherwise it will fail under 64-bit).

And of course fix the message in the ok() for 64-bit case.

Thanks again for your comments!

Hereby again a new version. Based on help from IRC, I added the broken call for Windows XP 64-bit. Based on the values from [1] I also added a test for the Dialog class (and moved the tests to class.c). Although this particular value is just defined in winuser.h maybe tests for other extra values could be useful in the future.

Please let me know what you think.


[1] http://haar.student.utwente.nl/~julius/extra_value_table (updated)
>From ad33ba4e77207be1e36f1717003fc7c0623d9be5 Mon Sep 17 00:00:00 2001
From: Julius Schwartzenberg <[email protected]>
Date: Sun, 11 Oct 2009 15:27:44 +0200
Subject: Fix for bug #2181. Changes the extra value of the standard edit class 
from 4 to 6.

---
 dlls/user32/edit.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c
index 8ad945b..e42ed41 100644
--- a/dlls/user32/edit.c
+++ b/dlls/user32/edit.c
@@ -5410,13 +5410,19 @@ static LRESULT WINAPI EditWndProcW(HWND hWnd, UINT 
uMsg, WPARAM wParam, LPARAM l
  * edit class descriptor
  */
 static const WCHAR editW[] = {'E','d','i','t',0};
+#ifdef _WIN64
+#define EDIT_EXTRA_VALUE 0
+#else
+#define EDIT_EXTRA_VALUE 2 /* This has to be 6 in total for 32-bit, otherwise 
Civilization II crashes, bug #2181  */
+#endif
 const struct builtin_class_descr EDIT_builtin_class =
 {
     editW,                /* name */
     CS_DBLCLKS | CS_PARENTDC,   /* style */
     EditWndProcA,         /* procA */
     EditWndProcW,         /* procW */
-    sizeof(EDITSTATE *),  /* extra */
+    sizeof(EDITSTATE *) + EDIT_EXTRA_VALUE,   /* extra */
     IDC_IBEAM,            /* cursor */
     0                     /* brush */
 };
+#undef EDIT_EXTRA_VALUE
-- 
1.6.0.4

>From 6fb3b151c05255ef6265f8cb1ab61926ddabbb62 Mon Sep 17 00:00:00 2001
From: Julius Schwartzenberg <[email protected]>
Date: Sun, 11 Oct 2009 15:32:15 +0200
Subject: Adding extra class value tests for the standard classes

---
 dlls/user32/tests/class.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/dlls/user32/tests/class.c b/dlls/user32/tests/class.c
index f8a4cd8..17825c1 100644
--- a/dlls/user32/tests/class.c
+++ b/dlls/user32/tests/class.c
@@ -831,10 +831,32 @@ static void CreateDialogParamTest(HINSTANCE hInstance)
     }
 }
 
+static void test_extra_values(void)
+{
+    WNDCLASSEX wcx;
+    if (GetClassInfoEx(NULL,"#32770",&wcx)) /* Dialog */
+        ok(30 == wcx.cbWndExtra, "expected 30, got %d\n", wcx.cbWndExtra);
+    else
+        ok(FALSE, "GetClassInfo (0) failed for global class!\n");
+
+    if (GetClassInfoEx(NULL,"Edit",&wcx))
+        #ifdef _WIN64
+        ok(8 == wcx.cbWndExtra, "expected 8, got %d\n", wcx.cbWndExtra);
+        #else
+todo_wine {
+        ok(6  == wcx.cbWndExtra || broken(8 == wcx.cbWndExtra), "expected 6, 
got %d\n", wcx.cbWndExtra); // Windows XP 64-bit returns 8
+}
+        #endif
+    else
+        ok(FALSE, "GetClassInfo (0) failed for global class!\n");
+}
+
 START_TEST(class)
 {
     HANDLE hInstance = GetModuleHandleA( NULL );
 
+    test_extra_values();
+
     if (!GetModuleHandleW(0))
     {
         trace("Class test is incompatible with Win9x implementation, 
skipping\n");
-- 
1.6.0.4



Reply via email to