I want to know how many reference count (handler) to the FileObject in IRP_MJ_CLEANUP

Hi,

I use notepad to open the file through my network redirector driver, after IRP_MJ_CLEANUP, I get one IRP_MJ_READ before I get IRP_MJ_CLOSE, I think notepad is Momery Mapping Application, so it still has another handler reference to this FileObject when in IRP_MJ_CLEANUP, we usually send CloseFile to remote server in IRP_MJ_CLEANUP if check there is no other OPEN in FCB (Fcb->UncleanCount is down to 0), but in this case that doesn’t work, so I want to know how many reference count (handler) to the FileObject in IRP_MJ_CLEANUP, but I don’t know how to figure out it? if I know there is still another handler to this FileObject, I will not to send CloseFile and keep file OPEN for the following IRP_MJ_READ until get IRP_MJ_CLOSE.

Any suggestion are appreciate.
Thanks,

Tao


Every kernel object (so also FILE_OBJECT) has OBJECT_HEADER structure

preceding the actual object pointer. The structure has both handle

count and pointer count.

L.

The solution is send remote close from IRP_MJ_CLOSE path. You can get both, paging read and write after IRP_MJ_CLEANUP and it is not so rare. What you can do is in IRP_MJ_CLEANUP purge (or plan puring of) cache. Is your redirector a mini-redirector?

-bg

OBJECT_HEADER is undocument structure, I avoid to use it if possible, can I know if it is memory mapping file in IRP_MJ_CREATE, or IRP_MJ_CLEANUP.

Thanks,

Tao

Date: Mon, 18 Aug 2008 08:13:37 +0200From: xxxxx@volny.czTo: xxxxx@lists.osr.comSubject: Re: [ntfsd] I want to know how many reference count (handler) to the FileObject in IRP_MJ_CLEANUP

Every kernel object (so also FILE_OBJECT) has OBJECT_HEADER structure
preceding the actual object pointer. The structure has both handle
count and pointer count.

L.
— NTFSD is sponsored by OSR For our schedule debugging and file system seminars (including our new fs mini-filter seminar) visit: http://www.osr.com/seminars You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’ To unsubscribe send a blank email to xxxxx@lists.osr.com