From 09a8dc268a1fe7c11f649157b9fa04dc480e4c31 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Tue, 29 Apr 2014 20:50:51 +0000 Subject: [PATCH] [FASTFAT] Fix the most stupid bug ever in ReactOS history (at least!). Dear Pierre, you pretend you're modifying the FileObject->FileName field, but, as you were told in the early when you learnt C, you're at that point in your code dealing with a local copy of the unicode string. So, if modifying the Buffer field is fine, because it's a pointer to memory zone, containing the wchar string, modifying the Length field is totally pointless because it won't magically modify the unicode string in the file object, and will just be forgotten as long the function will be unstacked. So REALLY modify the file object. VfatSetRenameInformation receives less garbage information now... svn path=/trunk/; revision=63049 --- reactos/drivers/filesystems/fastfat/create.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/filesystems/fastfat/create.c b/reactos/drivers/filesystems/fastfat/create.c index eb14acc5494..154bd307bbd 100644 --- a/reactos/drivers/filesystems/fastfat/create.c +++ b/reactos/drivers/filesystems/fastfat/create.c @@ -596,8 +596,8 @@ VfatCreateFile( /* Update FO just to keep file name */ /* Skip first slash */ ++idx; - PathNameU.Length = FileNameLen; - RtlMoveMemory(&PathNameU.Buffer[0], &PathNameU.Buffer[idx], PathNameU.Length); + FileObject->FileName.Length = FileNameLen; + RtlMoveMemory(&PathNameU.Buffer[0], &PathNameU.Buffer[idx], FileObject->FileName.Length); } else {