Author: pschweitzer
Date: Sun Nov 23 14:07:08 2014
New Revision: 65456
URL:
http://svn.reactos.org/svn/reactos?rev=65456&view=rev
Log:
[NTFS]
- Implement GetBestFileNameFromRecord() which will select the higher subsystem name
available (POSIX -> Win32 -> DOS) and return it
- Replace the hand-made implementation of it in dirctl functions relying on it
(NtfsGetDirectoryInformation(), NtfsGetFullDirectoryInformation(),
NtfsGetBothDirectoryInformation())
- Use it in NtfsMakeFCBFromDirEntry()
This fixes browsing POSIX volume (and opening file) in cmd. Even though, explorer
doesn't seem to be happy with such change...
This doesn't fix yet the autocompletion in cmd either.
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 Nov 23 14:07:08 2014
@@ -314,4 +314,22 @@
return NULL;
}
+PFILENAME_ATTRIBUTE
+GetBestFileNameFromRecord(PFILE_RECORD_HEADER FileRecord)
+{
+ PFILENAME_ATTRIBUTE FileName;
+
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_POSIX);
+ if (FileName == NULL)
+ {
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
+ if (FileName == NULL)
+ {
+ FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS);
+ }
+ }
+
+ return FileName;
+}
+
/* EOF */
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 Nov 23 14:07:08 2014
@@ -137,15 +137,7 @@
DPRINT("NtfsGetNameInformation() called\n");
- FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_POSIX);
- if (FileName == NULL)
- {
- FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
- if (FileName == NULL)
- {
- FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS);
- }
- }
+ FileName = GetBestFileNameFromRecord(FileRecord);
ASSERT(FileName != NULL);
Length = FileName->NameLength * sizeof (WCHAR);
@@ -173,15 +165,7 @@
DPRINT("NtfsGetDirectoryInformation() called\n");
- FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_POSIX);
- if (FileName == NULL)
- {
- FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
- if (FileName == NULL)
- {
- FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS);
- }
- }
+ FileName = GetBestFileNameFromRecord(FileRecord);
ASSERT(FileName != NULL);
Length = FileName->NameLength * sizeof (WCHAR);
@@ -222,15 +206,7 @@
DPRINT("NtfsGetFullDirectoryInformation() called\n");
- FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_POSIX);
- if (FileName == NULL)
- {
- FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
- if (FileName == NULL)
- {
- FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS);
- }
- }
+ FileName = GetBestFileNameFromRecord(FileRecord);
ASSERT(FileName != NULL);
Length = FileName->NameLength * sizeof (WCHAR);
@@ -272,15 +248,7 @@
DPRINT("NtfsGetBothDirectoryInformation() called\n");
- FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_POSIX);
- if (FileName == NULL)
- {
- FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
- if (FileName == NULL)
- {
- FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS);
- }
- }
+ FileName = GetBestFileNameFromRecord(FileRecord);
ASSERT(FileName != NULL);
ShortFileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS);
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 Nov 23 14:07:08 2014
@@ -396,7 +396,7 @@
DPRINT1("NtfsMakeFCBFromDirEntry(%p, %p, %wZ, %p, %p)\n", Vcb,
DirectoryFCB, Name, Record, fileFCB);
- FileName = GetFileNameFromRecord(Record, NTFS_FILE_NAME_WIN32);
+ FileName = GetBestFileNameFromRecord(Record);
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 Nov 23 14:07:08 2014
@@ -452,6 +452,9 @@
PFILENAME_ATTRIBUTE
GetFileNameFromRecord(PFILE_RECORD_HEADER FileRecord, UCHAR NameType);
+PFILENAME_ATTRIBUTE
+GetBestFileNameFromRecord(PFILE_RECORD_HEADER FileRecord);
+
/* blockdev.c */
NTSTATUS