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
-- v2: user.exe16: Set the right instance after creating a window.
From: Sven Baars sbaars@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53568 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53646 --- dlls/user.exe16/message.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/user.exe16/message.c b/dlls/user.exe16/message.c index 9af217bf5f1..a4d0596bf8e 100644 --- a/dlls/user.exe16/message.c +++ b/dlls/user.exe16/message.c @@ -2573,11 +2573,19 @@ static LRESULT static_proc16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, */ HWND create_window16( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE instance, BOOL unicode ) { + HINSTANCE module = instance; + HWND hwnd; + /* map to module handle */ if (instance && !((ULONG_PTR)instance >> 16)) - instance = HINSTANCE_32( GetExePtr( HINSTANCE_16(instance) )); + module = HINSTANCE_32( GetExePtr( HINSTANCE_16(instance) )); + + hwnd = wow_handlers32.create_window( cs, className, module, unicode );\ + + if (hwnd) + SetWindowLongPtrW( hwnd, GWLP_HINSTANCE, instance );
- return wow_handlers32.create_window( cs, className, instance, unicode ); + return hwnd; }