mirror of
https://github.com/reactos/reactos.git
synced 2025-06-30 23:21:23 +00:00
[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:
parent
88a7c3d14b
commit
c63e7e54b5
2 changed files with 11 additions and 4 deletions
|
@ -172,11 +172,11 @@ AddFileName(PFILE_RECORD_HEADER FileRecord,
|
||||||
// we need to extract the filename from the path
|
// we need to extract the filename from the path
|
||||||
DPRINT1("Pathname: %wZ\n", &FileObject->FileName);
|
DPRINT1("Pathname: %wZ\n", &FileObject->FileName);
|
||||||
|
|
||||||
FilenameNoPath.Buffer = FileObject->FileName.Buffer;
|
|
||||||
FilenameNoPath.MaximumLength = FilenameNoPath.Length = FileObject->FileName.Length;
|
|
||||||
|
|
||||||
FsRtlDissectName(FileObject->FileName, &Current, &Remaining);
|
FsRtlDissectName(FileObject->FileName, &Current, &Remaining);
|
||||||
|
|
||||||
|
FilenameNoPath.Buffer = Current.Buffer;
|
||||||
|
FilenameNoPath.MaximumLength = FilenameNoPath.Length = Current.Length;
|
||||||
|
|
||||||
while (Current.Length != 0)
|
while (Current.Length != 0)
|
||||||
{
|
{
|
||||||
DPRINT1("Current: %wZ\n", &Current);
|
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
|
// For now, we're emulating the way Windows behaves when 8.3 name generation is disabled
|
||||||
// TODO: add DOS Filename as needed
|
// 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;
|
FileNameAttribute->NameType = NTFS_FILE_NAME_WIN32_AND_DOS;
|
||||||
else
|
else
|
||||||
FileNameAttribute->NameType = NTFS_FILE_NAME_POSIX;
|
FileNameAttribute->NameType = NTFS_FILE_NAME_POSIX;
|
||||||
|
|
|
@ -569,6 +569,13 @@ NtfsCreateFile(PDEVICE_OBJECT DeviceObject,
|
||||||
return STATUS_ACCESS_DENIED;
|
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
|
// Create the file record on disk
|
||||||
Status = NtfsCreateFileRecord(DeviceExt,
|
Status = NtfsCreateFileRecord(DeviceExt,
|
||||||
FileObject,
|
FileObject,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue