Hi,
While going through the previous posts on this site, I found that the file
name from the FILE_OBJECT is valid only in the create path. The developer
who wishes to perform further operations (read, write) based on the file
name should remember it in the create path and not try to determine it in
other IRPS where the file name can be invalid.
Is this true even for the mini filters? In the signature of the callbacks
there are two parameters which are of FILE_OBJECT type. 1) FILE_OBJECT in
FLT_RELATED_OBJECTS 2) FILE_OBJECT (target file object) in
FLT_CALLBACK_DATA (Data->Iopb->TargetFileObject). Also in the IFS document
does not seem to say that file name will be invalid in paths other then
create.
~Ruhina
Yes, that’s certainly true in a mini-filter as well. Filter Manager is just
a legacy file system filter driver that provides callouts to minifilter
routines. However, there’s no need to get the file name from the file
object in a minifilter. Filter manager caches the name for you, and you can
use FltGetFileNameInformation to retrieve it. It is still best to make this
call in pre or post create and save the information, because there are times
when it is unsafe to query the name.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of ruhina
Sent: Monday, April 24, 2006 3:13 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Mini filter and retrieval of file name
Hi,
While going through the previous posts on this site, I found that the file
name from the FILE_OBJECT is valid only in the create path. The developer
who wishes to perform further operations (read, write) based on the file
name should remember it in the create path and not try to determine it in
other IRPS where the file name can be invalid.
Is this true even for the mini filters? In the signature of the callbacks
there are two parameters which are of FILE_OBJECT type. 1) FILE_OBJECT in
FLT_RELATED_OBJECTS 2) FILE_OBJECT (target file object) in
FLT_CALLBACK_DATA (Data->Iopb->TargetFileObject). Also in the IFS document
does not seem to say that file name will be invalid in paths other then
create.
~Ruhina
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
Hi Dan,
Many thanks for your reply. Yes you are right. (FltGetFileNameInformation
cannot be called for e.g. in the paging I/O path). I wonder what is the use
of the file name field in the FILE_OBJECT (May be the file system drivers
should not bothered about the file names after the create path). What are
the different approaches that you suggest, I could use for remembering the
file name (like maintaining my own map or using stream context management or
any other approach. I have read through the old archives on this site and
found these two approaches and am not able to decide which one to use)?
One more problem that I am facing is with addition of header in the
contents of a file. This problem has been discussed many times on this site
and the solutions seem to be either using a trailer or storing the header in
a separate database, having a header with size of one page, having two file
objects one for header other for data etc. But in my case I am interested in
a header according to some of my product requirements. I have forged the
file sizes in all the relevant IRPS (IRP_MJ_QUERY_INFORMATION and
IRP_MJ_DIRECTORY_CONTROL) and the reading (from an offset skipping the
header) works fine. However while writing the file problem occurs due to
mismatch in size between the data in cache and data that is actually been
written. In some cases the editor first creates a temporary file and then
reports not much disk space as the size of the temp file is greater then
size of the actual file (I may be wrong here). Here I have tried changing
the file size in non paging IRP_MJ_WRITE as well as non paging
IRP_MJ_SET_INFORMATION. Also buffer swapping is done correctly. Could you
provide any clue/hint here? This would be very helpful.
~Ruhina
From: ruhina [mailto:xxxxx@persistent.co.in]
Sent: Monday, April 24, 2006 2:43 PM
To: ‘Windows File Systems Devs Interest List’
Subject: Mini filter and retrieval of file name
Hi,
While going through the previous posts on this site, I found that the file
name from the FILE_OBJECT is valid only in the create path. The developer
who wishes to perform further operations (read, write) based on the file
name should remember it in the create path and not try to determine it in
other IRPS where the file name can be invalid.
Is this true even for the mini filters? In the signature of the callbacks
there are two parameters which are of FILE_OBJECT type. 1) FILE_OBJECT in
FLT_RELATED_OBJECTS 2) FILE_OBJECT (target file object) in
FLT_CALLBACK_DATA (Data->Iopb->TargetFileObject). Also in the IFS document
does not seem to say that file name will be invalid in paths other then
create.
~Ruhina