How can I get the current dirctory in a file system filter driver?

Hi,

Thanks your guys for very helpful responses. I have another question of how
to get the current directory or default directory full path from the lower
file system device driver. It seems that the file system knows where the
current directory is. Because I can access the file by relative path name
i.e. DeleteFile(“abc.txt”). But my filter only gets the relative name in
FileObject->FileName if the file needs be reparsed. Apparently the file
system successfully read the file and found that the file is a reparse point
file, then goes to my filter driver to ask for reparsing.
Any hint is appreciated.

Shangwu

You do get the entire path in IRP_MJ_CREATE - but just not in the file
object itself. There is a related file object that contains the rest of
the name. If you have the IFSKIT - look in the filespy sample which
shows how to decode the full name of the file being accessed - and the
rules of how to do it.

After create, never use the file object’s FileName since this is not
guaranteed to be correct - or even valid I believe.

/TomH

-----Original Message-----
From: Shangwu Qi [mailto:xxxxx@fcni.com]
Sent: Monday, February 03, 2003 5:14 PM
To: File Systems Developers
Subject: [ntfsd] How can I get the current dirctory in a file system
filter driver?

Hi,

Thanks your guys for very helpful responses. I have another question of
how
to get the current directory or default directory full path from the
lower
file system device driver. It seems that the file system knows where the
current directory is. Because I can access the file by relative path
name
i.e. DeleteFile(“abc.txt”). But my filter only gets the relative name in
FileObject->FileName if the file needs be reparsed. Apparently the file
system successfully read the file and found that the file is a reparse
point
file, then goes to my filter driver to ask for reparsing.
Any hint is appreciated.

Shangwu


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

I think it is only guaranteed during the dispatch processing of a file
system filter and not during the completion routine.

----- Original Message -----
From: “Tom Hansen”
To: “File Systems Developers”
Sent: Monday, February 03, 2003 5:39 PM
Subject: [ntfsd] RE: How can I get the current dirctory in a file system
filter driver?

You do get the entire path in IRP_MJ_CREATE - but just not in the file
object itself. There is a related file object that contains the rest of
the name. If you have the IFSKIT - look in the filespy sample which
shows how to decode the full name of the file being accessed - and the
rules of how to do it.

After create, never use the file object’s FileName since this is not
guaranteed to be correct - or even valid I believe.

/TomH

-----Original Message-----
From: Shangwu Qi [mailto:xxxxx@fcni.com]
Sent: Monday, February 03, 2003 5:14 PM
To: File Systems Developers
Subject: [ntfsd] How can I get the current dirctory in a file system
filter driver?

Hi,

Thanks your guys for very helpful responses. I have another question of
how
to get the current directory or default directory full path from the
lower
file system device driver. It seems that the file system knows where the
current directory is. Because I can access the file by relative path
name
i.e. DeleteFile(“abc.txt”). But my filter only gets the relative name in
FileObject->FileName if the file needs be reparsed. Apparently the file
system successfully read the file and found that the file is a reparse
point
file, then goes to my filter driver to ask for reparsing.
Any hint is appreciated.

Shangwu


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


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

It is only valid to look at the FileName and RelatedFileObject fields of
a FILE_OBJECT structure during pre-create. These fields are not
necessarily valid at any other time.

Neal Christiansen
Microsoft File System Filter Group

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

-----Original Message-----
From: David J. Craig [mailto:xxxxx@yoshimuni.com]
Sent: Monday, February 03, 2003 3:32 PM
To: File Systems Developers

I think it is only guaranteed during the dispatch processing of a file
system filter and not during the completion routine.

----- Original Message -----
From: “Tom Hansen”
To: “File Systems Developers”
Sent: Monday, February 03, 2003 5:39 PM
Subject: [ntfsd] RE: How can I get the current dirctory in a file system
filter driver?

You do get the entire path in IRP_MJ_CREATE - but just not in the file
object itself. There is a related file object that contains the rest of
the name. If you have the IFSKIT - look in the filespy sample which
shows how to decode the full name of the file being accessed - and the
rules of how to do it.

After create, never use the file object’s FileName since this is not
guaranteed to be correct - or even valid I believe.

/TomH

-----Original Message-----
From: Shangwu Qi [mailto:xxxxx@fcni.com]
Sent: Monday, February 03, 2003 5:14 PM
To: File Systems Developers
Subject: [ntfsd] How can I get the current dirctory in a file system
filter driver?

Hi,

Thanks your guys for very helpful responses. I have another question of
how
to get the current directory or default directory full path from the
lower
file system device driver. It seems that the file system knows where the
current directory is. Because I can access the file by relative path
name
i.e. DeleteFile(“abc.txt”). But my filter only gets the relative name in
FileObject->FileName if the file needs be reparsed. Apparently the file
system successfully read the file and found that the file is a reparse
point
file, then goes to my filter driver to ask for reparsing.
Any hint is appreciated.

Shangwu


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


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


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

Plus, the FSD has no concept of a current directory. If you get a
filename with no path, you need to check the related FO; by calling the
lower FSD to get the full path of the related FO.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Neal Christiansen
Sent: Monday, February 03, 2003 4:58 PM
To: File Systems Developers
Subject: [ntfsd] RE: How can I get the current dirctory in a file system
filter driver?

It is only valid to look at the FileName and RelatedFileObject fields of
a FILE_OBJECT structure during pre-create. These fields are not
necessarily valid at any other time.

Neal Christiansen
Microsoft File System Filter Group

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

-----Original Message-----
From: David J. Craig [mailto:xxxxx@yoshimuni.com]
Sent: Monday, February 03, 2003 3:32 PM
To: File Systems Developers

I think it is only guaranteed during the dispatch processing of a file
system filter and not during the completion routine.

----- Original Message -----
From: “Tom Hansen”
To: “File Systems Developers”
Sent: Monday, February 03, 2003 5:39 PM
Subject: [ntfsd] RE: How can I get the current dirctory in a file system
filter driver?

You do get the entire path in IRP_MJ_CREATE - but just not in the file
object itself. There is a related file object that contains the rest of
the name. If you have the IFSKIT - look in the filespy sample which
shows how to decode the full name of the file being accessed - and the
rules of how to do it.

After create, never use the file object’s FileName since this is not
guaranteed to be correct - or even valid I believe.

/TomH

-----Original Message-----
From: Shangwu Qi [mailto:xxxxx@fcni.com]
Sent: Monday, February 03, 2003 5:14 PM
To: File Systems Developers
Subject: [ntfsd] How can I get the current dirctory in a file system
filter driver?

Hi,

Thanks your guys for very helpful responses. I have another question of
how
to get the current directory or default directory full path from the
lower
file system device driver. It seems that the file system knows where the
current directory is. Because I can access the file by relative path
name
i.e. DeleteFile(“abc.txt”). But my filter only gets the relative name in
FileObject->FileName if the file needs be reparsed. Apparently the file
system successfully read the file and found that the file is a reparse
point
file, then goes to my filter driver to ask for reparsing.
Any hint is appreciated.

Shangwu


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


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


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


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

Thank you all so much.

“Jamey Kirby” wrote in message news:xxxxx@ntfsd…
>
> Plus, the FSD has no concept of a current directory. If you get a
> filename with no path, you need to check the related FO; by calling the
> lower FSD to get the full path of the related FO.
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Neal Christiansen
> Sent: Monday, February 03, 2003 4:58 PM
> To: File Systems Developers
> Subject: [ntfsd] RE: How can I get the current dirctory in a file system
> filter driver?
>
> It is only valid to look at the FileName and RelatedFileObject fields of
> a FILE_OBJECT structure during pre-create. These fields are not
> necessarily valid at any other time.
>
> Neal Christiansen
> Microsoft File System Filter Group
>
> This posting is provided “AS IS” with no warranties, and confers no
> rights.
>
> -----Original Message-----
> From: David J. Craig [mailto:xxxxx@yoshimuni.com]
> Sent: Monday, February 03, 2003 3:32 PM
> To: File Systems Developers
>
> I think it is only guaranteed during the dispatch processing of a file
> system filter and not during the completion routine.
>
> ----- Original Message -----
> From: “Tom Hansen”
> To: “File Systems Developers”
> Sent: Monday, February 03, 2003 5:39 PM
> Subject: [ntfsd] RE: How can I get the current dirctory in a file system
> filter driver?
>
>
> You do get the entire path in IRP_MJ_CREATE - but just not in the file
> object itself. There is a related file object that contains the rest of
> the name. If you have the IFSKIT - look in the filespy sample which
> shows how to decode the full name of the file being accessed - and the
> rules of how to do it.
>
> After create, never use the file object’s FileName since this is not
> guaranteed to be correct - or even valid I believe.
>
> /TomH
>
> -----Original Message-----
> From: Shangwu Qi [mailto:xxxxx@fcni.com]
> Sent: Monday, February 03, 2003 5:14 PM
> To: File Systems Developers
> Subject: [ntfsd] How can I get the current dirctory in a file system
> filter driver?
>
> Hi,
>
> Thanks your guys for very helpful responses. I have another question of
> how
> to get the current directory or default directory full path from the
> lower
> file system device driver. It seems that the file system knows where the
> current directory is. Because I can access the file by relative path
> name
> i.e. DeleteFile(“abc.txt”). But my filter only gets the relative name in
> FileObject->FileName if the file needs be reparsed. Apparently the file
> system successfully read the file and found that the file is a reparse
> point
> file, then goes to my filter driver to ask for reparsing.
> Any hint is appreciated.
>
> Shangwu
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@inflectionsystems.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@yoshimuni.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>