X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=rostests%2Fkmtests%2Fntos_io%2FIoFilesystem.c;h=65c76352d21d841df4b06b8538c3a5c4f09d6436;hp=6c12521e410da5606fcfbd80e45937547b4a9a37;hb=425f097968bdd38591e3f9b028e47c454c589381;hpb=ece00ea85f7bc02be87b5e29e464d213223c864b 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);