IRP_MJ_READ on directories

How should I interpret read calls on directory files? In my filesystem,
it’s not as simple as just “read the meta data”. In fact it’s not something
I can do at all. What is the proper method of failing this call so that the
OS doesn’t get confused?

Jeremy

If non-paging read comes to a directory you can fail it with
STATUS_INVALID_PARAMETER, the same way as standard file system does. Paging
IO read is generated in response to your file system driver calls CcMapData
or CcPinRead. If you generate data in response to IRP_MJ_DIRECTORY_CONTROL
without reading metadata you don’t call those functions so you have nothing
to worry about. Generally all read requests for directories are generated on
behalf of File System driver, so nobody is concerned about results of those
requests except the file system driver itself.

Alexei.

“Jeremy Sherrill” wrote in message
news:xxxxx@ntfsd…
> How should I interpret read calls on directory files? In my filesystem,
> it’s not as simple as just “read the meta data”. In fact it’s not
something
> I can do at all. What is the proper method of failing this call so that
the
> OS doesn’t get confused?
>
> Jeremy
>
>
>