I have problems in writing a minifilter driver.
I wrote a minifilter driver that basically redirects files to another folder.
So when a file is created or read in folder SOURCE it redirects to REDIRECTED.
To do this, I hook the IRP_MJ_CREATE (preoperation) and IRP_MJ_SET_INFORMATION (preoperation for FileRenameInformation).
In the IRP_MJ_CREATE I use the STATUS_REPARSE/IO_REPARSE/FltSetCallbackDataDirty approach modifying the Data->Iopb->TargetFileObject->FileName value.
In the IRP_MJ_SET_INFORMATION case I use the FltSetInformationFile/FltSetCallbackDataDirty approach.
All works OK: I save files to SOURCE and I see it in REDIRECTED... When I do a copy (drag&drop with ctrl pressed) if the file exists in REDIRECTED (I drop it in source) then I am asked to overwrite the file.
However if this operation is from Outlook (I select an Outlook attachment and drag it to SOURCE and the file exists) then nothing is asked even if the file exists in REDIRECTED.
I think maybe Outlook does the verification to see if the file exists using something like FindFirstFile and it does not trigger a file open....