Skip to content

Commit c63e7e5

Browse files
Trevor ThompsonThFabba
authored andcommitted
[NTFS] - When creating files:
-Don't add a preceding backslash when creating files on root. -Use NTFS_FILE_NAME_POSIX name type if CaseSensitive option is specified. -Don't try to create a file when a folder is requested (folder creation is still TODO). svn path=/branches/GSoC_2016/NTFS/; revision=75671
1 parent 88a7c3d commit c63e7e5

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

drivers/filesystems/ntfs/attrib.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ AddFileName(PFILE_RECORD_HEADER FileRecord,
172172
// we need to extract the filename from the path
173173
DPRINT1("Pathname: %wZ\n", &FileObject->FileName);
174174

175-
FilenameNoPath.Buffer = FileObject->FileName.Buffer;
176-
FilenameNoPath.MaximumLength = FilenameNoPath.Length = FileObject->FileName.Length;
177-
178175
FsRtlDissectName(FileObject->FileName, &Current, &Remaining);
179176

177+
FilenameNoPath.Buffer = Current.Buffer;
178+
FilenameNoPath.MaximumLength = FilenameNoPath.Length = Current.Length;
179+
180180
while (Current.Length != 0)
181181
{
182182
DPRINT1("Current: %wZ\n", &Current);
@@ -232,7 +232,7 @@ AddFileName(PFILE_RECORD_HEADER FileRecord,
232232

233233
// For now, we're emulating the way Windows behaves when 8.3 name generation is disabled
234234
// TODO: add DOS Filename as needed
235-
if (RtlIsNameLegalDOS8Dot3(&FilenameNoPath, NULL, NULL))
235+
if (!CaseSensitive && RtlIsNameLegalDOS8Dot3(&FilenameNoPath, NULL, NULL))
236236
FileNameAttribute->NameType = NTFS_FILE_NAME_WIN32_AND_DOS;
237237
else
238238
FileNameAttribute->NameType = NTFS_FILE_NAME_POSIX;

drivers/filesystems/ntfs/create.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,13 @@ NtfsCreateFile(PDEVICE_OBJECT DeviceObject,
569569
return STATUS_ACCESS_DENIED;
570570
}
571571

572+
// We can't create directories yet
573+
if (RequestedOptions & FILE_DIRECTORY_FILE)
574+
{
575+
DPRINT1("FIXME: Folder creation is still TODO!\n");
576+
return STATUS_NOT_IMPLEMENTED;
577+
}
578+
572579
// Create the file record on disk
573580
Status = NtfsCreateFileRecord(DeviceExt,
574581
FileObject,

0 commit comments

Comments
 (0)