[MOUNTMGR] Fix setting up reparse index file name
authorPierre Schweitzer <pierre@reactos.org>
Mon, 21 Oct 2019 10:58:30 +0000 (12:58 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Mon, 21 Oct 2019 10:58:30 +0000 (12:58 +0200)
This fixes memory smashing while attempting to volume
reparse index (we were previously trying to copy the
name on itself, in the middle of itself...).
This code won't go farther on FAT, it requires NTFS.

Now, with this, ReactOS can properly boot with MountMgr
handling DOS devices without any crash or code disabled.
Cf: what was written in 7608ac9.

Modifications in class2, disk, and ntoskrnl are still to
be committed to enable all this.

drivers/filters/mountmgr/database.c

index 5e94f5c..a025f7d 100644 (file)
@@ -678,11 +678,10 @@ ReconcileThisDatabaseWithMasterWorker(IN PVOID Parameter)
         goto ReleaseRDS;
     }
 
-    
     RtlCopyMemory(ReparseFile.Buffer, DeviceInformation->DeviceName.Buffer,
                   DeviceInformation->DeviceName.Length);
     RtlCopyMemory((PVOID)((ULONG_PTR)ReparseFile.Buffer + DeviceInformation->DeviceName.Length),
-                  ReparseFile.Buffer, ReparseFile.Length);
+                  ReparseIndex.Buffer, ReparseIndex.Length);
     ReparseFile.Buffer[ReparseFile.Length / sizeof(WCHAR)] = UNICODE_NULL;
 
     InitializeObjectAttributes(&ObjectAttributes,