Dmitry Timoshkov wrote:
"Julius Schwartzenberg" julius.schwartzenberg@gmail.com wrote:
This obviously won't work for 64-bit. I'd suggest to make extra 2 * sizeof(void *). and add a comment about compatibility.
ok(cls.cbWndExtra > sizeof(void *), "blah ...\n") doesn't require any intermediate variables.
Thanks for your feedback! I turns out however that Civilization II crashes with anything other than 6, so I used an IFDEF to check for 64-bit as advised on IRC. The 64-bit version of Windows XP returns 8 instead of 6 and Civilization II crashes at exactly the same point as Wine in it.
I've attached a new version and split the test and the patch. The test will fail on 64-bit Windows XP however, just like Civilization II. What is the best way to cope with this?
I also wondered whether it wouldn't be good to also test the extra values of the other standard classes instead of just the edit class. I created a table which shows all the return values for different Windows versions & Wine: http://haar.student.utwente.nl/~julius/extra_value_table
To my eyes it seems the edit class is the only candidate that needs a test, but maybe someone more experienced could judge the table. In case other classes may also cause problems I will also add tests for those.
Julius
From cba35b6ba1a5deb18f721780181907050091c596 Mon Sep 17 00:00:00 2001 From: Julius Schwartzenberg julius.schwartzenberg@gmail.com Date: Tue, 6 Oct 2009 22:59:54 +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..e1159f9 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 sizeof(EDITSTATE *) +#else +#define EDIT_EXTRA_VALUE 6 /* This has to be 6 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 */ + EDIT_EXTRA_VALUE, /* extra */ IDC_IBEAM, /* cursor */ 0 /* brush */ }; +#undef EDIT_EXTRA_VALUE