From e9ae3cdf2572beb4bd5e79ed1c092f43f3205ada Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Mon, 24 Aug 2015 08:43:26 +0000 Subject: [PATCH] [NTFS] Return properly formatted stream names, according to: https://msdn.microsoft.com/en-us/library/cc232090.aspx svn path=/trunk/; revision=68809 --- reactos/drivers/filesystems/ntfs/finfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/filesystems/ntfs/finfo.c b/reactos/drivers/filesystems/ntfs/finfo.c index 9c3424c0afd..2e13d81840e 100644 --- a/reactos/drivers/filesystems/ntfs/finfo.c +++ b/reactos/drivers/filesystems/ntfs/finfo.c @@ -256,7 +256,7 @@ NtfsGetSteamInformation(PNTFS_FCB Fcb, { if (Attribute->Type == AttributeData) { - CurrentSize = FIELD_OFFSET(FILE_STREAM_INFORMATION, StreamName) + Attribute->NameLength * sizeof(WCHAR); + CurrentSize = FIELD_OFFSET(FILE_STREAM_INFORMATION, StreamName) + Attribute->NameLength * sizeof(WCHAR) + wcslen(L"::$DATA") * sizeof(WCHAR); if (CurrentSize > *BufferLength) { @@ -268,7 +268,9 @@ NtfsGetSteamInformation(PNTFS_FCB Fcb, CurrentInfo->StreamNameLength = Attribute->NameLength * sizeof(WCHAR); CurrentInfo->StreamSize.QuadPart = AttributeDataLength(Attribute); CurrentInfo->StreamAllocationSize.QuadPart = AttributeAllocatedLength(Attribute); - RtlMoveMemory(CurrentInfo->StreamName, (PWCHAR)((ULONG_PTR)Attribute + Attribute->NameOffset), CurrentInfo->StreamNameLength); + CurrentInfo->StreamName[0] = L':'; + RtlMoveMemory(&CurrentInfo->StreamName[1], (PWCHAR)((ULONG_PTR)Attribute + Attribute->NameOffset), CurrentInfo->StreamNameLength); + RtlMoveMemory(&CurrentInfo->StreamName[Attribute->NameLength + 1], L":$DATA", sizeof(L":$DATA") - sizeof(UNICODE_NULL)); if (Previous != NULL) {