Simple backup restore solution

Hi,
I am working in a project to monitor the file access for a target application. In the minifilter I am filtering every file open attempt and if the creation will fail (i try to open the file myself in precreate) because the file is missing i restore first the file from a backup directory, then i return. This is working fine but in the case of a missed directory, i never see the open of the file because CreateFile first test the existence of the file path. How I could resolve this situation??? Maybe adding filtering for IRP_MJ_DIRECTORY_CONTROL, and then what???
Thanks in advance,
Gianni

Such a solution is not “backup”, it is called “HSM”.

Never remove the directories, only remove the files, retain the zero-size
anchors instead (maybe reparse points) and mark them as offline.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntfsd…
> Hi,
> I am working in a project to monitor the file access for a target
application. In the minifilter I am filtering every file open attempt and if
the creation will fail (i try to open the file myself in precreate) because the
file is missing i restore first the file from a backup directory, then i
return. This is working fine but in the case of a missed directory, i never see
the open of the file because CreateFile first test the existence of the file
path. How I could resolve this situation??? Maybe adding filtering for
IRP_MJ_DIRECTORY_CONTROL, and then what???
> Thanks in advance,
> Gianni
>

Thanks for your answer. The problem here is i am not who remove the directories (in reality is my client who is removing everything :slight_smile: ) The client idea is to make the target app work even if some directories are missing for whatever reason. My minifilter is working fine for missed files but is a complete folder is missing then the minifilter don’t receive the attemp to open the file so it can’t restore/redirect in time and the open fail.
Best Regards,
Gianni

Hi,
In order to do something i am goint to add filtering for IRP_MJ_DIRECTORY_CONTROL and then i will lie to the target app when it send directory queries. This could be a solution??? Any hint please will be very appreciated.
Thanks,
Gianni