EldoS | Feel safer!

Software components for data protection, secure storage and transfer

OnOpenFile and OnReadFile are called unnecessarily

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
Posted: 07/08/2013 15:39:59
by Aviv Scharf (Standard support level)
Joined: 07/03/2013
Posts: 11


I've implemented part of the proof of concept for a virtual file system where my data sits in a remote location and I access it through http download and upload.
I notice then when I traverse into a level that has files in it, I get call backs for OnOpenFile and OnReadFile and even OnCloseFile even before I click on any of the files in that level.
This is a problem since most of the user work will be browsing around the tree and I can't afford to download all the files at a certain hierarchy before they are opened by the user.
How can this be fixed?

Posted: 07/08/2013 15:59:32
by Eugene Mayevski (EldoS Corp.)

This is Explorer reading metadata from files. There's no remedy for Explorer so far. The only workaround, if you have a slow data source, is to use Network type of the disk, in which case Explorer slightly reduces its activities.

Sincerely yours
Eugene Mayevski
Posted: 07/09/2013 08:24:54
by Aviv Scharf (Standard support level)
Joined: 07/03/2013
Posts: 11

Thanks Eugene,

I changed to network type (that was my previous question on the forum) but the calls are still happening. Is there a way to differentiate between calls to open and read when a user requests a file and when explorer reads metadata? If I can do that, I can ignore those other calls and return empty buffer.
This is a pretty major limitation for us, and I don't think we'll be able to use Callback FS if we cant download files only on demand.

Aviv Scharf
Posted: 07/09/2013 08:58:36
by Volodymyr Zinin (EldoS Corp.)

There is no way to differentiate such calls. Moreover the algorithm that Explorer uses to read metadata can theoretically be changed between different Windows versions. Although perhaps it is possible to implement some heuristic algorithm for this...

Another way that can theoretically help is to implement shell extension DLL, which prevents reading of metadata. But I don't know whether it's possible at all.

Also maybe using a local cache for file metadata can help...
Or not to allow for Explorer to read files at all (although it will cause even impossible to perform copy of files).
Posted: 07/09/2013 09:03:35
by Volodymyr Zinin (EldoS Corp.)

BTW you can use Process Monitor from sysinternals.com to see what I/O requests Explorer (as well as other programs) are sent to file systems. Set there to filter only interesting for you requests (for example only those ones that Explorer sends). Perhaps it helps you to find out how to resolve the problem.
Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.



Topic viewed 1294 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!