Passing extra file information from FSD to low-level device driver

Hello all,

How is it possible to pass extra file “handle” (own file descriptor) from
FSD
(or FS filter driver) to low-level device driver along with Read/Write
requests?
It is necessary that this “handle” does not conflict with FSDs, intermediate
FS
filter drivers and be transparent for them. Generally, how can I safely pass
some
own data to low level device driver through all driver stack? May I use
IRP->FO->FCB for that purpose? Would FCB be still valid in low-level device
driver or it can be changed during passing drivers stack? In my low-level
device
driver I need to know to what file each block belongs to.

Regards,
Alexander

> own data to low level device driver through all driver stack? May I use

IRP->FO->FCB for that purpose?

No. It is not Irp->FileObject, but CurrentLoc->FileObject.
Lower driver will have another current stack location.

driver or it can be changed during passing drivers stack? In my low-level
device
driver I need to know to what file each block belongs to.

You must have a combination of the FS filter and the disk filter in the same
code module.
On CREATE processing in the FS filter, do FSCTL_GET_RETRIEVAL_POINTERS to
extract the block numbers occupied by the file. Pass this information to the
disk filter then.

Max