https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c306a27941ab74941247a13155be5c6980f6cda3

commit c306a27941ab74941247a13155be5c6980f6cda3
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Sun Jan 19 23:11:04 2025 +0100
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Tue Jan 21 19:16:01 2025 +0100

    [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.
---
 drivers/storage/mountmgr/device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/storage/mountmgr/device.c 
b/drivers/storage/mountmgr/device.c
index 22710b7b4d7..7000d4a4218 100644
--- a/drivers/storage/mountmgr/device.c
+++ b/drivers/storage/mountmgr/device.c
@@ -1004,8 +1004,8 @@ TryWithVolumeName:
     Output = (PMOUNTMGR_VOLUME_PATHS)Irp->AssociatedIrp.SystemBuffer;
 
     /* At least, we will return our length */
-    Output->MultiSzLength = DeviceLength;
-    Irp->IoStatus.Information = FIELD_OFFSET(MOUNTMGR_VOLUME_PATHS, MultiSz) + 
DeviceLength;
+    Output->MultiSzLength = DeviceLength + 2 * sizeof(UNICODE_NULL);
+    Irp->IoStatus.Information = FIELD_OFFSET(MOUNTMGR_VOLUME_PATHS, MultiSz) + 
Output->MultiSzLength;
 
     /* If we have enough room for copying the string */
     if (Irp->IoStatus.Information <= 
Stack->Parameters.DeviceIoControl.OutputBufferLength)

Reply via email to