http://bugs.winehq.org/show_bug.cgi?id=60559 Bug ID: 60559 Summary: dinput: Acquire() dispatches messages sent from other threads (Sudden Strike Gold crashes) Product: Wine Version: 11.20 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: dinput Assignee: wine-bugs@list.winehq.org Reporter: winehqbmw@lsmod.de Target Milestone: --- Distribution: --- Created attachment 82424 --> http://bugs.winehq.org/attachment.cgi?id=82424 reproducer source Sudden Strike Gold (Steam 612300) crashes at startup with Proton 8.0 and later, with a NULL pointer read in Menu_Dll.dll. Proton 7.0 works a bit better, but has random crashes later. The crash happens when another process sends a message to the game window while the game is inside IDirectInputDevice::Acquire. Proton 8+ runs tabtip.exe, which sends WM_GETOBJECT to the focused window. In Wine, Acquire sends a message to dinput's internal input thread and waits for the reply. While it waits, it dispatches messages sent to the calling thread, so the game's window procedure runs from inside Acquire. The game doesn't expect that, and its startup ends up in a broken state. Unacquire behaves the same way. Native dinput doesn't do this. I checked on Windows XP SP3 with dinput versions 3, 5, 7 and 8, keyboard and mouse, foreground and background. The attached repro.c (produces repro.exe) sends WM_USER to its window from a second thread, calls Acquire, and prints how many times the window procedure ran during the call: Windows XP SP3: messages dispatched inside Acquire: 0 Wine 11.20 / Proton 10: messages dispatched inside Acquire: 1 The crash can be reproduced in plain Wine without tabtip.exe by running any program that repeatedly sends WM_GETOBJECT to the game window while it starts. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.