tst: ntptfs: fix ea size for NTFS compatibility

This commit is contained in:
Bill Zissimopoulos 2022-01-21 17:54:08 +00:00
parent c306a52d19
commit cb98f711f7
No known key found for this signature in database
GPG Key ID: 3D4F95D52C7B3EA3
3 changed files with 7 additions and 2 deletions

View File

@ -150,7 +150,7 @@ NTSTATUS LfsGetFileInfo(
FileInfo->ChangeTime = FileAllInfo.V.BasicInformation.ChangeTime.QuadPart; FileInfo->ChangeTime = FileAllInfo.V.BasicInformation.ChangeTime.QuadPart;
FileInfo->IndexNumber = FileAllInfo.V.InternalInformation.IndexNumber.QuadPart; FileInfo->IndexNumber = FileAllInfo.V.InternalInformation.IndexNumber.QuadPart;
FileInfo->HardLinks = 0; FileInfo->HardLinks = 0;
FileInfo->EaSize = FileAllInfo.V.EaInformation.EaSize; FileInfo->EaSize = LfsGetEaSize(FileAllInfo.V.EaInformation.EaSize);
if (0 != OpenFileInfo && if (0 != OpenFileInfo &&
OpenFileInfo->NormalizedNameSize > sizeof(WCHAR) + FileAllInfo.V.NameInformation.FileNameLength && OpenFileInfo->NormalizedNameSize > sizeof(WCHAR) + FileAllInfo.V.NameInformation.FileNameLength &&

View File

@ -736,7 +736,7 @@ static inline VOID CopyQueryInfoToDirInfo(
DirInfo->FileInfo.IndexNumber = QueryInfo->FileId.QuadPart; DirInfo->FileInfo.IndexNumber = QueryInfo->FileId.QuadPart;
DirInfo->FileInfo.HardLinks = 0; DirInfo->FileInfo.HardLinks = 0;
DirInfo->FileInfo.EaSize = 0 != (FILE_ATTRIBUTE_REPARSE_POINT & QueryInfo->FileAttributes) ? DirInfo->FileInfo.EaSize = 0 != (FILE_ATTRIBUTE_REPARSE_POINT & QueryInfo->FileAttributes) ?
0 : QueryInfo->EaSize; 0 : LfsGetEaSize(QueryInfo->EaSize);
} }
static NTSTATUS BufferedReadDirectory(FSP_FILE_SYSTEM *FileSystem, static NTSTATUS BufferedReadDirectory(FSP_FILE_SYSTEM *FileSystem,

View File

@ -127,6 +127,11 @@ NTSTATUS LfsFsControlFile(
PVOID OutputBuffer, PVOID OutputBuffer,
ULONG OutputBufferLength, ULONG OutputBufferLength,
PULONG PBytesTransferred); PULONG PBytesTransferred);
static inline
ULONG LfsGetEaSize(ULONG EaSize)
{
return 0 != EaSize ? EaSize - 4 : 0;
}
/* /*