https://git.reactos.org/?p=reactos.git;a=commitdiff;h=62a4f9d42b6e43c1f84cb5...
commit 62a4f9d42b6e43c1f84cb5d999b6e79e5d5bbb2a Author: Victor Perevertkin victor.perevertkin@reactos.org AuthorDate: Sun Dec 27 18:35:52 2020 +0300 Commit: Victor Perevertkin victor.perevertkin@reactos.org CommitDate: Sun Dec 27 18:35:52 2020 +0300
[MOUNTMGR] Do not handle device removal notification
Do not treat target device change notification as DEVICE_INTERFACE_CHANGE_NOTIFICATION. The notification have to be unregistered while handling GUID_DEVICE_INTERFACE_REMOVAL, so GUID_TARGET_DEVICE_REMOVE_COMPLETE should never be sent to mountmgr in a normal case.
CORE-16106 --- drivers/storage/mountmgr/notify.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/storage/mountmgr/notify.c b/drivers/storage/mountmgr/notify.c index 2c7a05dbc88..262f40ca565 100644 --- a/drivers/storage/mountmgr/notify.c +++ b/drivers/storage/mountmgr/notify.c @@ -231,21 +231,19 @@ MountMgrTargetDeviceNotification(IN PVOID NotificationStructure, { PDEVICE_EXTENSION DeviceExtension; PDEVICE_INFORMATION DeviceInformation; - PDEVICE_INTERFACE_CHANGE_NOTIFICATION Notification; + PTARGET_DEVICE_CUSTOM_NOTIFICATION Notification;
DeviceInformation = Context; DeviceExtension = DeviceInformation->DeviceExtension; Notification = NotificationStructure;
- /* If it's to signal that removal is complete, then, execute the function */ - if (IsEqualGUID(&(Notification->Event), &GUID_TARGET_DEVICE_REMOVE_COMPLETE)) - { - MountMgrMountedDeviceRemoval(DeviceExtension, Notification->SymbolicLinkName); - } + /* The notification have to be unregistered already (in device interface change handler) */ + ASSERT(!IsEqualGUID(&Notification->Event, &GUID_TARGET_DEVICE_REMOVE_COMPLETE)); + /* It it's to signal that a volume has been mounted * Verify if a database sync is required and execute it */ - else if (IsEqualGUID(&(Notification->Event), &GUID_IO_VOLUME_MOUNT)) + if (IsEqualGUID(&(Notification->Event), &GUID_IO_VOLUME_MOUNT)) { /* If we were already mounted, then mark us unmounted */ if (InterlockedCompareExchange(&(DeviceInformation->MountState),