From 7addca95b5b9f960171a5673490d4d23c646ea90 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Tue, 5 May 2020 11:25:41 -0500 Subject: [PATCH] ntoskrnl.exe: Move the BroadcastSystemMessage() call to plugplay_send_event(). Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/ntoskrnl.exe/Makefile.in | 2 +- dlls/ntoskrnl.exe/pnp.c | 1 - programs/plugplay/Makefile.in | 2 +- programs/plugplay/main.c | 2 ++ 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/ntoskrnl.exe/Makefile.in b/dlls/ntoskrnl.exe/Makefile.in index 85bc1ce6987..df48e44ede9 100644 --- a/dlls/ntoskrnl.exe/Makefile.in +++ b/dlls/ntoskrnl.exe/Makefile.in @@ -1,7 +1,7 @@ MODULE = ntoskrnl.exe IMPORTLIB = ntoskrnl IMPORTS = advapi32 hal msvcrt -DELAYIMPORTS = rpcrt4 setupapi user32 +DELAYIMPORTS = rpcrt4 setupapi EXTRADLLFLAGS = -mno-cygwin diff --git a/dlls/ntoskrnl.exe/pnp.c b/dlls/ntoskrnl.exe/pnp.c index 470e2368fb5..91b825dffc6 100644 --- a/dlls/ntoskrnl.exe/pnp.c +++ b/dlls/ntoskrnl.exe/pnp.c @@ -670,7 +670,6 @@ static LONG WINAPI rpc_filter( EXCEPTION_POINTERS *eptr ) static void send_devicechange( DWORD code, void *data, unsigned int size ) { - BroadcastSystemMessageW( BSF_FORCEIFHUNG | BSF_QUERY, NULL, WM_DEVICECHANGE, code, (LPARAM)data ); __TRY { plugplay_send_event( code, data, size ); diff --git a/programs/plugplay/Makefile.in b/programs/plugplay/Makefile.in index 1bc2aa505ab..001d81597f7 100644 --- a/programs/plugplay/Makefile.in +++ b/programs/plugplay/Makefile.in @@ -1,5 +1,5 @@ MODULE = plugplay.exe -IMPORTS = advapi32 rpcrt4 +IMPORTS = advapi32 rpcrt4 user32 EXTRADLLFLAGS = -mconsole -municode -mno-cygwin diff --git a/programs/plugplay/main.c b/programs/plugplay/main.c index 00af2b0adfa..8e007048422 100644 --- a/programs/plugplay/main.c +++ b/programs/plugplay/main.c @@ -141,6 +141,8 @@ void __cdecl plugplay_send_event( DWORD code, const BYTE *data, unsigned int siz struct listener *listener; struct event *event; + BroadcastSystemMessageW( BSF_FORCEIFHUNG | BSF_QUERY, NULL, WM_DEVICECHANGE, code, (LPARAM)data ); + EnterCriticalSection( &plugplay_cs ); LIST_FOR_EACH_ENTRY(listener, &listener_list, struct listener, entry)