> Hi all
Is there ant NT/Kernel mode routine to find whether a specified file is being used by any application ?
Regards
K.Raju
> Hi all
Is there ant NT/Kernel mode routine to find whether a specified file is being used by any application ?
Regards
K.Raju
Hi K. Raju,
Try to open the file for exclusive-sharing access.
If a sharing violation occurs during the attempt, the file
is already open.
Regards,
-Rajesh
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Krishnama Raju
Sent: Friday, June 11, 2004 12:10 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to find a file is being used or not?
Hi all
Is there ant NT/Kernel mode routine to find whether a specified file is
being used by any application ?Regards
K.Raju
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@patni.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Rajesh C: Say some application has file open just for SYNCHRONIZE access?
Krishnama Raju: You cross-posted to ntfsd!
Cheers
Lyndon
“Rajesh C” wrote in message news:xxxxx@ntdev…
> Hi K. Raju,
>
> Try to open the file for exclusive-sharing access.
> If a sharing violation occurs during the attempt, the file
> is already open.
>
>
> Regards,
> -Rajesh
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Krishnama Raju
> Sent: Friday, June 11, 2004 12:10 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] How to find a file is being used or not?
>
>
>
> > Hi all
> > Is there ant NT/Kernel mode routine to find whether a specified file is
> being used by any application ?
> >
> > Regards
> > K.Raju
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@patni.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
You realize any information like this will be transient - just because
no one is using it when you call it, that doesn’t mean that no one is
using it when you do something with it. The only way to ensure it’s
idle is to open it without sharing, which will ensure that no one is
using and that no one can start to use it before you do your thing.
-p
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Krishnama Raju
Sent: Thursday, June 10, 2004 11:40 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to find a file is being used or not?
Hi all
Is there ant NT/Kernel mode routine to find whether a specified
file is being used by any application ?Regards
K.Raju
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Lyndon: Say some application has file open just for SYNCHRONIZE access?
I think using OpenFile with OF_SHARE_EXCLUSIVE should return
ERROR_SHARING_VIOLATION.
Regards,
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Lyndon J Clarke
Sent: Friday, June 11, 2004 7:14 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] How to find a file is being used or not?
Rajesh C: Say some application has file open just for SYNCHRONIZE access?
Krishnama Raju: You cross-posted to ntfsd!
Cheers
Lyndon
“Rajesh C” wrote in message news:xxxxx@ntdev…
> Hi K. Raju,
>
> Try to open the file for exclusive-sharing access.
> If a sharing violation occurs during the attempt, the file
> is already open.
>
>
> Regards,
> -Rajesh
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Krishnama Raju
> Sent: Friday, June 11, 2004 12:10 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] How to find a file is being used or not?
>
>
>
> > Hi all
> > Is there ant NT/Kernel mode routine to find whether a specified file is
> being used by any application ?
> >
> > Regards
> > K.Raju
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@patni.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@patni.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
“Opens the file with exclusive mode, denying both read and write access to
other processes. If the file has been opened in any other mode for read or
write access, even by the current process, the function fails.”
Maybe but … synchronize is neither read nor write?
“Rajesh C” wrote in message news:xxxxx@ntdev…
> Lyndon: Say some application has file open just for SYNCHRONIZE access?
>
> I think using OpenFile with OF_SHARE_EXCLUSIVE should return
> ERROR_SHARING_VIOLATION.
>
>
> Regards,
> - Rajesh
>
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Lyndon J Clarke
> Sent: Friday, June 11, 2004 7:14 PM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] How to find a file is being used or not?
>
>
> Rajesh C: Say some application has file open just for SYNCHRONIZE access?
> Krishnama Raju: You cross-posted to ntfsd!
>
> Cheers
> Lyndon
>
> “Rajesh C” wrote in message
news:xxxxx@ntdev…
> > Hi K. Raju,
> >
> > Try to open the file for exclusive-sharing access.
> > If a sharing violation occurs during the attempt, the file
> > is already open.
> >
> >
> > Regards,
> > -Rajesh
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of Krishnama Raju
> > Sent: Friday, June 11, 2004 12:10 PM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] How to find a file is being used or not?
> >
> >
> >
> > > Hi all
> > > Is there ant NT/Kernel mode routine to find whether a specified file
is
> > being used by any application ?
> > >
> > > Regards
> > > K.Raju
> > >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@patni.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@patni.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
You can try to write a filter driver. In your filter driver you will catch
all open/close operations. Also, if you do not want to interfere with other
applications which access the file you are processing, you are able to hold
any operations on file until you’re done.
–htfv
“Krishnama Raju” wrote in message
news:xxxxx@ntdev…
> Hi all
> Is there ant NT/Kernel mode routine to find whether a specified file is
being used by any application ?
>
> Regards
> K.Raju
>