EldoS | Feel safer!

Software components for data protection, secure storage and transfer

EnumerateDirectory doesn't occur after NotifyDirectryChange was called

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
Posted: 04/24/2013 05:32:33
by Alexey Korotkov (Standard support level)
Joined: 02/14/2013
Posts: 7

OnEnumerateDirectory callback doesn't occur after NotifyDirectoryChange was called when CBFS_SYMLINK_NETWORK mounting point flag was used.
NotifyDirectoryChange is called with correct path "\folder1\folder2" and action CbFsNotifyFileAction.fanModified parameters.

Is it correct behaviour for network mounting point?
How we could notify file system about changes in the mounted drive file system in that case?
Posted: 04/24/2013 08:39:38
by Volodymyr Zinin (EldoS Corp.)

By specifying path "\folder1\folder2" in the NotifyDirectoryChange call you say that the "folder2" folder itself has been modified (not files inside it).
The system enumerates a directory in the following way - opens the directory (gets a handle to it), calls an "enumerate directory" API, close the handle. But the NotifyDirectoryChange call makes all the currently existing handles to the directory as "invalid" (and all API calls except CloseHandle finish with error).

In the case a file has been changed specify directly this file in the path, but not its parent directory. And if only file attributes have been changed (not file data) then use the fanMetaDataModified flag instead of fanModified. This prevents handle invalidation.
Posted: 04/24/2013 10:08:53
by Alexey Korotkov (Standard support level)
Joined: 02/14/2013
Posts: 7

Thank you for useful answer. It helped us to understand NotifyDirectoryChange event behaviour.



Topic viewed 968 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!