From: Bernhard Übelacker bernhardu@mailbox.org
This is to avoid a crash in UnregisterDeviceNotification when called a second time for the same handle.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58050 --- dlls/joy.cpl/dinput.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/joy.cpl/dinput.c b/dlls/joy.cpl/dinput.c index 8eefbbbe3f3..a536fd167a1 100644 --- a/dlls/joy.cpl/dinput.c +++ b/dlls/joy.cpl/dinput.c @@ -806,7 +806,9 @@ INT_PTR CALLBACK test_di_dialog_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM
case PSN_RESET: case PSN_KILLACTIVE: + if (!devnotify) break; UnregisterDeviceNotification( devnotify ); + devnotify = NULL; SetEvent( thread_stop ); /* wait for the input thread to stop, processing any WM_USER message from it */ while (MsgWaitForMultipleObjects( 1, &thread, FALSE, INFINITE, QS_ALLINPUT ) == 1)