diff --git a/rostests/kmtests/ntos_io/IoFilesystem.c b/rostests/kmtests/ntos_io/IoFilesystem.c index 6c12521e410..65c76352d21 100644 --- a/rostests/kmtests/ntos_io/IoFilesystem.c +++ b/rostests/kmtests/ntos_io/IoFilesystem.c @@ -113,15 +113,26 @@ TestAllInformation(VOID) Status = QueryFileInfo(FileHandle, (PVOID*)&FileAllInfo, &Length, FileAllInformation); ok_eq_hex(Status, STATUS_INFO_LENGTH_MISMATCH); ok_eq_size(Length, (ULONG_PTR)0x5555555555555555); + if (FileAllInfo) + KmtFreeGuarded(FileAllInfo); + + /* No space for the name -- fastfat handles this gracefully, ntfs doesn't. + * But the Io manager makes it fail on checked builds, so it's + * technically illegal + */ + Length = FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName); + Status = QueryFileInfo(FileHandle, (PVOID*)&FileAllInfo, &Length, FileAllInformation); + ok_eq_hex(Status, STATUS_INFO_LENGTH_MISMATCH); + ok_eq_size(Length, (ULONG_PTR)0x5555555555555555); if (FileAllInfo) KmtFreeGuarded(FileAllInfo); } /* The minimum allowed */ - Length = FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName); + Length = sizeof(FILE_ALL_INFORMATION); Status = QueryFileInfo(FileHandle, (PVOID*)&FileAllInfo, &Length, FileAllInformation); ok_eq_hex(Status, STATUS_BUFFER_OVERFLOW); - ok_eq_size(Length, FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName)); + ok_eq_size(Length, sizeof(FILE_ALL_INFORMATION)); if (FileAllInfo) KmtFreeGuarded(FileAllInfo);