From: Akihiro Sagawa Subject: user.exe: Release the Win16 lock due to loading 32-bit dlls in CreateWindow. Message-Id: <20150803234731.FF78.375B48EC@gmail.com> Date: Mon, 03 Aug 2015 23:48:47 +0900 This fixes dead locks in Nocturnal Illusions, see bug #20521 for details. --- dlls/user.exe16/message.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/user.exe16/message.c b/dlls/user.exe16/message.c index 935b025..b5d9225 100644 --- a/dlls/user.exe16/message.c +++ b/dlls/user.exe16/message.c @@ -2648,11 +2648,17 @@ static DWORD wait_message16( DWORD count, const HANDLE *handles, DWORD timeout, */ HWND create_window16( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE instance, BOOL unicode ) { + DWORD lock; + HWND ret; + /* map to module handle */ if (instance && !((ULONG_PTR)instance >> 16)) instance = HINSTANCE_32( GetExePtr( HINSTANCE_16(instance) )); - return wow_handlers32.create_window( cs, className, instance, unicode ); + ReleaseThunkLock( &lock ); + ret = wow_handlers32.create_window( cs, className, instance, unicode ); + RestoreThunkLock( lock ); + return ret; }