[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
This commit is contained in:
Victor Perevertkin 2020-12-27 18:35:52 +03:00
parent 89f36bcfc8
commit 62a4f9d42b
No known key found for this signature in database
GPG key ID: C750B7222E9C7830

View file

@ -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),