FILE_OBJECT Context...

Hi,

I am writing a sFilter based FSFD, I want to save a per-file context data ( per FILE_OBJECT ) and I wonder… is it safe for a FSFD to use FILE_OBJECT::FsContext to store this kind of data, doesnt the underling FSD or FSFD driver already use it?
How can I store Per FILE_OBJECT information in a way it could be extracted efficiently?

Any comment, sample or pointer would be appreciated.

Nadav.


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

To save per open instance information, either store it as part of your
filter context (which is per file, not per file object) in a linked list
or table of some sort, or use a per-volume table. Note: per FILE_OBJECT
is note the same as “per file”. Many FILE_OBJECTs may represent open
instances to the same file.

Regards,

Tony

Tony Mason

Consulting Partner

OSR Open Systems Resources, Inc.

http://www.osr.com http:</http:>


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Nadav
Sent: Sunday, May 22, 2005 9:33 AM
To: ntfsd redirect
Subject: [ntfsd] FILE_OBJECT Context…

Hi,

I am writing a sFilter based FSFD, I want to save a per-file context
data ( per FILE_OBJECT ) and I wonder… is it safe for a FSFD to use
FILE_OBJECT::FsContext to store this kind of data, doesnt the underling
FSD or FSFD driver already use it?
How can I store Per FILE_OBJECT information in a way it could be
extracted efficiently?

Any comment, sample or pointer would be appreciated.

Nadav.


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com — Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17 You are currently subscribed
to ntfsd as: xxxxx@osr.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

Hi Tony,

Thanks for your immediate responce, I need some clarifications concerning what you have said:
What exactly do you refer by saying ‘filter context’ as I understand ( fix me if i am wrong ) a FSFD is added to each FS volume stack, a device is created ( IoCreateDevice ) and a context/extention for that volume is created, does this context extention is what you refer to by saying ‘filter context’ ?

P.S.
the sFilter use a hash-table ( implemented by a linked list ) to manage a context on a per-file basis, I rather use a mechnism more efficient then the hash mechanism introduced by sFilter as my driver should perform hashing extraction on a per read/write basis…

ThanX again,
Nadav.

Tony Mason wrote:
v:* {behavior:url(#default#VML);}o:* {behavior:url(#default#VML);}w:* {behavior:url(#default#VML);}.shape {behavior:url(#default#VML);}st1:*{behavior:url(#default#ieooui) }
To save per open instance information, either store it as part of your filter context (which is per file, not per file object) in a linked list or table of some sort, or use a per-volume table. Note: per FILE_OBJECT is note the same as “per file”. Many FILE_OBJECTs may represent open instances to the same file.

Regards,

Tony

Tony Mason

Consulting Partner

OSR Open Systems Resources, Inc.

http://www.osr.com

---------------------------------

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Nadav
Sent: Sunday, May 22, 2005 9:33 AM
To: ntfsd redirect
Subject: [ntfsd] FILE_OBJECT Context…

Hi,

I am writing a sFilter based FSFD, I want to save a per-file context data ( per FILE_OBJECT ) and I wonder… is it safe for a FSFD to use FILE_OBJECT::FsContext to store this kind of data, doesnt the underling FSD or FSFD driver already use it?
How can I store Per FILE_OBJECT information in a way it could be extracted efficiently?

Any comment, sample or pointer would be appreciated.

Nadav.


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com — Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17 You are currently subscribed to ntfsd as: xxxxx@osr.com To unsubscribe send a blank email to xxxxx@lists.osr.com


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

Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Nadav,

You’re going to have to refer to the IFS Kit documentation - see
FsRtlLookupPerStreamContext for a starting point on the per-file context
information. This is the most efficient way to maintain per-file-stream
(which means “file” for FAT, and “stream of a file” for NTFS, with
::$DATA being the normal data stream) information. To use this, you
must be using the latest security roll-up on W2SP4, or XP, or Windows
2K.

I hope this helps.

Regards,

Tony

Tony Mason

Consulting Partner

OSR Open Systems Resources, Inc.

http://www.osr.com


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Nadav
Sent: Sunday, May 22, 2005 10:41 AM
To: ntfsd redirect
Subject: RE: [ntfsd] FILE_OBJECT Context…

Hi Tony,

Thanks for your immediate responce, I need some clarifications
concerning what you have said:
What exactly do you refer by saying ‘filter context’ as I understand (
fix me if i am wrong ) a FSFD is added to each FS volume stack, a device
is created ( IoCreateDevice ) and a context/extention for that volume is
created, does this context extention is what you refer to by saying
‘filter context’ ?

P.S.

the sFilter use a hash-table ( implemented by a linked list ) to manage
a context on a per-file basis, I rather use a mechnism more efficient
then the hash mechanism introduced by sFilter as my driver should
perform hashing extraction on a per read/write basis…

ThanX again,

Nadav.

Tony Mason wrote:

To save per open instance information, either store it as part
of your filter context (which is per file, not per file object) in a
linked list or table of some sort, or use a per-volume table. Note: per
FILE_OBJECT is note the same as “per file”. Many FILE_OBJECTs may
represent open instances to the same file.

Regards,

Tony

Tony Mason

Consulting Partner

OSR Open Systems Resources, Inc.

http://www.osr.com http:</http:>



From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Nadav
Sent: Sunday, May 22, 2005 9:33 AM
To: ntfsd redirect
Subject: [ntfsd] FILE_OBJECT Context…

Hi,

I am writing a sFilter based FSFD, I want to save a per-file
context data ( per FILE_OBJECT ) and I wonder… is it safe for a FSFD
to use FILE_OBJECT::FsContext to store this kind of data, doesnt the
underling FSD or FSFD driver already use it?
How can I store Per FILE_OBJECT information in a way it could be
extracted efficiently?

Any comment, sample or pointer would be appreciated.

Nadav.

__________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com — Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17 You are currently subscribed
to ntfsd as: xxxxx@osr.com To unsubscribe send a blank email to
xxxxx@lists.osr.com


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

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com — Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17 You are currently subscribed
to ntfsd as: xxxxx@osr.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

No.

FsContext belongs to the lowest FSD in the stack. FSFs can only use its value as an index to some tables, but not as a pointer.

Your filter can maintain something like a hash table of context structures, and use this value as a key to this hash table.

FltMgr handles this automatically BTW.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: Nadav
To: Windows File Systems Devs Interest List
Sent: Sunday, May 22, 2005 5:33 PM
Subject: [ntfsd] FILE_OBJECT Context…

Hi,

I am writing a sFilter based FSFD, I want to save a per-file context data ( per FILE_OBJECT ) and I wonder… is it safe for a FSFD to use FILE_OBJECT::FsContext to store this kind of data, doesnt the underling FSD or FSFD driver already use it?
How can I store Per FILE_OBJECT information in a way it could be extracted efficiently?

Any comment, sample or pointer would be appreciated.

Nadav.


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com — Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17 You are currently subscribed to ntfsd as: xxxxx@storagecraft.com To unsubscribe send a blank email to xxxxx@lists.osr.com