Module: wine Branch: master Commit: f8a0716111d01c36613a3fcc221353efd8f7ca1e URL: https://gitlab.winehq.org/wine/wine/-/commit/f8a0716111d01c36613a3fcc221353e...
Author: Sven Baars sbaars@codeweavers.com Date: Tue Dec 6 18:32:01 2022 +0100
win32u: Pass the client instance to NtUserCreateWindowEx.
On 16-bit the module instance and client instance are different.
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 | 2 +- dlls/win32u/window.c | 4 ++-- dlls/wow64win/user.c | 4 ++-- include/ntuser.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/user32/win.c b/dlls/user32/win.c index d8869b2b9db..150c334b9d8 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -399,7 +399,7 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module,
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, cs->hInstance, 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 d6fabff2cf1..9a8963ce2a1 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -5022,7 +5022,7 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, UNICODE_STRING *version, UNICODE_STRING *window_name, DWORD style, INT x, INT y, INT cx, INT cy, HWND parent, HMENU menu, HINSTANCE instance, void *params, - DWORD flags, CBT_CREATEWNDW *client_cbtc, DWORD unk, BOOL ansi ) + DWORD flags, HINSTANCE client_instance, DWORD unk, BOOL ansi ) { UINT win_dpi, thread_dpi = get_thread_dpi(); DPI_AWARENESS_CONTEXT context; @@ -5036,7 +5036,7 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, static const WCHAR messageW[] = {'M','e','s','s','a','g','e'};
cs.lpCreateParams = params; - cs.hInstance = instance; + cs.hInstance = client_instance ? client_instance : instance; cs.hMenu = menu; cs.hwndParent = parent; cs.style = style; diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 447e8f84495..afc73ca1322 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -1471,7 +1471,7 @@ NTSTATUS WINAPI wow64_NtUserCreateWindowEx( UINT *args ) HINSTANCE instance = get_handle( &args ); void *params = get_ptr( &args ); DWORD flags = get_ulong( &args ); - void *cbtc = get_ptr( &args ); + HINSTANCE client_instance = get_handle( &args ); DWORD unk = get_ulong( &args ); BOOL ansi = get_ulong( &args );
@@ -1483,7 +1483,7 @@ NTSTATUS WINAPI wow64_NtUserCreateWindowEx( UINT *args ) unicode_str_32to64( &version, version32 ), unicode_str_32to64( &window_name, window_name32 ), style, x, y, width, height, parent, menu, - instance, params, flags, cbtc, unk, ansi ); + instance, params, flags, client_instance, unk, ansi ); return HandleToUlong( ret ); }
diff --git a/include/ntuser.h b/include/ntuser.h index b83ae2418d3..3c41e435712 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -678,7 +678,7 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, UNICODE_STRING *version, UNICODE_STRING *window_name, DWORD style, INT x, INT y, INT cx, INT cy, HWND parent, HMENU menu, HINSTANCE instance, void *params, - DWORD flags, CBT_CREATEWNDW *cbtc, DWORD unk, BOOL ansi ); + DWORD flags, HINSTANCE client_instance, DWORD unk, BOOL ansi ); HWINSTA WINAPI NtUserCreateWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK mask, ULONG arg3, ULONG arg4, ULONG arg5, ULONG arg6, ULONG arg7 ); HDWP WINAPI NtUserDeferWindowPosAndBand( HDWP hdwp, HWND hwnd, HWND after, INT x, INT y,