This fixes the regressions mentioned in the following bugs
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53568 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53646
From: Sven Baars sbaars@codeweavers.com
send_message_timeout ignores the ansi argument.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53568 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53646 --- dlls/win32u/message.c | 4 ++-- dlls/win32u/win32u_private.h | 2 ++ dlls/win32u/window.c | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 8db81a57065..276d5a75f81 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2982,8 +2982,8 @@ BOOL kill_system_timer( HWND hwnd, UINT_PTR id ) return ret; }
-static LRESULT send_window_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, - struct win_proc_params *client_params, BOOL ansi ) +LRESULT send_window_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, + struct win_proc_params *client_params, BOOL ansi ) { struct send_message_info info; DWORD_PTR res = 0; diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 8fc00cf3296..ddd42321291 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -308,6 +308,8 @@ extern LRESULT send_internal_message_timeout( DWORD dest_pid, DWORD dest_tid, UI PDWORD_PTR res_ptr ) DECLSPEC_HIDDEN; extern LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN; extern BOOL send_notify_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL ansi ) DECLSPEC_HIDDEN; +extern LRESULT send_window_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, + struct win_proc_params *client_params, BOOL ansi ); extern LRESULT send_message_timeout( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, UINT flags, UINT timeout, BOOL ansi );
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index d6fabff2cf1..a64a6220026 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -5208,7 +5208,7 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, /* send WM_NCCREATE */
TRACE( "hwnd %p cs %d,%d %dx%d %s\n", hwnd, cs.x, cs.y, cs.cx, cs.cy, wine_dbgstr_rect(&rect) ); - if (!send_message_timeout( hwnd, WM_NCCREATE, 0, (LPARAM)&cs, SMTO_NORMAL, 0, ansi )) + if (!send_window_message( hwnd, WM_NCCREATE, 0, (LPARAM)&cs, NULL, ansi )) { WARN( "%p: aborted by WM_NCCREATE\n", hwnd ); goto failed; @@ -5240,7 +5240,7 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, else goto failed;
/* send WM_CREATE */ - if (send_message_timeout( hwnd, WM_CREATE, 0, (LPARAM)&cs, SMTO_NORMAL, 0, ansi ) == -1) + if (send_window_message( hwnd, WM_CREATE, 0, (LPARAM)&cs, NULL, ansi ) == -1) goto failed;
/* call the driver */
From: Sven Baars sbaars@codeweavers.com
This partially reverts e41c255be6ba66d1eec7affe674b8cc7699226b8.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53568 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53646 --- dlls/user32/win.c | 4 +++- dlls/win32u/window.c | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/win.c b/dlls/user32/win.c index d8869b2b9db..5682fe58f7b 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -281,6 +281,7 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module, UNICODE_STRING class, window_name = {0}; HWND hwnd, top_child = 0; MDICREATESTRUCTW mdi_cs; + CBT_CREATEWNDW cbtc; WNDCLASSEXW info; WCHAR name_buf[8]; HMENU menu; @@ -397,9 +398,10 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module, if (!menu && info.lpszMenuName && (cs->style & (WS_CHILD | WS_POPUP)) != WS_CHILD) menu = LoadMenuW( cs->hInstance, info.lpszMenuName );
+ cbtc.lpcs = cs; hwnd = NtUserCreateWindowEx( cs->dwExStyle, &class, NULL, &window_name, cs->style, cs->x, cs->y, cs->cx, cs->cy, cs->hwndParent, menu, module, - cs->lpCreateParams, 0, NULL, 0, !unicode ); + cs->lpCreateParams, 0, &cbtc, 0, !unicode ); if (!hwnd && menu && menu != cs->hMenu) NtUserDestroyMenu( menu ); if (!unicode && window_name.Buffer != name_buf) RtlFreeUnicodeString( &window_name ); return hwnd; diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index a64a6220026..b6bea6f89d6 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -5035,14 +5035,24 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name,
static const WCHAR messageW[] = {'M','e','s','s','a','g','e'};
+ if (client_cbtc) + { + cs.lpszName = client_cbtc->lpcs->lpszName; /* strings may be ansi */ + cs.lpszClass = client_cbtc->lpcs->lpszClass; + cs.hInstance = client_cbtc->lpcs->hInstance; /* may be different than instance for win16 */ + } + else + { + cs.lpszName = window_name ? window_name->Buffer : NULL; + cs.lpszClass = class_name->Buffer; + cs.hInstance = instance; + } + cs.lpCreateParams = params; - cs.hInstance = instance; cs.hMenu = menu; cs.hwndParent = parent; cs.style = style; cs.dwExStyle = ex_style; - cs.lpszName = window_name ? window_name->Buffer : NULL; - cs.lpszClass = class_name ? class_name->Buffer : NULL; cs.x = x; cs.y = y; cs.cx = cx;
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=127242
Your paranoid android.
=== debian11 (32 bit report) ===
comctl32: static.c:297: Test failed: got NULL static.c:170: Test failed: got 3 static.c:171: Test failed: got 7666984 static.c:172: Test failed: got 0 static.c:178: Test failed: bits: 00 00 00 00 static.c:207: Test failed: bits: 00 00 00 00
msvfw32: mciwnd.c:278: Test failed: unexpected match 0 mciwnd.c:278: Test failed: bad open message 1 0 mciwnd.c:289: Test failed: unexpected match 0 mciwnd.c:289: Test failed: bad open message 1 0 mciwnd.c:302: Test failed: unexpected match 0 mciwnd.c:302: Test failed: bad open message 2 0
user32: msg.c:19413: Test failed: name param = L"\00ff\0000"
wmvcore: wmvcore.c:529: Test failed: got wrong thread
=== debian11 (32 bit zh:CN report) ===
user32: msg.c:19413: Test failed: name param = L"\f8f5\0000"
=== debian11b (64 bit WoW report) ===
user32: msg.c:19413: Test failed: name param = L"\00ff\0000"
Jacek Caban (@jacek) commented about dlls/user32/win.c:
if (!menu && info.lpszMenuName && (cs->style & (WS_CHILD | WS_POPUP)) != WS_CHILD) menu = LoadMenuW( cs->hInstance, info.lpszMenuName );
- cbtc.lpcs = cs; hwnd = NtUserCreateWindowEx( cs->dwExStyle, &class, NULL, &window_name, cs->style, cs->x, cs->y, cs->cx, cs->cy, cs->hwndParent, menu, module,
cs->lpCreateParams, 0, NULL, 0, !unicode );
cs->lpCreateParams, 0, &cbtc, 0, !unicode );
This is problematic for wow64. Also, in addition to test failures reported by testbot, here are a few more tests I wrote a while ago: https://testbot.winehq.org/JobDetails.pl?Key=127248 Although Windows seems to preserve name pointers for WM_NCCREATE, it's not preserved for WM_CREATE, so we can't really depend on that.