From 369fcf0bf3831c8b9d0f3e4228df223286137383 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 16:30:29 +0000 Subject: [PATCH] [MOUNTMGR] - Fix broken logic in OnlineMountedVolumes() - Add missing return in MountMgrNotifyNameChange() CID #515247 CID #716002 svn path=/trunk/; revision=62664 --- reactos/drivers/filters/mountmgr/database.c | 11 ++++++----- reactos/drivers/filters/mountmgr/notify.c | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/reactos/drivers/filters/mountmgr/database.c b/reactos/drivers/filters/mountmgr/database.c index f6a730c4965..77b9e214623 100644 --- a/reactos/drivers/filters/mountmgr/database.c +++ b/reactos/drivers/filters/mountmgr/database.c @@ -746,10 +746,11 @@ OnlineMountedVolumes(IN PDEVICE_EXTENSION DeviceExtension, return; } + RestartScan = TRUE; + /* Query mount points */ while (TRUE) { - RestartScan = TRUE; SymbolicName.Length = 0; SymbolicName.MaximumLength = sizeof(SymbolicNameBuffer); SymbolicName.Buffer = SymbolicNameBuffer; @@ -771,8 +772,7 @@ OnlineMountedVolumes(IN PDEVICE_EXTENSION DeviceExtension, if (ReparsePointInformation.FileReference == SavedReparsePointInformation.FileReference && ReparsePointInformation.Tag == SavedReparsePointInformation.Tag) { - ZwClose(Handle); - return; + break; } } else @@ -782,8 +782,7 @@ OnlineMountedVolumes(IN PDEVICE_EXTENSION DeviceExtension, if (!NT_SUCCESS(Status) || ReparsePointInformation.Tag != IO_REPARSE_TAG_MOUNT_POINT) { - ZwClose(Handle); - return; + break; } /* Get the volume name associated to the mount point */ @@ -813,6 +812,8 @@ OnlineMountedVolumes(IN PDEVICE_EXTENSION DeviceExtension, PostOnlineNotification(DeviceExtension, &VolumeDeviceInformation->SymbolicName); } } + + ZwClose(Handle); } /* diff --git a/reactos/drivers/filters/mountmgr/notify.c b/reactos/drivers/filters/mountmgr/notify.c index 60f9f78e4c3..de1e573b868 100644 --- a/reactos/drivers/filters/mountmgr/notify.c +++ b/reactos/drivers/filters/mountmgr/notify.c @@ -414,6 +414,7 @@ MountMgrNotifyNameChange(IN PDEVICE_EXTENSION DeviceExtension, { ObDereferenceObject(DeviceObject); ObDereferenceObject(FileObject); + return; } Stack = IoGetNextIrpStackLocation(Irp);