FltCreateFile with non existing directory

Hello!

I’m trying to create a small minifilter that, when receives a IRP_MJ_CREATE that can potentially modify the file creates a backup file in \Device\HardDiskVolumeX\Backup\ORIGINALPATH. To achieve this I’m checking for FILE_WRITE_DATA and DELETE flags. So, for example, if the user is trying to open C:\NewFolder\TextFile.txt, the backup that will be created will be C:\Backup\NewFolder\TextFile.txt.

What I’d like to ask is if there’s a way to create the folders on the path that does not exists. I think it’s pretty straightforward, but I couldn’t find a way to use FltCreateFile in this way. Probably it was never designed this way, so I’ll implement myself (it should be rather easy as I said) but before proceeding I’d like to understand if it something already there (and that it will probably be less error-prone and more efficient that my implementation).

Thanks in advance

> What I’d like to ask is if there’s a way to create the folders on the path

that does not exists.

Only if you roll it yourself. The FSD does give you a distinguished error
back which will make life easier for you.

> Only if you roll it yourself. The FSD does give you a distinguished error

back which will make life easier for you.

Ok, so I’ll do it myself. Thank you very much!