FAT bug (?)

Hi !

I am currently writing a file system driver (redirector), and some days ago I’ve come across what seems to be a FAT bug, while implementing my directory control dispatcher.


When a file system completes a successful IRP_MJ_DIRECTORY_CONTROL query request, it returns the size of the copied data in the irp’s IoStatus ‘Information’ field. As it happens, while NTFS returns the exact size, FAT usually returns a smaller value.


In other words - if one sends an IRP_MJ_DIRECTORY_CONTROL irp, or, for that matter, calls ZwQueryDirectoryFile, the returned ‘Information’ should not be trusted.

Well,… obviously (…), this does not affect the Win32 FindXXX functions, which probably iterate the returned buffer by the relevant ‘NextEntryOffset’ values, and ignore the returned buffer size. Nevertheless - other implementations (like my own) may very likely crash if not taking this into consideration.


I think this problem has been discussed here a month or two ago
and has been comfirmed as known bug.
Try to search the older postings, you will certainly find it.