EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Accessing virtual files fail (in samples)

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
Posted: 11/18/2011 07:40:18
by Christian Wimmer (Standard support level)
Joined: 11/18/2011
Posts: 16


I'm evaluating your CBFS and therefore I want to rename some file extensions so these files are shown differently. I'm using your example to do a quick test and react on OnEnumerateDirectory, OnFileOpen, OnGetOpenFile, OnGetNamedStream and OnGetFileSecurity.
OnCreateFile is never called in my situation.

A mapped folder has a file called "xyz.txt.yyy". In the virtual drive I remove the ".yyy" extension to show only "xyz.txt". The explorer shows me this file correctly. However, if I want to access it this fails. I can do a quick "copy K:\xyz.txt d:\test" and the file cannot be found.

I adapted your Mapper sample to check on Open and GetFileInfo whether this file ("xyz.txt") exists in the mapped folder. If it doesn't I add the extension ".yyy" and check again. In my situation this file exists and CreateFile works (valid handle). However, the explorer file property dialog or just "copy" immediately calls close and returns with error "File not found". On any other 1:1 mapped file (with no changes) it works flawlessly. The property dialog shows only empty edit field on the first page but all file attributes on the details pane.

I'm sure that I did all filename mapping correctly, but maybe I miss another event to implement? In addition the mapping in GetfileSecurity works because the security list is shown correctly (I adapted the DACL)

What may be the problem here?

Posted: 11/18/2011 07:43:56
by Eugene Mayevski (EldoS Corp.)

Well, obviously, something is wrong with the code, but without seeing the code itself we can't tell for sure. I'll move your question to the helpdesk, please post your code to the ticket that will be created in ZIP archive.

Sincerely yours
Eugene Mayevski
Posted: 11/18/2011 08:21:17
by Christian Wimmer (Standard support level)
Joined: 11/18/2011
Posts: 16

Well, nothing was wrong but something was missing.

I found out that on opening files a CbFsEnumerateDirectory event is generated beforehand with that specific file to open. Looks like a call to FindFirst of the explorer or copy command. So the mask contains the filename to be opened. In this case it must be mapped first and then searched for with FindFirstFile.

Well, the doc tells the same story. Sry, I didn't see the connection of enumdir to the problem.
Posted: 11/18/2011 08:38:09
by Eugene Mayevski (EldoS Corp.)

Great that you pointed at the solution. We will update documentation to make it more clear, how OnEnumerateDirectory should be handled.

Sincerely yours
Eugene Mayevski



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