Hi,
I develop a minifilter driver that need to keep propriety information on files per file open. From what I understand using stream context is not OK since it is one for a file even if its open several times in parallel.
I understand that I should use file context (functions like FltSetFileContext) but they are not supported on windows XP.
Is there an easy way to implement the unavailable file contexts on XP.
I read in some post that it should be easy but I didn’t understand the method.
Regards,
Sagi
From your description, it sounds like what you need is a stream handle
context, which is available on WXP. It provides a context per handle.
Eric
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@giant-steps.com
Sent: Thursday, March 19, 2009 9:38 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] File contexts on XP
Hi,
I develop a minifilter driver that need to keep propriety
information on files per file open. From what I understand
using stream context is not OK since it is one for a file
even if its open several times in parallel.
I understand that I should use file context (functions like
FltSetFileContext) but they are not supported on windows XP.
Is there an easy way to implement the unavailable file
contexts on XP.
I read in some post that it should be easy but I didn’t
understand the method.
Regards,
Sagi
NTFSD is sponsored by OSR
For our schedule of debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online
at http://www.osronline.com/page.cfm?name=ListServer
File context is 1 for all NTFS data streams in the file, and is rarely needed.
What you need is a stream context, since the alternate data streams are not of much use anyway (used by Services for Macintosh and malware only).
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From:
To: “Windows File Systems Devs Interest List”
Sent: Thursday, March 19, 2009 4:37 PM
Subject: [ntfsd] File contexts on XP
> Hi,
>
> I develop a minifilter driver that need to keep propriety information on files per file open. From what I understand using stream context is not OK since it is one for a file even if its open several times in parallel.
> I understand that I should use file context (functions like FltSetFileContext) but they are not supported on windows XP.
> Is there an easy way to implement the unavailable file contexts on XP.
> I read in some post that it should be easy but I didn’t understand the method.
>
> Regards,
> Sagi
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
> alternate data streams are not of much use anyway (used by Services for
Macintosh and malware only).
Suggestion: “used by malware and Services for Macintosh only”
----- Original Message -----
From: “Maxim S. Shatskih”
To: “Windows File Systems Devs Interest List”
Sent: Thursday, March 19, 2009 9:41 AM
Subject: Re: [ntfsd] File contexts on XP
File context is 1 for all NTFS data streams in the file, and is rarely
needed.
What you need is a stream context, since the alternate data streams are
not of much use anyway (used by Services for Macintosh and malware only).
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From:
To: “Windows File Systems Devs Interest List”
Sent: Thursday, March 19, 2009 4:37 PM
Subject: [ntfsd] File contexts on XP
> Hi,
>
> I develop a minifilter driver that need to keep propriety information on
> files per file open. From what I understand using stream context is not OK
> since it is one for a file even if its open several times in parallel.
> I understand that I should use file context (functions like
> FltSetFileContext) but they are not supported on windows XP.
> Is there an easy way to implement the unavailable file contexts on XP.
> I read in some post that it should be easy but I didn’t understand the
> method.
>
> Regards,
> Sagi
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
—
NTFSD is sponsored by OSR
For our schedule of debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
Hi,
According to my knowledge if a file is oppened twice the driver can attach only one stream context.
Lets say that a file is open simultaneity by two application. The minifilter receive two OPEN.
In the first open when the driver use FltGetStreamContext it will not receive a context so it will allocate the a context and use FltSetStreamContext to attach it.
In the second open when the driver call FltGetStreamContext it will receive the previously attached stream context and can replace it if it wants to. but only one stream context is allowed.
Now if I want to save different info about the first and second open of the file. How can it be done using one stream context?
Maybe I misunderstand something and when I get the stream context in the second open I can replace it with a new allocated stream context and I will get the relevant stream context in future operations?
Regards,
Sagi
> alternate data streams are not of much use anyway (used by Services for
Macintosh and malware only).
Also for ZONE ID when you download something from internet or intranet.
-bg
The function you are looking for is FltSetStreamHandleContext and its
friends. http://msdn.microsoft.com/en-us/library/aa488687.aspx
Eric
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@giant-steps.com
Sent: Thursday, March 19, 2009 10:25 AM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] File contexts on XP
Hi,
According to my knowledge if a file is oppened twice the
driver can attach only one stream context.
Lets say that a file is open simultaneity by two application.
The minifilter receive two OPEN.
In the first open when the driver use FltGetStreamContext it
will not receive a context so it will allocate the a context
and use FltSetStreamContext to attach it.
In the second open when the driver call FltGetStreamContext
it will receive the previously attached stream context and
can replace it if it wants to. but only one stream context is allowed.
Now if I want to save different info about the first and
second open of the file. How can it be done using one stream context?
Maybe I misunderstand something and when I get the stream
context in the second open I can replace it with a new
allocated stream context and I will get the relevant stream
context in future operations?
Regards,
Sagi
NTFSD is sponsored by OSR
For our schedule of debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online
at http://www.osronline.com/page.cfm?name=ListServer
I couldn’t understand what is the difference between StreamContext and StreamHandleContext.
Are StreamHandleContext specific per file open? (if file is oppened simultaneously by several processes)
Thanks,
Sagi
> Are StreamHandleContext specific per file open? (if file is oppened simultaneously by several
StreamHandleContext is 1 for FILE_OBJECT, while StreamContext is 1 for the FCB, i.e. shared across all FILE_OBJECTs referencing the same FCB.
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
> the alternate data streams are not of much use anyway (used by Services
for Macintosh and malware only).
IE and explorer are also heavy users of ADS, I know that they are bad, but
not that bad 
> IE and explorer are also heavy users of ADS
Explorer? since what Windows version?
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
The ‘unblock’ feature uses it at least on Vista, but I think on XP as well. I don’t really know
what the constraints are (iexplorer or other browsers, et. c.), and I haven’t any idea of what
happens if you save something from the internet to a FAT drive, but if you save it to a NTFS volume,
it will create a named stream that streams.exe will show, and if you ‘unblock’ it, it removes the
stream:
Setup.exe:
:Zone.Identifier:$DATA 26
mm
Maxim S. Shatskih wrote:
> IE and explorer are also heavy users of ADS
Explorer? since what Windows version?