Can I add some extra information when REPARSE

Hi, all

I am developing a shadow filesystem using minifilter dirver, and we use reparse mechanism to redirect the file to new path in pre-create.

Here Is how it works:

  1. In pre-create callback ,create new path acoording to old path,use IoReplaceFileObjectName to replace name, and set Data->IoStatus.Status = STATUS_REPARSE; Data->IoStatus.Information = IO_REPARSE; return FLT_PREOP_COMPLETE;
  2. we will receive a new IRP_MJ_CREATE with the new reparsed path.

The REPARSE works, but now we want to add some extra information from step 1 to step 2. For example, in step 2, we want to know whether the IRP is due to REPARSE.
I do some experiments, and find out that:

  1. The Data-Iopb-TargetFileObject is same address in step 1 and step 2.
  2. I try to set the FsContext, FsContext2, CompetionContext in Data-Iopb-TargetFileObject in step 1, but these fileds seem to be reseted to NULL in step 2.

Is this possible? Any suggestion ? Thank you for any help.

You want to add an ECP to your callback data. This may or may not involve adding an ECP_LIST first (you add the ECP to the ECP_LIST but you may need to create and add the ECP_LIST)

ECPs are identified by GUID, but they survive repasse. You’ll need to consult the docs for the precise APIs, but avoid the Flt ones if you are sharing ECPs between filters.

Thanks , it works, for others who reach this page by google, You can use the FltGetEcpListFromCallbackData family function. “but avoid the Flt ones if you are sharing ECPs between filters.” Microsoft gives a good sample, https://github.com/Microsoft/Windows-driver-samples/blob/master/filesys/miniFilter/avscan/filter/csvfs.c