How to get a file full path?

I use
RtlVolumeDeviceToDosName(irpSp->FileObject,&dosName);…
but error occured, why?

for example, in IRP_MJ_SET_INFORMATION’s dispatch function, I want to know
which file is to be set, how can I get the full path of the target file?

RtlVolumeDeviceToDosName is used to get the DOS name of a storage stack
device object (ie, D:, E:), not the file name of a File Object.
Assuming you are trying to get a file name AFTER the create operation,
you could roll a IRP_MJ_QUERY_INFORMATION in the context of the current
thread.

Adam

“This posting is provided “AS IS” with no warranties, and confers no
rights.”

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Holk
Sent: Thursday, April 08, 2004 12:54 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] How to get a file full path?

I use
RtlVolumeDeviceToDosName(irpSp->FileObject,&dosName);…
but error occured, why?

for example, in IRP_MJ_SET_INFORMATION’s dispatch function, I want to
know which file is to be set, how can I get the full path of the target
file?


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Thanks a lot,
but I just want to know which file to be set in dispatch function of
IRP_MJ_SET_INFORMATION,
I think I can use ret =
ObQueryNameString(irpSp->Parameters.SetFile.FileObject,&dosName,MAX_DEVNAME_
LENGTH,&len);
to get the file name, is that right?
but I failed the try due to page error, why?
How can I get the file name in the dispatch function of
IRP_MJ_SET_INFORMATION?

“Adam Landefeld” ???:xxxxx@ntfsd…
RtlVolumeDeviceToDosName is used to get the DOS name of a storage stack
device object (ie, D:, E:), not the file name of a File Object.
Assuming you are trying to get a file name AFTER the create operation,
you could roll a IRP_MJ_QUERY_INFORMATION in the context of the current
thread.

Adam

“This posting is provided “AS IS” with no warranties, and confers no
rights.”

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Holk
Sent: Thursday, April 08, 2004 12:54 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] How to get a file full path?

I use
RtlVolumeDeviceToDosName(irpSp->FileObject,&dosName);…
but error occured, why?

for example, in IRP_MJ_SET_INFORMATION’s dispatch function, I want to
know which file is to be set, how can I get the full path of the target
file?


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

irpSp->Parameters.SetFile.FileObject is a wrong file object. It is a target
directory for rename operation and is not used in any other
IRP_MJ_SET_INFORMATION requests. You need to use irpSp->FileObject to refer
to the file object that is the target of the request.

Alexei.

“Holk” wrote in message news:xxxxx@ntfsd…
> Thanks a lot,
> but I just want to know which file to be set in dispatch function of
> IRP_MJ_SET_INFORMATION,
> I think I can use ret =
>
ObQueryNameString(irpSp->Parameters.SetFile.FileObject,&dosName,MAX_DEVNAME_
> LENGTH,&len);
> to get the file name, is that right?
> but I failed the try due to page error, why?
> How can I get the file name in the dispatch function of
> IRP_MJ_SET_INFORMATION?
>
>
> “Adam Landefeld” ???:xxxxx@ntfsd…
> RtlVolumeDeviceToDosName is used to get the DOS name of a storage stack
> device object (ie, D:, E:), not the file name of a File Object.
> Assuming you are trying to get a file name AFTER the create operation,
> you could roll a IRP_MJ_QUERY_INFORMATION in the context of the current
> thread.
>
> Adam
>
> “This posting is provided “AS IS” with no warranties, and confers no
> rights.”
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Holk
> Sent: Thursday, April 08, 2004 12:54 AM
> To: Windows File Systems Devs Interest List
> Subject: [ntfsd] How to get a file full path?
>
> I use
> RtlVolumeDeviceToDosName(irpSp->FileObject,&dosName);…
> but error occured, why?
>
> for example, in IRP_MJ_SET_INFORMATION’s dispatch function, I want to
> know which file is to be set, how can I get the full path of the target
> file?
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>

thanks, I tried irpSp->FileObject,but error still stick.
I noticed in the sample sfilter, the function sfGetFileName can get the
filename as expected in dealing with irp_create, but when I use the function
in dealing with irp_set_information, errors occur.

what is the difference in the two places for the same function?

“Alexei Jelvis” дÈëÏûÏ¢ÐÂÎÅ:xxxxx@ntfsd…
> irpSp->Parameters.SetFile.FileObject is a wrong file object. It is a
target
> directory for rename operation and is not used in any other
> IRP_MJ_SET_INFORMATION requests. You need to use irpSp->FileObject to
refer
> to the file object that is the target of the request.
>
> Alexei.
>
> “Holk” wrote in message news:xxxxx@ntfsd…
> > Thanks a lot,
> > but I just want to know which file to be set in dispatch function of
> > IRP_MJ_SET_INFORMATION,
> > I think I can use ret =
> >
>
ObQueryNameString(irpSp->Parameters.SetFile.FileObject,&dosName,MAX_DEVNAME_
> > LENGTH,&len);
> > to get the file name, is that right?
> > but I failed the try due to page error, why?
> > How can I get the file name in the dispatch function of
> > IRP_MJ_SET_INFORMATION?
> >
> >
> > “Adam Landefeld” ???:xxxxx@ntfsd…
> > RtlVolumeDeviceToDosName is used to get the DOS name of a storage stack
> > device object (ie, D:, E:), not the file name of a File Object.
> > Assuming you are trying to get a file name AFTER the create operation,
> > you could roll a IRP_MJ_QUERY_INFORMATION in the context of the current
> > thread.
> >
> > Adam
> >
> > “This posting is provided “AS IS” with no warranties, and confers no
> > rights.”
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Holk
> > Sent: Thursday, April 08, 2004 12:54 AM
> > To: Windows File Systems Devs Interest List
> > Subject: [ntfsd] How to get a file full path?
> >
> > I use
> > RtlVolumeDeviceToDosName(irpSp->FileObject,&dosName);…
> > but error occured, why?
> >
> > for example, in IRP_MJ_SET_INFORMATION’s dispatch function, I want to
> > know which file is to be set, how can I get the full path of the target
> > file?
> >
> >
> >
> > —
> > Questions? First check the IFS FAQ at
> > https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
>
>
>