[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
This commit is contained in:
Trevor Thompson 2017-08-25 17:16:04 +00:00 committed by Thomas Faber
parent 88a7c3d14b
commit c63e7e54b5
2 changed files with 11 additions and 4 deletions

View file

@ -172,11 +172,11 @@ AddFileName(PFILE_RECORD_HEADER FileRecord,
// we need to extract the filename from the path
DPRINT1("Pathname: %wZ\n", &FileObject->FileName);
FilenameNoPath.Buffer = FileObject->FileName.Buffer;
FilenameNoPath.MaximumLength = FilenameNoPath.Length = FileObject->FileName.Length;
FsRtlDissectName(FileObject->FileName, &Current, &Remaining);
FilenameNoPath.Buffer = Current.Buffer;
FilenameNoPath.MaximumLength = FilenameNoPath.Length = Current.Length;
while (Current.Length != 0)
{
DPRINT1("Current: %wZ\n", &Current);
@ -232,7 +232,7 @@ AddFileName(PFILE_RECORD_HEADER FileRecord,
// 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))
if (!CaseSensitive && RtlIsNameLegalDOS8Dot3(&FilenameNoPath, NULL, NULL))
FileNameAttribute->NameType = NTFS_FILE_NAME_WIN32_AND_DOS;
else
FileNameAttribute->NameType = NTFS_FILE_NAME_POSIX;

View file

@ -569,6 +569,13 @@ NtfsCreateFile(PDEVICE_OBJECT DeviceObject,
return STATUS_ACCESS_DENIED;
}
// We can't create directories yet
if (RequestedOptions & FILE_DIRECTORY_FILE)
{
DPRINT1("FIXME: Folder creation is still TODO!\n");
return STATUS_NOT_IMPLEMENTED;
}
// Create the file record on disk
Status = NtfsCreateFileRecord(DeviceExt,
FileObject,