[MOUNTMGR] Fix MountState usage in MountMgrTargetDeviceNotification

CORE-13882
This commit is contained in:
Pierre Schweitzer 2019-09-13 20:04:53 +02:00
parent 5c678a76a6
commit 0a5f86d44a
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View 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)