Author: hpoussin
Date: Sun Oct 26 19:10:39 2014
New Revision: 65028
URL:
http://svn.reactos.org/svn/reactos?rev=65028&view=rev
Log:
[NTFS] Also return the short file name to caller if available
Modified:
trunk/reactos/drivers/filesystems/ntfs/dirctl.c
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:39 2014
@@ -242,12 +242,13 @@
ULONG BufferLength)
{
ULONG Length;
- PFILENAME_ATTRIBUTE FileName;
+ PFILENAME_ATTRIBUTE FileName, ShortFileName;
DPRINT("NtfsGetBothDirectoryInformation() called\n");
FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32);
ASSERT(FileName != NULL);
+ ShortFileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS);
Length = FileName->NameLength * sizeof (WCHAR);
if ((sizeof(FILE_BOTH_DIR_INFORMATION) + Length) > BufferLength)
@@ -258,6 +259,19 @@
ROUND_UP(sizeof(FILE_BOTH_DIR_INFORMATION) + Length, sizeof(ULONG));
RtlCopyMemory(Info->FileName, FileName->Name, Length);
+ if (ShortFileName)
+ {
+ /* Should we upcase the filename? */
+ ASSERT(ShortFileName->NameLength <= ARRAYSIZE(Info->ShortName));
+ Info->ShortNameLength = ShortFileName->NameLength * sizeof(WCHAR);
+ RtlCopyMemory(Info->ShortName, ShortFileName->Name,
Info->ShortNameLength);
+ }
+ else
+ {
+ Info->ShortName[0] = 0;
+ Info->ShortNameLength = 0;
+ }
+
Info->CreationTime.QuadPart = FileName->CreationTime;
Info->LastAccessTime.QuadPart = FileName->LastAccessTime;
Info->LastWriteTime.QuadPart = FileName->LastWriteTime;
@@ -271,9 +285,6 @@
// Info->FileIndex=;
Info->EaSize = 0;
-
- Info->ShortName[0] = 0;
- Info->ShortNameLength = 0;
return STATUS_SUCCESS;
}