using FltIsDirectory -> shutdown hang

I have suceeded in getting my driver to unload properly with “sc stop” and
to shutdown properly, but only by disabling a call to FltIsDirectory. When
I make a call to FltIsDirectory in a pre-write, I get a good status return,
the infomation returned is correct, and unload works fine. However, doing a
call to FltIsDirectory makes the shutdown of the OS hang. It does not even
get to the point of sending my driver the IRP_MJ_SHUTDOWN.

Is anyone else using FltIsDirectory?

Yep, I use it – no problems. In what context are you using it?

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mark Hahn
Sent: Monday, March 28, 2005 5:35 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] using FltIsDirectory -> shutdown hang

I have suceeded in getting my driver to unload properly with “sc stop” and
to shutdown properly, but only by disabling a call to FltIsDirectory. When
I make a call to FltIsDirectory in a pre-write, I get a good status return,
the infomation returned is correct, and unload works fine. However, doing a

call to FltIsDirectory makes the shutdown of the OS hang. It does not even
get to the point of sending my driver the IRP_MJ_SHUTDOWN.

Is anyone else using FltIsDirectory?


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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

I call it in pre-write because I don’t want to record writes to directories.
It works great except for the shutdown problem. I can enable and disable
the call and see shutdown work and not work.

“Ken Cross” wrote in message news:xxxxx@ntfsd…
> Yep, I use it – no problems. In what context are you using it?
>
> Ken
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Mark Hahn
> Sent: Monday, March 28, 2005 5:35 PM
> To: Windows File Systems Devs Interest List
> Subject: [ntfsd] using FltIsDirectory -> shutdown hang
>
> I have suceeded in getting my driver to unload properly with “sc stop” and
> to shutdown properly, but only by disabling a call to FltIsDirectory.
> When
> I make a call to FltIsDirectory in a pre-write, I get a good status
> return,
> the infomation returned is correct, and unload works fine. However, doing
> a
>
> call to FltIsDirectory makes the shutdown of the OS hang. It does not
> even
> get to the point of sending my driver the IRP_MJ_SHUTDOWN.
>
> Is anyone else using FltIsDirectory?
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@comcast.net
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>

Hmm … Do you distinguish between IRP writes and fast I/O writes? (Not
sure if there’d be a difference, but…)

Are you retrieving your context? Would that be a better place to put the
“IsDirectory” flag than calling FltIsDirectory? (I’m not sure how much
overhead is involved in FltIsDirectory – probably very little.)

So your call is something like this, right?

status = FltIsDirectory( FltObjects->FileObject, FltObjects->Instance,
&bIsDirectory );

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mark Hahn
Sent: Monday, March 28, 2005 5:44 PM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] using FltIsDirectory -> shutdown hang

I call it in pre-write because I don’t want to record writes to directories.

It works great except for the shutdown problem. I can enable and disable
the call and see shutdown work and not work.

“Ken Cross” wrote in message news:xxxxx@ntfsd…
> Yep, I use it – no problems. In what context are you using it?
>
> Ken
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Mark Hahn
> Sent: Monday, March 28, 2005 5:35 PM
> To: Windows File Systems Devs Interest List
> Subject: [ntfsd] using FltIsDirectory -> shutdown hang
>
> I have suceeded in getting my driver to unload properly with “sc stop” and
> to shutdown properly, but only by disabling a call to FltIsDirectory.
> When
> I make a call to FltIsDirectory in a pre-write, I get a good status
> return,
> the infomation returned is correct, and unload works fine. However, doing

> a
>
> call to FltIsDirectory makes the shutdown of the OS hang. It does not
> even
> get to the point of sending my driver the IRP_MJ_SHUTDOWN.
>
> Is anyone else using FltIsDirectory?
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@comcast.net
> 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@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

Sounds like there may be a bug here, but you probably
should change the way you are doing this. Check to
see if it is a dir when the create happens and store
it in your context. You don’t want to make that call
on every write.

— Mark Hahn wrote:
> I have suceeded in getting my driver to unload
> properly with “sc stop” and
> to shutdown properly, but only by disabling a call
> to FltIsDirectory. When
> I make a call to FltIsDirectory in a pre-write, I
> get a good status return,
> the infomation returned is correct, and unload works
> fine. However, doing a
> call to FltIsDirectory makes the shutdown of the OS
> hang. It does not even
> get to the point of sending my driver the
> IRP_MJ_SHUTDOWN.
>
> Is anyone else using FltIsDirectory?
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>

“Ken Cross” wrote in message news:xxxxx@ntfsd…
> Hmm … Do you distinguish between IRP writes and fast I/O writes? (Not
> sure if there’d be a difference, but…)

I have the filter manager only giving me IRPs. I don’t see fast I/O at all.

> Are you retrieving your context? Would that be a better place to put the
> “IsDirectory” flag than calling FltIsDirectory? (I’m not sure how much
> overhead is involved in FltIsDirectory – probably very little.)

I will try moving it to create.

> So your call is something like this, right?
>
> status = FltIsDirectory( FltObjects->FileObject, FltObjects->Instance,
> &bIsDirectory );

Exactly.

I’ll try it in create.

“Randy Cook” wrote in message news:xxxxx@ntfsd…
> Sounds like there may be a bug here, but you probably
> should change the way you are doing this. Check to
> see if it is a dir when the create happens and store
> it in your context. You don’t want to make that call
> on every write.
>
> — Mark Hahn wrote:
>> I have suceeded in getting my driver to unload
>> properly with “sc stop” and
>> to shutdown properly, but only by disabling a call
>> to FltIsDirectory. When
>> I make a call to FltIsDirectory in a pre-write, I
>> get a good status return,
>> the infomation returned is correct, and unload works
>> fine. However, doing a
>> call to FltIsDirectory makes the shutdown of the OS
>> hang. It does not even
>> get to the point of sending my driver the
>> IRP_MJ_SHUTDOWN.
>>
>> Is anyone else using FltIsDirectory?
>>
>>
>>
>> —
>> Questions? First check the IFS FAQ at
>> https://www.osronline.com/article.cfm?id=17
>>
>> You are currently subscribed to ntfsd as:
>> xxxxx@yahoo.com
>> To unsubscribe send a blank email to
>> xxxxx@lists.osr.com
>>
>

Moving the call from PreWrite to PreCreate fixed it.

“Mark Hahn” wrote in message news:xxxxx@ntfsd…
>I have suceeded in getting my driver to unload properly with “sc stop” and
>to shutdown properly, but only by disabling a call to FltIsDirectory. When
>I make a call to FltIsDirectory in a pre-write, I get a good status return,
>the infomation returned is correct, and unload works fine. However, doing
>a call to FltIsDirectory makes the shutdown of the OS hang. It does not
>even get to the point of sending my driver the IRP_MJ_SHUTDOWN.
>
> Is anyone else using FltIsDirectory?
>
>
>

The overhead of calling FltIsDirectory on every write is no different
then calling FltGetStreamContext. Internally this is information that
is cached with your context, we just provided a way for you to get at
it.

If you need to get your context anyway then you should cache this
information in your context. Getting your context and calling
FltIsDirectory would have the same overhead as getting your context
twice.

It makes no sense that unload would hang by calling this routine. And it
makes even less sense that calling this only in create would solve this.
I rechecked the code and we are not leaking a reference when this is
called. I wrote a test filter that makes this call on every write and
had no issue unloading. There must be something else going on.

Neal Christiansen
Microsoft File System Filter Group Lead
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 Mark Hahn
Sent: Tuesday, March 29, 2005 4:29 PM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] using FltIsDirectory -> shutdown hang

Moving the call from PreWrite to PreCreate fixed it.

“Mark Hahn” wrote in message news:xxxxx@ntfsd…
>I have suceeded in getting my driver to unload properly with “sc stop”
and
>to shutdown properly, but only by disabling a call to FltIsDirectory.
When
>I make a call to FltIsDirectory in a pre-write, I get a good status
return,
>the infomation returned is correct, and unload works fine. However,
doing
>a call to FltIsDirectory makes the shutdown of the OS hang. It does
not
>even get to the point of sending my driver the IRP_MJ_SHUTDOWN.
>
> Is anyone else using FltIsDirectory?
>
>
>


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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