Paul said:
CreateFile returns an open handle. The text here suggests "CloseHandle"
when done with it. This is no different than doing something like fopen().
http://msdn.microsoft.com/en-us/library/aa914735.aspx
A handle is a persistent object, and we'd be concerned about
things like that which can have a half-written file in progress.
Waiting for a handle to close, means the application has either
abandoned a file it was writing, or it has committed it.
Any operation which is transient, or is handled entirely by the
file system (say, writing to the MFT), isn't of as much concern,
as when a process or application has a half-written file sitting there.
Serialization can be applied to stuff the file system controls.
(Which means, it doesn't dismount the file system, until it's stopped
modifying the MFT.)
So Handle or Process Explorer (with Handle program functions built-in)
is the tool to use.
So we're in agreement regarding created/open file handles. Okay, so
what happens to a dismount when there still exists file system activity
OTHER than file handles that were created before and are lingering
around but are NOT part of the current file system activity, like when
"file system activity" consistutes just queries and deletes? That's the
reason why some folks mentioned looking at file indexing (which only
looks at files and not their contents) which could keep a volume from
getting dismounted.
I was wondering if a volume with current activity (and no open file
handles) could block an eject. You'd *think* the mount manager would go
ahead and dismount the volume (again, with one having no currently open
file handles) with the result any processes that were attempting
[non-write] file system activity would get errors (volume not
accessible) but maybe not hence my question "If the *file system* isn't
quiescent, can you eject the drive?"