file object

Hi!

When I bump the reference count of a filtered FileObject in my driver via
ObReferenceObject: will this FileObject stay alive after IRP_MJ_CLEANUP?

Thanks
Frank

> When I bump the reference count of a filtered FileObject in my driver via

ObReferenceObject: will this FileObject stay alive after IRP_MJ_CLEANUP?

Yes, but there are two cases in which you must not reference the file
object

  1. Sometimes the system allocates the file object on the stack and this file
    object doesn’t have the OBJECT_HEADER. System allocates such file objects to
    query file’s information.
  2. You can’t reference the file object while processing IRP_MJ_CLEANUP if
    handle has not been created for this file object, because the system sends
    IRP_MJ_CLEANUP just before sending IRP_MJ_CLOSE.


Slava Imameyev, xxxxx@hotmail.com

“frank” wrote in message news:xxxxx@ntfsd…
> Hi!
>
> When I bump the reference count of a filtered FileObject in my driver via
> ObReferenceObject: will this FileObject stay alive after IRP_MJ_CLEANUP?
>
> Thanks
> Frank
>
>

Thanks for the response.

Actually I am asking this, because of Vista’s new “no hang”-feature. I’ve
watched pended synchronous I/O (pended by my filter) go away, which never
happend on XP or 2K. And I would like to know if it would be a good idea to
bump every FileObject before queuing it off to a worker thread, so that I
can be sure although the I/O initiating thread terminates the FileObject
won’t go away.

I tried to find some information about this new feature (e.g. watched
Narayanan Ganapathy giving a lecture), but I am a bit unsure how this
affects my filtered objects.

Frank

“Slava Imameyev” schrieb im Newsbeitrag
news:xxxxx@ntfsd…
>> When I bump the reference count of a filtered FileObject in my driver via
>> ObReferenceObject: will this FileObject stay alive after IRP_MJ_CLEANUP?
>
> Yes, but there are two cases in which you must not reference the file
> object
> 1) Sometimes the system allocates the file object on the stack and this
> file object doesn’t have the OBJECT_HEADER. System allocates such file
> objects to query file’s information.
> 2) You can’t reference the file object while processing IRP_MJ_CLEANUP if
> handle has not been created for this file object, because the system sends
> IRP_MJ_CLEANUP just before sending IRP_MJ_CLOSE.
>
> –
> Slava Imameyev, xxxxx@hotmail.com
>
>
> “frank” wrote in message news:xxxxx@ntfsd…
>> Hi!
>>
>> When I bump the reference count of a filtered FileObject in my driver via
>> ObReferenceObject: will this FileObject stay alive after IRP_MJ_CLEANUP?
>>
>> Thanks
>> Frank
>>
>>
>
>
>

Yes

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “frank”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Wednesday, November 29, 2006 12:00 PM
Subject: [ntfsd] file object

> Hi!
>
> When I bump the reference count of a filtered FileObject in my driver via
> ObReferenceObject: will this FileObject stay alive after IRP_MJ_CLEANUP?
>
> Thanks
> Frank
>
>
>
> —
> 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