How can I get Repase Point Information In IRP_MJ_CREATE?

I want to develop a file filter driver for reparse point.How can I get the Reparse Point information In IRP_MJ_CREATE ?Such as redirect filename with full path? How can I detect this opening file include Repase Point?

thanks

File system returns STATUS_REPARSE when attemp to open file with reparse
point is made. File system filter can check this status in completion
routine. IoStatus.Information will contain reparse point tag so filter can
check if it need to handle this reparse point.

Alexei.

“ÀîÏþÃù” wrote in message news:xxxxx@ntfsd…
> I want to develop a file filter driver for reparse point.How can I get the
Reparse Point information In IRP_MJ_CREATE ?Such as redirect filename with
full path? How can I detect this opening file include Repase Point?
>
> thanks
>
>

but how can I get the data in reparse point ? such as redirect file name ,
not just reparse point tag ?
“Alexei Jelvis” дÈëÏûÏ¢ÐÂÎÅ:xxxxx@ntfsd…
>
> File system returns STATUS_REPARSE when attemp to open file with reparse
> point is made. File system filter can check this status in completion
> routine. IoStatus.Information will contain reparse point tag so filter can
> check if it need to handle this reparse point.
>
> Alexei.
>
> “ÀîÏþÃù” wrote in message news:xxxxx@ntfsd…
> > I want to develop a file filter driver for reparse point.How can I get
the
> Reparse Point information In IRP_MJ_CREATE ?Such as redirect filename with
> full path? How can I detect this opening file include Repase Point?
> >
> > thanks
> >
> >
>
>
>
>

Reparse points not necessarily contain a redirected file name. It is a
general mechanism that allows file system filter to perform some action when
file is being accessed. For example, filter may fetch data from secondary
storage and then allow file to be opened. Generally it is up to the filter
that set reparse point decide how to handle it.
Some reparse point tags are reserved by Microsoft. One of those tags -
IO_REPARSE_TAG_MOUNT_POINT indicates that it is a mount point and file name
will be reparsed by IoManager.
When STATUS_REPARSE is returned, Irp->Tail.Overlay.AuxiliaryBuffer contains
pointer to reparse point information that was previously saved via
FSCTL_SET_REPARSE_POINT.
In case when reparse point is a mount point this buffer point to
REPARSE_DATA_BUFFER. This structure contains the new name of the file.
File that contain a reparse point has attribute
FILE_ATTRIBUTE_REPARSE_POINT.

Alexei.

“ÀîÏþÃù” wrote in message news:xxxxx@ntfsd…
>
> but how can I get the data in reparse point ? such as redirect file name ,
> not just reparse point tag ?
> “Alexei Jelvis” дÈëÏûÏ¢ÐÂÎÅ:xxxxx@ntfsd…
> >
> > File system returns STATUS_REPARSE when attemp to open file with reparse
> > point is made. File system filter can check this status in completion
> > routine. IoStatus.Information will contain reparse point tag so filter
can
> > check if it need to handle this reparse point.
> >
> > Alexei.
> >
> > “ÀîÏþÃù” wrote in message news:xxxxx@ntfsd…
> > > I want to develop a file filter driver for reparse point.How can I get
> the
> > Reparse Point information In IRP_MJ_CREATE ?Such as redirect filename
with
> > full path? How can I detect this opening file include Repase Point?
> > >
> > > thanks
> > >
> > >
> >
> >
> >
> >
>
>
>
>

Thanks for Alexei’s help!

It is better to express my problem clearly.

I want to develop a file filter driver for reparse point file. Now I have set the reparse point in a file success, include tag and redirect file name , in my user mode app.

And I know if I want to deal this file I just set the fileobject’s name to redirect file name and set the status to IO_REPARSE in IRP_MJ_CREATE.

And I know I can build a new irp and call IoCallDriver to detect what reparse point in the file .

But there is last question : How can I get the redirect file name? Can I get i t through FILE_ATTRIBUTE_REPARSE_POINT ?

Thanks

----- Original Message -----
From: “???”
To: “File Systems Developers”
Sent: Saturday, July 26, 2003 7:15 PM
Subject: [ntfsd] How can I get Repase Point Information In IRP_MJ_CREATE?

> I want to develop a file filter driver for reparse point.How can I get the Reparse Point information In IRP_MJ_CREATE ?Such as redirect filename with full path? How can I detect this opening file include Repase Point?
>
> thanks
>
> b???.???????v???j???\fzh,???d??{.n???zwZnV??隊[h???z{_??u?M͖±??+

Are you saying that you have defined your own tag, filled
REPARSE_GUID_DATA_BUFFER and then passed the buffer to the file system using
FSCTL_SET_REPARSE_POINT?
If it is the case then the REPARSE_GUID_DATA_BUFFER saved via
FSCTL_SET_REPARSE_POINT is available and pointed by
Irp->Tail.Overlay.AuxiliaryBuffer when the IRP_MJ_CRAETE is completed by the
file system, given that the file system driver returned STATUS_REPARSE.

Alexei.

“ÀîÏþÃù” wrote in message news:xxxxx@ntfsd…
> Thanks for Alexei’s help!
>
> It is better to express my problem clearly.
>
> I want to develop a file filter driver for reparse point file. Now I have
set the reparse point in a file success, include tag and redirect file name
, in my user mode app.
>
> And I know if I want to deal this file I just set the fileobject’s name to
redirect file name and set the status to IO_REPARSE in IRP_MJ_CREATE.
>
> And I know I can build a new irp and call IoCallDriver to detect what
reparse point in the file .
>
> But there is last question : How can I get the redirect file name? Can I
get i t through FILE_ATTRIBUTE_REPARSE_POINT ?
>
> Thanks
>
>
> ----- Original Message -----
> From: “ÀîÏþÃù”
> To: “File Systems Developers”
> Sent: Saturday, July 26, 2003 7:15 PM
> Subject: [ntfsd] How can I get Repase Point Information In IRP_MJ_CREATE?
>
>
> > I want to develop a file filter driver for reparse point.How can I get
the Reparse Point information In IRP_MJ_CREATE ?Such as redirect filename
with full path? How can I detect this opening file include Repase Point?
> >
> > thanks
> >
> > b‹š­ç.®·§¶\¬¹??Þv?µûjÉã¶\fzh,¡û\¢dèº{.n?‰·¬zwZnV§‘隊[h•æ¯z{_±ÝuÓMÍ–±
²‹+
>

YES, I have define myself’s tag and fill the redirect file name in the reparse data buffer. What I want to do in file filter is detect the tag and get the redirect file name form the reparse data buf.

So , I must open the same file in the IRP_MJ_CREATE to get these information . I read the article about ‘shadow device’ . Dose it work ? Can you give me some sample code about the 'shadow device '?
thanks
----- Original Message -----
From: “???”
To: “File Systems Developers”
Sent: Monday, July 28, 2003 1:57 PM
Subject: [ntfsd] Re: How can I get Repase Point Information In IRP_MJ_CREATE?

> Thanks for Alexei’s help!
>
> It is better to express my problem clearly.
>
> I want to develop a file filter driver for reparse point file. Now I have set the reparse point in a file success, include tag and redirect file name , in my user mode app.
>
> And I know if I want to deal this file I just set the fileobject’s name to redirect file name and set the status to IO_REPARSE in IRP_MJ_CREATE.
>
> And I know I can build a new irp and call IoCallDriver to detect what reparse point in the file .
>
> But there is last question : How can I get the redirect file name? Can I get i t through FILE_ATTRIBUTE_REPARSE_POINT ?
>
> Thanks
>
>
> ----- Original Message -----
> From: “???”
> To: “File Systems Developers”
> Sent: Saturday, July 26, 2003 7:15 PM
> Subject: [ntfsd] How can I get Repase Point Information In IRP_MJ_CREATE?
>
>
> > I want to develop a file filter driver for reparse point.How can I get the Reparse Point information In IRP_MJ_CREATE ?Such as redirect filename with full path? How can I detect this opening file include Repase Point?
> >
> > thanks
> >
> > b???.???????v???j???\fzh,???d??{.n???zwZnV??隊[h???z{??u?M͖±??+
> b??箷????vڵ?jɶ\zh???d??{.n???zwZnV??隊[h???z{
??u?M͖±??+

No, you don’t need to open the file again. If file has a reprse point file
system will fail IRP_MJ_CREATE with STATUS_REPARSE. File system will put tag
value in IoStatus.Information field.
You need to wait in dispatch routine for completion of the IRP by file
system and then examine Irp->IoStatus. If IoStatus.Status == STATUS_REPARSE
and IoStatus.Information == YourTag, then AuxiliaryBuffer contians the
information you need.
Then you can set IoStatus.Information = IO_REPARSE, replace FileName with
the name you want and complete the IRP.
In order to be able to complete the IRP after file system has completed it
you need to set completion routine that returns
STATUS_MORE_PROCESSING_REQUIRED.
Even if you want to open file again you don’t have to use “shadow device”.
You may just “hijack” the IRP you already have, set FILE_OPEN_REPARSE_POINT
flag and send the IRP to the file system. When you are done with the file,
call IoCancelFileOpen and then complete the IRP with STAUS_REPARSE to let
IoManager know that it need to reparse.

Alexei.

“ÀîÏþÃù” wrote in message news:xxxxx@ntfsd…
> YES, I have define myself’s tag and fill the redirect file name in the
reparse data buffer. What I want to do in file filter is detect the tag and
get the redirect file name form the reparse data buf.
>
> So , I must open the same file in the IRP_MJ_CREATE to get these
information . I read the article about ‘shadow device’ . Dose it work ? Can
you give me some sample code about the 'shadow device '?
> thanks
> ----- Original Message -----
> From: “ÀîÏþÃù”
> To: “File Systems Developers”
> Sent: Monday, July 28, 2003 1:57 PM
> Subject: [ntfsd] Re: How can I get Repase Point Information In
IRP_MJ_CREATE?
>
>
> > Thanks for Alexei’s help!
> >
> > It is better to express my problem clearly.
> >
> > I want to develop a file filter driver for reparse point file. Now I
have set the reparse point in a file success, include tag and redirect file
name , in my user mode app.
> >
> > And I know if I want to deal this file I just set the fileobject’s name
to redirect file name and set the status to IO_REPARSE in IRP_MJ_CREATE.
> >
> > And I know I can build a new irp and call IoCallDriver to detect what
reparse point in the file .
> >
> > But there is last question : How can I get the redirect file name? Can
I get i t through FILE_ATTRIBUTE_REPARSE_POINT ?
> >
> > Thanks
> >
> >
> > ----- Original Message -----
> > From: “ÀîÏþÃù”
> > To: “File Systems Developers”
> > Sent: Saturday, July 26, 2003 7:15 PM
> > Subject: [ntfsd] How can I get Repase Point Information In
IRP_MJ_CREATE?
> >
> >
> > > I want to develop a file filter driver for reparse point.How can I get
the Reparse Point information In IRP_MJ_CREATE ?Such as redirect filename
with full path? How can I detect this opening file include Repase Point?
> > >
> > > thanks
> > >
> > > b‹š­ç.®·§¶\¬¹??Þv?µûjÉã¶\fzh,¡û\¢dèº{.n?‰·¬zwZnV§‘隊[h•æ¯z{_±ÝuÓMÍ–
±²‹+
> > b‹­ç®·¶\¹»?vÚµûjɶ\zh¡û¢dèº{.n?‰·¬zwZnV§‘隊[h•æ¯z{_±ÝuÓMÍ–±²‹+
>