Doh! That was it, of course. That particular path didn’t check status
before processing, which was bad (albeit odd: STATUS_PRIVILEGE_NOT_HELD), so
FsContext didn’t get set.
It’s obvious now that you point it out. Thanks!
Ken
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Molly Brown
Sent: Monday, November 22, 2004 12:26 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] STATUS_NOT_SUPPORTED in FltSetStreamHandleContext?
Back to Ken’s original problem - the next step is to figure out why the
FileObject->FsContext is NULL. Did the CREATE actually succeed with
STATUS_SUCCESS? (Beware of those “success” code which don’t indicate a
truly successful open of the file, like STATUS_REPARSE.) You should
never have a successfully opened file will a NULL FsContext.
The desired access has no effect on the filter manager’s context
support. The filter manager’s stream and streamhandle context support
is built on top of the PerStreamContext support added for legacy filters
in Windows XP and later. This functionality requires that the file
system has initialized the FSRTL_ADVANCED_FCB_HEADER (the header for the
FileObject->FsContext structure) before contexts can be set and
retrieved, therefore until this work is done, no context can be
supported.
Regards,
Molly Brown
Microsoft Corporation
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 Tony Mason
Sent: Sunday, November 21, 2004 4:35 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] STATUS_NOT_SUPPORTED in FltSetStreamHandleContext?
Ah. Now I understand - this is not a discussion of stream contexts, but
of the mini-filter model itself. My apologies!
Regards,
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Cross
Sent: Sunday, November 21, 2004 7:15 PM
To: ntfsd redirect
Subject: RE: [ntfsd] STATUS_NOT_SUPPORTED in FltSetStreamHandleContext?
Sorry, Tony, but I’m not sure what you’re saying. It seems like you’re
saying the same thing as Petr. (Keep in mind we’re working through the
Filter Manager here.)
Per the documentation, the “Post-create callback routines are guaranteed
to be called at IRQL PASSIVE_LEVEL, in the context of the thread that
originated the IRP_MJ_CREATE operation”.
If that’s not the case (synchronous or asynchronous), that’s a Big Deal
and should be made obvious.
Thanks,
Ken
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Sunday, November 21, 2004 5:52 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] STATUS_NOT_SUPPORTED in FltSetStreamHandleContext?
The I/O model allows asynchronous completion of IRP_MJ_CREATE and at
IRQL DISPATCH_LEVEL. If you write your code to assume that is not the
case it is possible it will not work under all circumstances.
Keep in mind: the rules of the model may not match the observed
behavior; relying upon behavior rather than an understanding of the
rules can lead to fundamental mistakes that cause problems in the
future.
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 Petr Kurtin
Sent: Sunday, November 21, 2004 5:13 AM
To: ntfsd redirect
Subject: Re:[ntfsd] STATUS_NOT_SUPPORTED in FltSetStreamHandleContext?
PostCreate callback is always called in the requestor’s thread at <=
APC_LEVEL, so you may not create a WorkItem to get at <= APC_LEVEL.
I allocate and set FltSetStreamHandleContext in PostCreate (even for
DELETE flag set in DesiredAccess) and I didnt have problem with that (it
doesnt matter where I use FltAllocateContext, right?)
Petr Kurtin
“Ken Cross” > wrote in
message news:xxxxx@ntfsd news:xxxxx …
> Molly:
>
> Good call – you nailed it. The FsContext is zero when I get
> STATUS_NOT_SUPPORTED (although that seems a strange return status).
It
> seems to only happen when the file is being opened for delete (DELETE
is
set
> in Data->Iopb->Parameters.Create.SecurityContext->DesiredAccess).
>
> Does that inhibit setting FsContext somehow?
>
> It is always called in the CREATE post-processing. The sequence is:
>
> 1. In CREATE pre-processing - build the context
>
> 2. In CREATE post-processing - call FltQueueDeferredIoWorkItem to get
to
> PASSIVE_LEVEL (callers of FltSetStreamHandleContext must be running at
IRQL
> <= APC_LEVEL). The FileObject is saved in the context since the work
item
> is called in SYSTEM context.
>
> 3. In the work item, call FltSetStreamHandleContext. This is where
the
> STATUS_NOT_SUPPORTED was being reported sometimes.
>
>
> So, I guess if FsContext == 0, I can forget it.
>
> Thanks,
> Ken
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
mailto:xxxxx
> [mailto:xxxxx@lists.osr.com] On Behalf Of Molly Brown
> Sent: Saturday, November 20, 2004 6:53 PM
> To: Windows File Systems Devs Interest List
> Subject: RE: [ntfsd] STATUS_NOT_SUPPORTED in
FltSetStreamHandleContext?
>
> Are you sure that the file object is always initialized when you call
> FltSetStreamHandleContext? The FileObject->FsContext must be
> initialized in order for stream or stream contexts to be supported, so
> you cannot set a context until the file system has processed the
CREATE
> operation on the file object.
>
> Regards,
> Molly Brown
> Microsoft Corporation
>
> This posting is provided “AS IS” with no warranties and confers no
> rights.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
mailto:xxxxx
> [mailto:xxxxx@lists.osr.com] On Behalf Of Ken Cross
> Sent: Saturday, November 20, 2004 1:29 PM
> To: Windows File Systems Devs Interest List
> Subject: [ntfsd] STATUS_NOT_SUPPORTED in FltSetStreamHandleContext?
>
> NTFSD Folk:
>
> I am occasionally getting STATUS_NOT_SUPPORTED when calling
> FltSetStreamHandleContext. Two operations on the same file returns
> STATUS_SUCCESS one time and STATUS_NOT_SUPPORTED another.
>
> The documentation says it means that “The file system does not support
> per-stream contexts for this file stream”, but that doesn’t appear to
be
> true (it is always the same file and the default file stream,
according
> to
> FltGetFileNameInformation). It’s frustrating because it works most
of
> the
> time. FWIW, it’s a MS Word file.
>
> I suspect that STATUS_NOT_SUPPORTED in FltSetStreamHandleContext means
> something different in certain circumstances.
>
> Any ideas?
>
> Thanks,
> Ken
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
https:
>
> You are currently subscribed to ntfsd as:
xxxxx@windows.microsoft.com
mailto:xxxxx
> To unsubscribe send a blank email to xxxxx@lists.osr.com
mailto:xxxxx
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
https:
>
> You are currently subscribed to ntfsd as: unknown lmsubst tag
argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
mailto:xxxxx
>
> —
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
—
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
—
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
—
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</mailto:xxxxx></https:></mailto:xxxxx></mailto:xxxxx></https:></mailto:xxxxx></mailto:xxxxx></news:xxxxx>