[MOUNTMGR] Fix MountState usage in MountMgrTargetDeviceNotification
authorPierre Schweitzer <pierre@reactos.org>
Fri, 13 Sep 2019 18:04:53 +0000 (20:04 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Fri, 13 Sep 2019 18:08:39 +0000 (20:08 +0200)
CORE-13882

drivers/filters/mountmgr/notify.c

index 8b7c676..97bc947 100644 (file)
@@ -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)