From: Pierre Schweitzer Date: Fri, 13 Sep 2019 18:04:53 +0000 (+0200) Subject: [MOUNTMGR] Fix MountState usage in MountMgrTargetDeviceNotification X-Git-Tag: 0.4.14-dev~140 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=0a5f86d44a0ecf01d087d93a3ee7237e1aaa9430 [MOUNTMGR] Fix MountState usage in MountMgrTargetDeviceNotification CORE-13882 --- diff --git a/drivers/filters/mountmgr/notify.c b/drivers/filters/mountmgr/notify.c index 8b7c676da2a..97bc9470376 100644 --- a/drivers/filters/mountmgr/notify.c +++ b/drivers/filters/mountmgr/notify.c @@ -247,12 +247,14 @@ MountMgrTargetDeviceNotification(IN PVOID NotificationStructure, */ else if (IsEqualGUID(&(Notification->Event), &GUID_IO_VOLUME_MOUNT)) { + /* If we were already mounted, then mark us unmounted */ if (InterlockedCompareExchange(&(DeviceInformation->MountState), FALSE, - TRUE) == TRUE) + FALSE) == TRUE) { InterlockedDecrement(&(DeviceInformation->MountState)); } + /* Otherwise, start mounting the device and first, reconcile its DB if required */ else { if (DeviceInformation->NeedsReconcile)