Author: tthompson
Date: Sun Jun 25 02:38:15 2017
New Revision: 75191
URL:
http://svn.reactos.org/svn/reactos?rev=75191&view=rev
Log:
[NTFS] - Fix a mistake with AddFileName() from my last commit. Also, move CaseSensitive
parameter before output parameters in the parameter list of several functions.
Modified:
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/create.c
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/fcb.c
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h
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
02:38:15 2017
@@ -112,12 +112,12 @@
* Pointer to the FILE_OBJECT which represents the new name.
* This parameter is used to determine the filename and parent directory.
*
-* @param ParentMftIndex
-* Pointer to a ULONGLONG which will receive the index of the parent directory.
-*
* @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 ParentMftIndex
+* Pointer to a ULONGLONG which will receive the index of the parent directory.
*
* @return
* STATUS_SUCCESS on success. STATUS_NOT_IMPLEMENTED if target address isn't at the
end
@@ -136,8 +136,8 @@
PNTFS_ATTR_RECORD AttributeAddress,
PDEVICE_EXTENSION DeviceExt,
PFILE_OBJECT FileObject,
- PULONGLONG ParentMftIndex,
- BOOLEAN CaseSensitive)
+ BOOLEAN CaseSensitive,
+ PULONGLONG ParentMftIndex)
{
ULONG ResidentHeaderLength = FIELD_OFFSET(NTFS_ATTR_RECORD, Resident.Reserved) +
sizeof(UCHAR);
PFILENAME_ATTRIBUTE FileNameAttribute;
Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/create.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
==============================================================================
--- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/create.c [iso-8859-1] (original)
+++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/create.c [iso-8859-1] Sun Jun 25
02:38:15 2017
@@ -570,7 +570,10 @@
}
// Create the file record on disk
- Status = NtfsCreateFileRecord(DeviceExt, FileObject,
BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT));
+ Status = NtfsCreateFileRecord(DeviceExt,
+ FileObject,
+ (Stack->Flags & SL_CASE_SENSITIVE),
+
BooleanFlagOn(IrpContext->Flags,IRPCONTEXT_CANWAIT));
if (!NT_SUCCESS(Status))
{
DPRINT1("ERROR: Couldn't create file record!\n");
@@ -656,6 +659,7 @@
NTSTATUS
NtfsCreateFileRecord(PDEVICE_EXTENSION DeviceExt,
PFILE_OBJECT FileObject,
+ BOOLEAN CaseSensitive,
BOOLEAN CanWait)
{
NTSTATUS Status = STATUS_SUCCESS;
@@ -665,7 +669,11 @@
ULONGLONG ParentMftIndex;
ULONGLONG FileMftIndex;
- DPRINT1("NtfsCreateFileRecord(%p, %p, %s)\n", DeviceExt, FileObject,
CanWait ? "TRUE" : "FALSE");
+ DPRINT1("NtfsCreateFileRecord(%p, %p, %s, %s)\n",
+ DeviceExt,
+ FileObject,
+ CaseSensitive ? "TRUE" : "FALSE",
+ CanWait ? "TRUE" : "FALSE");
// allocate memory for file record
FileRecord = ExAllocatePoolWithTag(NonPagedPool,
@@ -709,7 +717,7 @@
NextAttribute = (PNTFS_ATTR_RECORD)((ULONG_PTR)NextAttribute +
(ULONG_PTR)NextAttribute->Length);
// Add the $FILE_NAME attribute
- AddFileName(FileRecord, NextAttribute, DeviceExt, FileObject, &ParentMftIndex);
+ AddFileName(FileRecord, NextAttribute, DeviceExt, FileObject, CaseSensitive,
&ParentMftIndex);
// save a pointer to the filename attribute
FilenameAttribute = (PFILENAME_ATTRIBUTE)((ULONG_PTR)NextAttribute +
NextAttribute->Resident.ValueOffset);
Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/fcb.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
==============================================================================
--- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/fcb.c [iso-8859-1] (original)
+++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/fcb.c [iso-8859-1] Sun Jun 25
02:38:15 2017
@@ -557,7 +557,7 @@
DPRINT1("Will now look for file '%wZ' with stream
'%S'\n", &File, Colon);
}
- Status = NtfsLookupFileAt(Vcb, &File, &FileRecord, &MFTIndex, CurrentDir,
CaseSensitive);
+ Status = NtfsLookupFileAt(Vcb, &File, CaseSensitive, &FileRecord,
&MFTIndex, CurrentDir);
if (!NT_SUCCESS(Status))
{
return Status;
Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
==============================================================================
--- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c [iso-8859-1] (original)
+++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c [iso-8859-1] Sun Jun 25
02:38:15 2017
@@ -2106,16 +2106,22 @@
NTSTATUS
NtfsLookupFileAt(PDEVICE_EXTENSION Vcb,
PUNICODE_STRING PathName,
+ BOOLEAN CaseSensitive,
PFILE_RECORD_HEADER *FileRecord,
PULONGLONG MFTIndex,
- ULONGLONG CurrentMFTIndex,
- BOOLEAN CaseSensitive)
+ ULONGLONG CurrentMFTIndex)
{
UNICODE_STRING Current, Remaining;
NTSTATUS Status;
ULONG FirstEntry = 0;
- DPRINT("NtfsLookupFileAt(%p, %wZ, %p, %I64x)\n", Vcb, PathName, FileRecord,
CurrentMFTIndex);
+ DPRINT("NtfsLookupFileAt(%p, %wZ, %s, %p, %p, %I64x)\n",
+ Vcb,
+ PathName,
+ CaseSensitive ? "TRUE" : "FALSE",
+ FileRecord,
+ MFTIndex,
+ CurrentMFTIndex);
FsRtlDissectName(*PathName, &Current, &Remaining);
@@ -2158,11 +2164,11 @@
NTSTATUS
NtfsLookupFile(PDEVICE_EXTENSION Vcb,
PUNICODE_STRING PathName,
+ BOOLEAN CaseSensitive,
PFILE_RECORD_HEADER *FileRecord,
- PULONGLONG MFTIndex,
- BOOLEAN CaseSensitive)
-{
- return NtfsLookupFileAt(Vcb, PathName, FileRecord, MFTIndex, NTFS_FILE_ROOT,
CaseSensitive);
+ PULONGLONG MFTIndex)
+{
+ return NtfsLookupFileAt(Vcb, PathName, CaseSensitive, FileRecord, MFTIndex,
NTFS_FILE_ROOT);
}
/**
Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
==============================================================================
--- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] (original)
+++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] Sun Jun 25
02:38:15 2017
@@ -536,6 +536,7 @@
PNTFS_ATTR_RECORD AttributeAddress,
PDEVICE_EXTENSION DeviceExt,
PFILE_OBJECT FileObject,
+ BOOLEAN CaseSensitive,
PULONGLONG ParentMftIndex);
NTSTATUS
@@ -668,6 +669,7 @@
NTSTATUS
NtfsCreateFileRecord(PDEVICE_EXTENSION DeviceExt,
PFILE_OBJECT FileObject,
+ BOOLEAN CaseSensitive,
BOOLEAN CanWait);
/* devctl.c */
@@ -970,16 +972,17 @@
NTSTATUS
NtfsLookupFile(PDEVICE_EXTENSION Vcb,
PUNICODE_STRING PathName,
+ BOOLEAN CaseSensitive,
PFILE_RECORD_HEADER *FileRecord,
PULONGLONG MFTIndex);
NTSTATUS
NtfsLookupFileAt(PDEVICE_EXTENSION Vcb,
PUNICODE_STRING PathName,
+ BOOLEAN CaseSensitive,
PFILE_RECORD_HEADER *FileRecord,
PULONGLONG MFTIndex,
- ULONGLONG CurrentMFTIndex,
- BOOLEAN CaseSensitive);
+ ULONGLONG CurrentMFTIndex);
VOID
NtfsDumpFileRecord(PDEVICE_EXTENSION Vcb,