Author: tthompson
Date: Sun Jun 25 04:29:04 2017
New Revision: 75193
URL: 
http://svn.reactos.org/svn/reactos?rev=75193&view=rev
Log:
[NTFS] - Fix creation of files with long filenames.
Modified:
    branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c
Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
==============================================================================
--- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c   [iso-8859-1] (original)
+++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c   [iso-8859-1] Sun Jun 25
04:29:04 2017
@@ -220,9 +220,15 @@
     DPRINT1("FileNameAttribute->DirectoryFileReferenceNumber: 0x%016I64x\n",
FileNameAttribute->DirectoryFileReferenceNumber);
     FileNameAttribute->NameLength = FilenameNoPath.Length / sizeof(WCHAR);
-    // TODO: Get proper nametype, add DOS links as needed
-    FileNameAttribute->NameType = NTFS_FILE_NAME_WIN32_AND_DOS;
     RtlCopyMemory(FileNameAttribute->Name, FilenameNoPath.Buffer,
FilenameNoPath.Length);
+
+    // For now, we're emulating the way Windows behaves when 8.3 name generation is
disabled
+    // TODO: add DOS Filename as needed
+    if (RtlIsNameLegalDOS8Dot3(&FilenameNoPath, NULL, NULL))
+        FileNameAttribute->NameType = NTFS_FILE_NAME_WIN32_AND_DOS;
+    else
+        FileNameAttribute->NameType = NTFS_FILE_NAME_POSIX;
+
     FileRecord->LinkCount++;
     AttributeAddress->Length = ResidentHeaderLength +