EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Cannot open file in DOS after change in OnEnumerateDirectory

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#32503
Posted: 03/04/2015 17:54:04
by Henri Hein (Standard support level)
Joined: 02/13/2015
Posts: 14

I have had an OnEnumerateDirectory event in our product for several months, and it has been working fine. I just added support for wildcards, and then I started seeing some strange behavior. Everything works fine from Explorer, and I can list directory contents from DOS, but I cannot type the contents of a file from DOS. I can open the file from Explorer or Notepad, even if I start Notepad from DOS, but if I try to view the file contents from within DOS with the 'type' command, I consistently get "The system cannot find the file specified."

I have verified we do not return this error in any of our callbacks when the problem happens. I did notice that OnEnumerateDirectory is called twice (actually twice twice, for a total of 4 times), with the filename, and of course the second time the code sets FileFound to FALSE. I verified that VDisk operates the same way.

Here is the strange thing. I ran the VDisk sample, and if I mount a new volume with VDisk, go to that drive in DOS and type any file, including the built-in sample file, then everything starts working even on the drive our product mounted. This is true after I unmount the VDisk volume and exit VDisk -- once it starts working, it continues to work.

The volume I mount is of type stVirtualDisk, though I tried stDisk and got the same result.


Henri Hein
Thin Air Labs, Inc
#32504
Posted: 03/04/2015 17:56:58
by Henri Hein (Standard support level)
Joined: 02/13/2015
Posts: 14

cbfs5.sys version: 5.1.156.63


Henri Hein
Thin Air Labs, Inc
#32508
Posted: 03/05/2015 00:27:17
by Eugene Mayevski (EldoS Corp.)

If you have a license, please link the license ticket to your user account before we continue. The ticket itself and the procedure of its use are specified in the registration e-mail that was sent to you upon license purchase. If you don't have the license ticket, please contact the person from which you have obtained the license key (the one in your source code) for a license ticket.

NOTE: please don't post license keys and license tickets to the forum. If you need to clarify something about your license, please use HelpDesk ( http://www.eldos.com/helpdesk/ ).


Sincerely yours
Eugene Mayevski
#32521
Posted: 03/05/2015 13:19:43
by Henri Hein (Standard support level)
Joined: 02/13/2015
Posts: 14

Apologies, Eugene, I thought I had already done that. I just linked my ticket.


Henri Hein
Thin Air Labs, Inc
#32522
Posted: 03/05/2015 13:27:30
by Eugene Mayevski (EldoS Corp.)

Please check that both OnGetFileInfo and OnEnumerateDirectory produce coherent results - OnGetFileInfo is called before the file is opened. Most likely there's some inconsistency between the two event handlers and this causes the trouble.

The other possible reason is a Metadata cache. It can be disabled via the corresponding method. If the first check gives nothing, please turn off this cache and try again.


Sincerely yours
Eugene Mayevski
#32531
Posted: 03/06/2015 14:49:26
by Henri Hein (Standard support level)
Joined: 02/13/2015
Posts: 14

I cannot reproduce it right now, but when I do, I will try the metadatacache. Now I wonder if it was a one-time horking of the metadatacache.

I am pretty confident in OnGetFileInfo: it's pretty simple, I did not change it recently, and the times I stepped through it in the debugger, it did the right thing.

OnEnumerateDirectory is easier to suspect, as I find there are some subtleties to it. However, again when I step through it in the debugger, it does what I expect it to do, and it mirrors what VDisk does. (I use VDisk rather than Mapper, because it's closer to what we do in our app). Is there anything in particular I should look out for? I tried experimenting with the logic, and I get some interesting results, but not the correct one. For instance, with the situation I ran into, if I always set *FileFound to TRUE when there was no wildcard in mask, I got an infinite loop -- it would not stop calling OnEnumerateDirectory.


Henri Hein
Thin Air Labs, Inc
#32539
Posted: 03/09/2015 02:44:13
by Volodymyr Zinin (EldoS Corp.)

Try to use Process Monitor from sysinternals.com. Set there to show only operations for your virtual disk (by adding the filter rule "Path"->"begins with"->"X:", where "X:" is drive letter for your disk). Then reproduce the problem and look at the log to find where the problem is. Additionally you can write the log for the same case with the VDisk sample and then compare both logs and try to find differences.
Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.

Reply

Statistics

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