From 743c266e6496345d0a55c83b0cfc741b0f381d4e Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Wed, 25 Nov 2020 17:04:15 +0200 Subject: [PATCH] plugplay: Send WM_DEVICECHANGE with DBT_DEVNODES_CHANGED with each event. Windows sends *a lot* of those messages whenever there's a device / drive / etc. appearing or disappearing. This fixes controller hotplug in Doom (2016). Signed-off-by: Arkadiusz Hiler Signed-off-by: Alexandre Julliard --- programs/plugplay/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/programs/plugplay/main.c b/programs/plugplay/main.c index 2c4054de3e4..19e02286312 100644 --- a/programs/plugplay/main.c +++ b/programs/plugplay/main.c @@ -19,6 +19,7 @@ #define WIN32_LEAN_AND_MEAN #include +#include #include "winsvc.h" #include "wine/debug.h" #include "wine/list.h" @@ -142,6 +143,7 @@ void __cdecl plugplay_send_event( DWORD code, const BYTE *data, unsigned int siz struct event *event; BroadcastSystemMessageW( BSF_FORCEIFHUNG | BSF_QUERY, NULL, WM_DEVICECHANGE, code, (LPARAM)data ); + BroadcastSystemMessageW( BSF_FORCEIFHUNG | BSF_QUERY, NULL, WM_DEVICECHANGE, DBT_DEVNODES_CHANGED, 0 ); EnterCriticalSection( &plugplay_cs );