[NTFS] - Fix POSIX rules. Fix accessing long filenames created in Windows when 8dot3 name creation is disabled.

Whether or not a filename should be interpreted as case-sensitive is dependent on a flag passed to the driver when a file is created (opened); it's separate from the namespace associated with the file being accessed.

svn path=/branches/GSoC_2016/NTFS/; revision=75178
This commit is contained in:
Trevor Thompson 2017-06-24 04:36:28 +00:00 committed by Thomas Faber
parent 98ddf610bc
commit 032be02954
8 changed files with 185 additions and 44 deletions

View file

@ -415,6 +415,10 @@ NtfsQueryInformation(PNTFS_IRP_CONTEXT IrpContext)
* @param IrpFlags
* ULONG describing the flags of the original IRP request (Irp->Flags).
*
* @param CaseSensitive
* Boolean indicating if the function should operate in case-sensitive mode. This will be TRUE
* if an application opened the file with the FILE_FLAG_POSIX_SEMANTICS flag.
*
* @param NewFileSize
* Pointer to a LARGE_INTEGER which indicates the new end of file (file size).
*
@ -436,6 +440,7 @@ NtfsSetEndOfFile(PNTFS_FCB Fcb,
PFILE_OBJECT FileObject,
PDEVICE_EXTENSION DeviceExt,
ULONG IrpFlags,
BOOLEAN CaseSensitive,
PLARGE_INTEGER NewFileSize)
{
LARGE_INTEGER CurrentFileSize;
@ -545,7 +550,13 @@ NtfsSetEndOfFile(PNTFS_FCB Fcb,
AllocationSize = ROUND_UP(NewFileSize->QuadPart, Fcb->Vcb->NtfsInfo.BytesPerCluster);
Status = UpdateFileNameRecord(Fcb->Vcb, ParentMFTId, &filename, FALSE, NewFileSize->QuadPart, AllocationSize);
Status = UpdateFileNameRecord(Fcb->Vcb,
ParentMFTId,
&filename,
FALSE,
NewFileSize->QuadPart,
AllocationSize,
CaseSensitive);
ReleaseAttributeContext(DataContext);
ExFreePoolWithTag(FileRecord, TAG_NTFS);
@ -620,7 +631,12 @@ NtfsSetInformation(PNTFS_IRP_CONTEXT IrpContext)
DPRINT1("FIXME: Using hacky method of setting FileAllocationInformation.\n");
case FileEndOfFileInformation:
EndOfFileInfo = (PFILE_END_OF_FILE_INFORMATION)SystemBuffer;
Status = NtfsSetEndOfFile(Fcb, FileObject, DeviceExt, Irp->Flags, &EndOfFileInfo->EndOfFile);
Status = NtfsSetEndOfFile(Fcb,
FileObject,
DeviceExt,
Irp->Flags,
(Stack->Flags & SL_CASE_SENSITIVE),
&EndOfFileInfo->EndOfFile);
break;
// TODO: all other information classes