mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +00:00
[NTFS] Also return the short file name to caller if available
svn path=/trunk/; revision=65028
This commit is contained in:
parent
beb81cc389
commit
fa7836ce2a
1 changed files with 15 additions and 4 deletions
|
@ -242,12 +242,13 @@ NtfsGetBothDirectoryInformation(PDEVICE_EXTENSION DeviceExt,
|
|||
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 @@ NtfsGetBothDirectoryInformation(PDEVICE_EXTENSION DeviceExt,
|
|||
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;
|
||||
|
@ -272,9 +286,6 @@ NtfsGetBothDirectoryInformation(PDEVICE_EXTENSION DeviceExt,
|
|||
// Info->FileIndex=;
|
||||
Info->EaSize = 0;
|
||||
|
||||
Info->ShortName[0] = 0;
|
||||
Info->ShortNameLength = 0;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue