Author: hpoussin
Date: Sun Oct 26 19:10:17 2014
New Revision: 65027
URL:
http://svn.reactos.org/svn/reactos?rev=65027&view=rev
Log:
[NTFS] Prefer long file name when naming objects
We now always see the long file name of an object when browsing NTFS partitions.
Modified:
trunk/reactos/drivers/filesystems/ntfs/attrib.c
trunk/reactos/drivers/filesystems/ntfs/dirctl.c
trunk/reactos/drivers/filesystems/ntfs/fcb.c
trunk/reactos/drivers/filesystems/ntfs/ntfs.h
Modified: trunk/reactos/drivers/filesystems/ntfs/attrib.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/a…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/attrib.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/attrib.c [iso-8859-1] Sun Oct 26 19:10:17 2014
@@ -287,16 +287,25 @@
}
PFILENAME_ATTRIBUTE
-GetFileNameFromRecord(PFILE_RECORD_HEADER FileRecord)
+GetFileNameFromRecord(PFILE_RECORD_HEADER FileRecord, UCHAR NameType)
{
PNTFS_ATTR_RECORD Attribute;
+ PFILENAME_ATTRIBUTE Name;
Attribute = (PNTFS_ATTR_RECORD)((ULONG_PTR)FileRecord +
FileRecord->AttributeOffset);
while (Attribute < (PNTFS_ATTR_RECORD)((ULONG_PTR)FileRecord +
FileRecord->BytesInUse) &&
Attribute->Type != AttributeEnd)
{
if (Attribute->Type == AttributeFileName)
- return (PFILENAME_ATTRIBUTE)((ULONG_PTR)Attribute +
Attribute->Resident.ValueOffset);
+ {
+ Name = (PFILENAME_ATTRIBUTE)((ULONG_PTR)Attribute +
Attribute->Resident.ValueOffset);
+ if (Name->NameType == NameType ||
+ (Name->NameType == NTFS_FILE_NAME_WIN32_AND_DOS && NameType ==
NTFS_FILE_NAME_WIN32) ||
+ (Name->NameType == NTFS_FILE_NAME_WIN32_AND_DOS && NameType ==
NTFS_FILE_NAME_DOS))
+ {
+ return Name;
+ }
+ }
Attribute = (PNTFS_ATTR_RECORD)((ULONG_PTR)Attribute + Attribute->Length);
}
Modified: trunk/reactos/drivers/filesystems/ntfs/dirctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/d…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] Sun Oct 26 19:10:17 2014
@@ -135,7 +135,7 @@
DPRINT("NtfsGetNameInformation() called\n");
- FileName = GetFileNameFromRecord(FileRecord);
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
ASSERT(FileName != NULL);
Length = FileName->NameLength * sizeof (WCHAR);
@@ -163,7 +163,7 @@
DPRINT("NtfsGetDirectoryInformation() called\n");
- FileName = GetFileNameFromRecord(FileRecord);
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
ASSERT(FileName != NULL);
Length = FileName->NameLength * sizeof (WCHAR);
@@ -204,7 +204,7 @@
DPRINT("NtfsGetFullDirectoryInformation() called\n");
- FileName = GetFileNameFromRecord(FileRecord);
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
ASSERT(FileName != NULL);
Length = FileName->NameLength * sizeof (WCHAR);
@@ -246,7 +246,7 @@
DPRINT("NtfsGetBothDirectoryInformation() called\n");
- FileName = GetFileNameFromRecord(FileRecord);
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
ASSERT(FileName != NULL);
Length = FileName->NameLength * sizeof (WCHAR);
Modified: trunk/reactos/drivers/filesystems/ntfs/fcb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/fcb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/fcb.c [iso-8859-1] Sun Oct 26 19:10:17 2014
@@ -289,7 +289,7 @@
return NULL;
}
- FileName = GetFileNameFromRecord(MftRecord);
+ FileName = GetFileNameFromRecord(MftRecord, NTFS_FILE_NAME_WIN32);
if (!FileName)
{
ExFreePoolWithTag(MftRecord, TAG_NTFS);
@@ -391,7 +391,7 @@
DPRINT1("NtfsMakeFCBFromDirEntry(%p, %p, %wZ, %p, %p)\n", Vcb,
DirectoryFCB, Name, Record, fileFCB);
- FileName = GetFileNameFromRecord(Record);
+ FileName = GetFileNameFromRecord(Record, NTFS_FILE_NAME_WIN32);
if (!FileName)
{
return STATUS_OBJECT_NAME_NOT_FOUND; // Not sure that's the best here
Modified: trunk/reactos/drivers/filesystems/ntfs/ntfs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/n…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] Sun Oct 26 19:10:17 2014
@@ -448,7 +448,7 @@
NtfsDumpFileAttributes(PFILE_RECORD_HEADER FileRecord);
PFILENAME_ATTRIBUTE
-GetFileNameFromRecord(PFILE_RECORD_HEADER FileRecord);
+GetFileNameFromRecord(PFILE_RECORD_HEADER FileRecord, UCHAR NameType);
/* blockdev.c */