My goal is to overwrite a files contents and name just before it is deleted - wiping deleted files.
I am trying to use a minifilter driver and the pre-cleanup callback routine that gets called just before the final delete operation.
So far I have been able to get rid of the create/changed/access dates and overwrite the contents of the file just before it gets deleted.
However I am not able to change the file name and owner information.
I found that I can rename the file using FltSetFileInformation, but the file does not delete properly during cleanup. With shift+delete, it gets deleted, but the filename on the disc remains the same as it was. With just a normal delete, it will not go to recycle bin(presumably because is cant move it, now that it has a new name.)
The control flow of minifilters is bit unclear to me. For instance if I call FltWriteFile does it just send another IRP, does it do it synchronously or asynchronously.
How can i change the name of the file i want to delete within the IRP , so it still gets deleted by the lower drivers.