mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
[UMPNPMGR]
Broadcast a WM_DEVICECHANGE message on device arrrival and removal. CORE-12977 svn path=/trunk/; revision=74259
This commit is contained in:
parent
667ce623d5
commit
15a480bb44
2 changed files with 30 additions and 2 deletions
|
@ -12,5 +12,5 @@ add_library(umpnpmgr SHARED
|
||||||
|
|
||||||
target_link_libraries(umpnpmgr wdmguid ${PSEH_LIB})
|
target_link_libraries(umpnpmgr wdmguid ${PSEH_LIB})
|
||||||
set_module_type(umpnpmgr win32dll UNICODE)
|
set_module_type(umpnpmgr win32dll UNICODE)
|
||||||
add_importlibs(umpnpmgr advapi32 rpcrt4 userenv shlwapi msvcrt kernel32 ntdll)
|
add_importlibs(umpnpmgr advapi32 rpcrt4 userenv shlwapi msvcrt user32 kernel32 ntdll)
|
||||||
add_cd_file(TARGET umpnpmgr DESTINATION reactos/system32 FOR all)
|
add_cd_file(TARGET umpnpmgr DESTINATION reactos/system32 FOR all)
|
||||||
|
|
|
@ -37,6 +37,8 @@
|
||||||
#include <winbase.h>
|
#include <winbase.h>
|
||||||
#include <winreg.h>
|
#include <winreg.h>
|
||||||
#include <winsvc.h>
|
#include <winsvc.h>
|
||||||
|
#include <winuser.h>
|
||||||
|
#include <dbt.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <cmfuncs.h>
|
#include <cmfuncs.h>
|
||||||
#include <rtlfuncs.h>
|
#include <rtlfuncs.h>
|
||||||
|
@ -3563,8 +3565,16 @@ PnpEventThread(LPVOID lpParameter)
|
||||||
}
|
}
|
||||||
else if (UuidEqual(&PnpEvent->EventGuid, (UUID*)&GUID_DEVICE_ARRIVAL, &RpcStatus))
|
else if (UuidEqual(&PnpEvent->EventGuid, (UUID*)&GUID_DEVICE_ARRIVAL, &RpcStatus))
|
||||||
{
|
{
|
||||||
|
DWORD dwRecipient;
|
||||||
|
|
||||||
DPRINT("Device arrival: %S\n", PnpEvent->TargetDevice.DeviceIds);
|
DPRINT("Device arrival: %S\n", PnpEvent->TargetDevice.DeviceIds);
|
||||||
/* FIXME: ? */
|
|
||||||
|
dwRecipient = BSM_ALLDESKTOPS | BSM_APPLICATIONS;
|
||||||
|
BroadcastSystemMessageW(BSF_POSTMESSAGE,
|
||||||
|
&dwRecipient,
|
||||||
|
WM_DEVICECHANGE,
|
||||||
|
DBT_DEVNODES_CHANGED,
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
else if (UuidEqual(&PnpEvent->EventGuid, (UUID*)&GUID_DEVICE_EJECT_VETOED, &RpcStatus))
|
else if (UuidEqual(&PnpEvent->EventGuid, (UUID*)&GUID_DEVICE_EJECT_VETOED, &RpcStatus))
|
||||||
{
|
{
|
||||||
|
@ -3576,11 +3586,29 @@ PnpEventThread(LPVOID lpParameter)
|
||||||
}
|
}
|
||||||
else if (UuidEqual(&PnpEvent->EventGuid, (UUID*)&GUID_DEVICE_SAFE_REMOVAL, &RpcStatus))
|
else if (UuidEqual(&PnpEvent->EventGuid, (UUID*)&GUID_DEVICE_SAFE_REMOVAL, &RpcStatus))
|
||||||
{
|
{
|
||||||
|
DWORD dwRecipient;
|
||||||
|
|
||||||
DPRINT1("Safe removal: %S\n", PnpEvent->TargetDevice.DeviceIds);
|
DPRINT1("Safe removal: %S\n", PnpEvent->TargetDevice.DeviceIds);
|
||||||
|
|
||||||
|
dwRecipient = BSM_ALLDESKTOPS | BSM_APPLICATIONS;
|
||||||
|
BroadcastSystemMessageW(BSF_POSTMESSAGE,
|
||||||
|
&dwRecipient,
|
||||||
|
WM_DEVICECHANGE,
|
||||||
|
DBT_DEVNODES_CHANGED,
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
else if (UuidEqual(&PnpEvent->EventGuid, (UUID*)&GUID_DEVICE_SURPRISE_REMOVAL, &RpcStatus))
|
else if (UuidEqual(&PnpEvent->EventGuid, (UUID*)&GUID_DEVICE_SURPRISE_REMOVAL, &RpcStatus))
|
||||||
{
|
{
|
||||||
|
DWORD dwRecipient;
|
||||||
|
|
||||||
DPRINT1("Surprise removal: %S\n", PnpEvent->TargetDevice.DeviceIds);
|
DPRINT1("Surprise removal: %S\n", PnpEvent->TargetDevice.DeviceIds);
|
||||||
|
|
||||||
|
dwRecipient = BSM_ALLDESKTOPS | BSM_APPLICATIONS;
|
||||||
|
BroadcastSystemMessageW(BSF_POSTMESSAGE,
|
||||||
|
&dwRecipient,
|
||||||
|
WM_DEVICECHANGE,
|
||||||
|
DBT_DEVNODES_CHANGED,
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
else if (UuidEqual(&PnpEvent->EventGuid, (UUID*)&GUID_DEVICE_REMOVAL_VETOED, &RpcStatus))
|
else if (UuidEqual(&PnpEvent->EventGuid, (UUID*)&GUID_DEVICE_REMOVAL_VETOED, &RpcStatus))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue