From: Hervé Poussineau Date: Thu, 2 Oct 2014 05:06:24 +0000 (+0000) Subject: [MOUNTMGR] Misc fixes for IOCTLs X-Git-Tag: backups/0.3.17@66124~300 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=f795747b330b1861f448aee0967c22925bfa8fa1;ds=sidebyside [MOUNTMGR] Misc fixes for IOCTLs svn path=/trunk/; revision=64448 --- diff --git a/reactos/drivers/filters/mountmgr/device.c b/reactos/drivers/filters/mountmgr/device.c index 4ee8096c7e6..de6b6350c33 100644 --- a/reactos/drivers/filters/mountmgr/device.c +++ b/reactos/drivers/filters/mountmgr/device.c @@ -653,7 +653,7 @@ MountMgrNextDriveLetter(IN PDEVICE_EXTENSION DeviceExtension, PMOUNTMGR_DRIVE_LETTER_TARGET DriveLetterTarget; MOUNTMGR_DRIVE_LETTER_INFORMATION DriveLetterInformation; - Stack = IoGetNextIrpStackLocation(Irp); + Stack = IoGetCurrentIrpStackLocation(Irp); /* Validate input */ if (Stack->Parameters.DeviceIoControl.InputBufferLength < sizeof(MOUNTMGR_DRIVE_LETTER_TARGET) || @@ -845,7 +845,7 @@ MountMgrQueryDosVolumePath(IN PDEVICE_EXTENSION DeviceExtension, PSYMLINK_INFORMATION SymlinkInformation; PASSOCIATED_DEVICE_ENTRY AssociatedDevice; - Stack = IoGetNextIrpStackLocation(Irp); + Stack = IoGetCurrentIrpStackLocation(Irp); /* Validate input size */ if (Stack->Parameters.DeviceIoControl.InputBufferLength < sizeof(MOUNTMGR_TARGET_NAME)) @@ -1075,7 +1075,7 @@ MountMgrKeepLinksWhenOffline(IN PDEVICE_EXTENSION DeviceExtension, PMOUNTMGR_TARGET_NAME Target; PDEVICE_INFORMATION DeviceInformation; - Stack = IoGetNextIrpStackLocation(Irp); + Stack = IoGetCurrentIrpStackLocation(Irp); /* Validate input */ if (Stack->Parameters.DeviceIoControl.InputBufferLength < sizeof(MOUNTMGR_TARGET_NAME)) @@ -1119,7 +1119,7 @@ MountMgrVolumeArrivalNotification(IN PDEVICE_EXTENSION DeviceExtension, UNICODE_STRING SymbolicName; PMOUNTMGR_TARGET_NAME Target; - Stack = IoGetNextIrpStackLocation(Irp); + Stack = IoGetCurrentIrpStackLocation(Irp); /* Validate input */ if (Stack->Parameters.DeviceIoControl.InputBufferLength < sizeof(MOUNTMGR_TARGET_NAME)) @@ -1162,7 +1162,7 @@ MountMgrQueryPoints(IN PDEVICE_EXTENSION DeviceExtension, PMOUNTMGR_MOUNT_POINT MountPoint; UNICODE_STRING SymbolicName, DeviceName; - Stack = IoGetNextIrpStackLocation(Irp); + Stack = IoGetCurrentIrpStackLocation(Irp); /* Validate input... */ if (Stack->Parameters.DeviceIoControl.InputBufferLength < sizeof(MOUNTMGR_MOUNT_POINT)) @@ -1310,7 +1310,7 @@ MountMgrDeletePoints(IN PDEVICE_EXTENSION DeviceExtension, PMOUNTMGR_MOUNT_POINTS MountPoints; UNICODE_STRING SymbolicName, DeviceName; - Stack = IoGetNextIrpStackLocation(Irp); + Stack = IoGetCurrentIrpStackLocation(Irp); /* Validate input */ if (Stack->Parameters.DeviceIoControl.InputBufferLength < sizeof(MOUNTMGR_MOUNT_POINT)) @@ -1489,7 +1489,7 @@ MountMgrVolumeMountPointChanged(IN PDEVICE_EXTENSION DeviceExtension, POBJECT_NAME_INFORMATION ObjectNameInfoPtr = NULL; UNICODE_STRING SourceVolumeName, TargetDeviceName; - Stack = IoGetNextIrpStackLocation(Irp); + Stack = IoGetCurrentIrpStackLocation(Irp); /* Validate input */ if (Stack->Parameters.DeviceIoControl.InputBufferLength < sizeof(MOUNTMGR_VOLUME_MOUNT_POINT)) @@ -1722,7 +1722,7 @@ MountMgrDeviceControl(IN PDEVICE_OBJECT DeviceObject, NTSTATUS Status, LockStatus; PDEVICE_EXTENSION DeviceExtension; - Stack = IoGetNextIrpStackLocation(Irp); + Stack = IoGetCurrentIrpStackLocation(Irp); DeviceExtension = DeviceObject->DeviceExtension; KeWaitForSingleObject(&(DeviceExtension->DeviceLock), Executive, KernelMode, FALSE, NULL); diff --git a/reactos/drivers/filters/mountmgr/mountmgr.c b/reactos/drivers/filters/mountmgr/mountmgr.c index f623976a74e..c24f58a28c3 100644 --- a/reactos/drivers/filters/mountmgr/mountmgr.c +++ b/reactos/drivers/filters/mountmgr/mountmgr.c @@ -1331,9 +1331,9 @@ MountMgrMountedDeviceArrival(IN PDEVICE_EXTENSION DeviceExtension, DeviceInformation->SuggestedDriveLetter = 0; } /* Else, it's time to set up one */ - else if (!DeviceExtension->NoAutoMount && !DeviceInformation->Removable && - DeviceExtension->AutomaticDriveLetter && HasGptDriveLetter && - DeviceInformation->SuggestedDriveLetter && + else if ((DeviceExtension->NoAutoMount || DeviceInformation->Removable) && + DeviceExtension->AutomaticDriveLetter && + (HasGptDriveLetter || DeviceInformation->SuggestedDriveLetter) && !HasNoDriveLetterEntry(UniqueId)) { /* Create a new drive letter */