[PATCH v2 0/1] MR8323: wow64win: Fix UNICODE_STRING thunking in wow64_NtUserRegisterWindowMessage.
The function was passing a 32-bit `UNICODE_STRING` pointer directly to the 64-bit function, causing string corruption. Use the `unicode_str_32to64()` helper like other similar functions. This fixes 32-bit .NET Framework applications failing to create windows, such as [dnSpyEx v6.5.1 (x86)](https://github.com/dnSpyEx/dnSpy/releases/tag/v6.5.1), when using a new-style WoW64 build. Fixes: 73f4aeb2dcc33abd2f3ee02ee8fc1042d1998399 -- v2: wow64win: Fix UNICODE_STRING thunking in wow64_NtUserRegisterWindowMessage. https://gitlab.winehq.org/wine/wine/-/merge_requests/8323
From: William Horvath <william(a)horvath.blog> The function was passing a 32-bit UNICODE_STRING pointer directly to the 64-bit function, causing string corruption. Use the unicode_str_32to64() helper like other similar functions. This fixes 32-bit .NET Framework applications failing to create windows, such as dnSpyEx v6.5.1 (x86), when using a new-style WoW64 build. Fixes: 73f4aeb2dcc33abd2f3ee02ee8fc1042d1998399 --- dlls/wow64win/user.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 318adde06fe..febd9e8d038 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -4081,9 +4081,10 @@ NTSTATUS WINAPI wow64_NtUserRemoveClipboardFormatListener( UINT *args ) NTSTATUS WINAPI wow64_NtUserRegisterWindowMessage( UINT *args ) { - UNICODE_STRING *name = get_ptr( &args ); + UNICODE_STRING32 *name32 = get_ptr( &args ); + UNICODE_STRING name; - return NtUserRegisterWindowMessage( name ); + return NtUserRegisterWindowMessage( unicode_str_32to64( &name, name32 )); } NTSTATUS WINAPI wow64_NtUserRemoveMenu( UINT *args ) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8323
removed an extra space (sorry for wasting CI resources, but someone would have brought it up otherwise...) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8323#note_106567
Well fwiw I would have kept the space for balance but doesn't matter. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8323#note_106568
This merge request was approved by Rémi Bernon. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8323
participants (3)
-
Rémi Bernon -
William Horvath -
William Horvath (@whrvt)