[MOUNTMGR] Fix the buffer returned by IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATH (#6990)

The buffer returned by MountMgrQueryDosVolumePath()
should be a multi-string containing one single string.
This commit is contained in:
Hermès Bélusca-Maïto 2025-01-19 23:11:04 +01:00
parent 8bb7cd286b
commit c306a27941
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -1004,8 +1004,8 @@ TryWithVolumeName:
Output = (PMOUNTMGR_VOLUME_PATHS)Irp->AssociatedIrp.SystemBuffer; Output = (PMOUNTMGR_VOLUME_PATHS)Irp->AssociatedIrp.SystemBuffer;
/* At least, we will return our length */ /* At least, we will return our length */
Output->MultiSzLength = DeviceLength; Output->MultiSzLength = DeviceLength + 2 * sizeof(UNICODE_NULL);
Irp->IoStatus.Information = FIELD_OFFSET(MOUNTMGR_VOLUME_PATHS, MultiSz) + DeviceLength; Irp->IoStatus.Information = FIELD_OFFSET(MOUNTMGR_VOLUME_PATHS, MultiSz) + Output->MultiSzLength;
/* If we have enough room for copying the string */ /* If we have enough room for copying the string */
if (Irp->IoStatus.Information <= Stack->Parameters.DeviceIoControl.OutputBufferLength) if (Irp->IoStatus.Information <= Stack->Parameters.DeviceIoControl.OutputBufferLength)