FSCTL in minifilter

Hello,

when is it safe to send FSCTL to FS using FltFsControlFile in minifilter? Does the file have to be opened?

My intention is to call FltFsControlFile in PFLT_TRANSACTION_NOTIFICATION_CALLBACK routine with NotificationMask TRANSACTION_NOTIFY_COMMIT_FINALIZE. This notification is to be called after file handle was closed. Will it be successful?

I need also to call FltFsControlFile in PreAcquireForSectionSynchronization. Again, is it possible?

Thanks.

The general rule is that only IRP_PAGING_IO operations are sent after the IRP_MJ_CLEANUP and before the IRP_MJ_CLOSE. I’m not certain if this applies for transactional operations as well (e.g., imagine that this is a memory mapped file and there is a transactional commit AFTER the file is closed but while it is still mapped).

The easiest way to figure this out would be to simply send it and see what happens. I suspect it will actually work.

Hopefully you know what you’re doing here, since sending a TxF FSCTL when you don’t know what you’re doing is going to break the transactional system.

“Transactions: easy to build, tough to get right…”

Tony
OSR

> Hopefully you know what you’re doing here, since sending a TxF FSCTL when you don’t know what you’re doing is going to break the transactional system.

In PFLT_TRANSACTION_NOTIFICATION_CALLBACK with NotificationMask TRANSACTION_NOTIFY_COMMIT_FINALIZE I would like to send FSCTL_CSV_INTERNAL/CsvInternalControlQueryFileRevision via FltFsControlFile. The same in PreAcquireForSectionSynchronization. Is it OK for CSV FS?