EldoS | Feel safer!

Software components for data protection, secure storage and transfer

CBFS long file access time

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#5911
Posted: 04/17/2008 04:40:19
by Volodymyr Zinin (EldoS Corp.)

Hello,

The time limit exists. You can specify it when the method CallbackFileSystem.MountMedia is called. Also in any callback you can call CallbackFileSystem.ResetTimeout to change the timeout value for this callback. After the timeout occurs CallbackFS will terminate the originator request with ERROR_TIMEOUT error. For example if someone called WriteFile and the following OnWrite callback didn't finish until timeout occurs, then the WriteFile will be completed with ERROR_TIMEOUT. And after the callback finishes its result will be ignored.

BTW: The number of threads that call the callbacks is set by means of the property CallbackFileSystem.ThreadPoolSize. So if all of them are blocked in the callbacks for a long time then subsequent requests won't be processed and will be terminated when timeout occurs.
#5967
Posted: 04/22/2008 07:22:33
by adam  (Basic support level)
Joined: 03/13/2008
Posts: 18

Quote

No. Either synchronously read the destination file in the context of the thread that calls onReadFile or block it (for example by means of WaitForSingleObject(SomeEĀ­vent)) until another thread completes reading the destination file.
But you can also return an error code from onReadFile. In this case the same error will be returned to the originator of the request.


Could you please provide a small code sample of using WaitForSingleObject(SomeEĀ­vent)) to pause onReadFile while another thread downloads the file. My issue is that i dont know how to use the function if CBFS will timeout.

#5968
Posted: 04/22/2008 08:03:55
by Volodymyr Zinin (EldoS Corp.)

Code
OnReadCallback(...)
{
  if (ExpectLongProcessing) {
  
    DWORD ThisProcessingTimeout = ...; // can be 0, i.e. infinite
    
    //
    // Reset the timeout for this callback
    //
    CallbackFileSystem.ResetTimeout(ThisProcessingTimeout);

    //
    // Either perform the necessary work here or send request to another
    // thread and fall asleep
    //
    if (NeedSendRequestToAnotheThread) {

       HANDLE WakeUpEvent;

       WakeUpEvent = CreateEvent(...);
      
       //
       // After a necessary work is finished, a thread that
       // performs the work must set WakeUpEvent to signalled state.
       //
       DelegateWorkToAnotherThread(WakeUpEvent);

       //
       // Now fall asleep
       //
       WaitForSingleObject(WakeUpEvent, ...);

       //
       // We were woken up. The work was finished.
       // Obtain somehow the result and return from
       // this callback
       //
       ...
    }
  }

  return ...;
}
#5985
Posted: 04/23/2008 06:30:50
by adam  (Basic support level)
Joined: 03/13/2008
Posts: 18

Is it possible with CBFS to filter out explorer read requests to determine file size , thumbnail calculations etc ?

for example

In the FileMapper example if i hover the mouse over the icon for a file on a CBFS virtual drive onReadFile() is called, i wish to filter these style of requests out.
#5986
Posted: 04/23/2008 07:03:38
by Eugene Mayevski (EldoS Corp.)

It's a good idea to not put all eggs into a single basket and all questions to a single forum topic.


Sincerely yours
Eugene Mayevski
#5987
Posted: 04/23/2008 07:43:22
by Volodymyr Zinin (EldoS Corp.)

Quote
adam wrote:
Is it possible with CBFS to filter out explorer read requests to determine file size , thumbnail calculations etc ?

Unfortunately it isn't. I have checked it and if Explorer can't read files (in the read callback I called GetOriginatorProcess name and if the name was "explorer.exe" then the read callback returned ERROR_ACCESS_DENIED) then the files can't be executed (if they are executable files) and copied by Explorer.
You can try to start caching a remote file at the time when explorer tries to open it (the OnOpen callback is called). Also if a remote file reading time is very long then it is possible to return error. Sure in this case if someone wants to copy or execute the file then the error will be shown to him.

Quote
adam wrote:
Vladimir, has there been any progress on the new feature implementation? Or any update?

We're going to release a new build in a week or two where it will be possible to create "network" type of storages.
#6231
Posted: 05/13/2008 13:19:57
by Volodymyr Zinin (EldoS Corp.)

Quote
Vladimir Zinin wrote:
But you can wait some days and don't implement this feature. Because at present time we are trying to implement another workaround that will help to do the described above simpler. We will notify you about the result.

Hello,

We have released the v2.0. You can try it. Use the new method AddNetworkMountingPoint for creating mount points instead of the "standard" ones. Using such types of mount points should reduce the amount of the requests that Explorer performs.
Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.

Reply

Statistics

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