"Mikolaj Zalewski" mikolaj@zalewski.pl wrote:
--- a/dlls/user32/tests/class.c +++ b/dlls/user32/tests/class.c @@ -32,6 +32,7 @@ #include "winreg.h" #include "wingdi.h" #include "winuser.h" +#include <commctrl.h> /* for WC_EDITW */
Besides using braces instead of quotes to match existing style it's not really nice to include commctrl.h in a user32 (more lower level) test. It shouldn't be too hard to add "Edit" in WCHAR notation.
/*********************************************************************** */ static void ClassTest(HINSTANCE hInstance, BOOL global) @@ -560,7 +566,12 @@ static void test_defwndproc() { static const char classA[] = "deftest"; static const WCHAR classW[] = {'d','e','f','t','e','s','t',0};
- WCHAR unistring[] = {0x142, 0x40e, 0x3b4, 0}; /* a string that would be destoryed by a W->A->W conversion */
Any other string should work just fine. In the current form the test will fail for some locales.
diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index 27b31a1..4feb3d5 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -2257,7 +2257,17 @@ LRESULT WINAPI CallWindowProcA(
if (!func) return 0;
- if (!(proc = handle_to_proc( func )) && !(proc = find_builtin_proc( func )))
- /* for built-in procs we do as if the second item was a thunk */
- if ((proc = find_builtin_proc( func )) != NULL)
- {
- if (func == proc->procA || !IsWindowUnicode( hwnd ))
call_window_proc( hwnd, msg, wParam, lParam, &result, proc->procA );
- else
call_window_proc( hwnd, msg, wParam, lParam, &result, proc->procW );
- return result;
- }
- if (!(proc = handle_to_proc( func ))) call_window_proc( hwnd, msg, wParam, lParam, &result, func ); else if (proc->procA) call_window_proc( hwnd, msg, wParam, lParam, &result, proc->procA );
@@ -2281,8 +2291,18 @@ LRESULT WINAPI CallWindowProcW( WNDPROC func, HWND hwnd, UINT msg, LRESULT result;
if (!func) return 0;
- /* for built-in procs we do as if the second item was a thunk */
- if ((proc = find_builtin_proc( func )) != NULL)
- {
- if (func == proc->procW || IsWindowUnicode( hwnd ))
call_window_proc( hwnd, msg, wParam, lParam, &result, proc->procW );
- else
call_window_proc( hwnd, msg, wParam, lParam, &result, proc->procA );
- return result;
- }
- if (!(proc = handle_to_proc( func )) && !(proc = find_builtin_proc( func )))
- if (!(proc = handle_to_proc( func ))) call_window_proc( hwnd, msg, wParam, lParam, &result, func ); else if (proc->procW) call_window_proc( hwnd, msg, wParam, lParam, &result, proc->procW );
@@ -2340,7 +2360,17 @@ INT_PTR WINPROC_CallDlgProcA( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam,
if (!func) return 0;
- if (!(proc = handle_to_proc( func )) && !(proc = find_builtin_proc( func )))
- /* for built-in procs we do as if the second item was a thunk */
- if ((proc = find_builtin_proc( func )) != NULL)
- {
- if (func == proc->procA || !IsWindowUnicode( hwnd ))
call_dialog_proc( hwnd, msg, wParam, lParam, &result, proc->procA );
- else
call_dialog_proc( hwnd, msg, wParam, lParam, &result, proc->procW );
- return result;
- }
- if (!(proc = handle_to_proc( func ))) ret = call_dialog_proc( hwnd, msg, wParam, lParam, &result, func ); else if (proc->procA) ret = call_dialog_proc( hwnd, msg, wParam, lParam, &result, proc->procA );
@@ -2368,8 +2398,18 @@ INT_PTR WINPROC_CallDlgProcW( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam, INT_PTR ret;
if (!func) return 0;
- /* for built-in procs we do as if the second item was a thunk */
- if ((proc = find_builtin_proc( func )) != NULL)
- {
- if (func == proc->procW || IsWindowUnicode( hwnd ))
call_dialog_proc( hwnd, msg, wParam, lParam, &result, proc->procW );
- else
call_dialog_proc( hwnd, msg, wParam, lParam, &result, proc->procA );
- return result;
- }
Please use spaces instead of tabs to match current formatting.
static const char classA[] = "deftest"; static const WCHAR classW[] = {'d','e','f','t','e','s','t',0};
- WCHAR unistring[] = {0x142, 0x40e, 0x3b4, 0}; /* a string that
would be destoryed by a W->A->W conversion */
Any other string should work just fine. In the current form the test will fail for some locales.
It will work as this string is never converted to ANSI. On the other hand if there is a conversion to ANSI I expect it to fail on any locale as the characters are chosen each from a different script. And that's why this string was chosen - to show that we shouldn't try to convert the result of the ANSI function but call the wide function directly. As for the other suggestions I'll send soon an improved patch.
Mikolaj Zalewski