Find the open instance for any files.

In the filter driver, is there fast way to find out whether some file has
been opened at that moment? I do not want keep my own reference in
IRP_MJ_CREATE or try to open that file exclusively and check the return
code.

Thanks.


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Maintain a list of open file objects or FsContext2 structures.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@math.uic.edu
Sent: Monday, November 19, 2001 12:33 PM
To: File Systems Developers
Subject: [ntfsd] Find the open instance for any files.

In the filter driver, is there fast way to find out whether some file
has
been opened at that moment? I do not want keep my own reference in
IRP_MJ_CREATE or try to open that file exclusively and check the return
code.

Thanks.


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I’m not sure if this is going to work for you but you may try to open file
in question (via ZwCreateFile)
with FILE_NO_INTERMEDIATE_BUFFERING flag set in CreateOptions parameter. To
prevent possible collisions with
mode/share access of previously opened instances of this file set
DesiredAccess to SYNCHRONIZE and ShareAccess to
FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE.
After file has been opened close it immediately and watch for IRP_MJ_CLOSE
sent for its FileObject.
If close request has been detected then this file had no opened instances
(except yours) at the moment when ZwClose
passed through.

Regards,

Vladimir

-----Original Message-----
From: xxxxx@math.uic.edu [mailto:xxxxx@math.uic.edu]
Sent: Monday, November 19, 2001 4:33 AM
To: File Systems Developers
Subject: [ntfsd] Find the open instance for any files.

In the filter driver, is there fast way to find out whether some file has
been opened at that moment? I do not want keep my own reference in
IRP_MJ_CREATE or try to open that file exclusively and check the return
code.

Thanks.


You are currently subscribed to ntfsd as: xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com