[MOUNTMGR] Avoid an endless loop while sending GUID_IO_VOLUME_NAME_CHANGE notification
authorVictor Perevertkin <victor.perevertkin@reactos.org>
Sat, 1 Aug 2020 01:58:08 +0000 (04:58 +0300)
committerVictor Perevertkin <victor.perevertkin@reactos.org>
Sat, 1 Aug 2020 01:58:08 +0000 (04:58 +0300)
drivers/filters/mountmgr/notify.c

index 9a1e788..2c7a05d 100644 (file)
@@ -370,8 +370,9 @@ MountMgrNotifyNameChange(IN PDEVICE_EXTENSION DeviceExtension,
     if (ValidateVolume)
     {
         /* Then, ensure we can find the device */
     if (ValidateVolume)
     {
         /* Then, ensure we can find the device */
-        NextEntry = DeviceExtension->DeviceListHead.Flink;
-        while (NextEntry != &(DeviceExtension->DeviceListHead))
+        for (NextEntry = DeviceExtension->DeviceListHead.Flink;
+             NextEntry != &DeviceExtension->DeviceListHead;
+             NextEntry = NextEntry->Flink)
         {
             DeviceInformation = CONTAINING_RECORD(NextEntry, DEVICE_INFORMATION, DeviceListEntry);
             if (RtlCompareUnicodeString(DeviceName, &(DeviceInformation->DeviceName), TRUE) == 0)
         {
             DeviceInformation = CONTAINING_RECORD(NextEntry, DEVICE_INFORMATION, DeviceListEntry);
             if (RtlCompareUnicodeString(DeviceName, &(DeviceInformation->DeviceName), TRUE) == 0)