EldoS | Feel safer!

Software components for data protection, secure storage and transfer

OnReparseFileName callback issue

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#27469
Posted: 11/28/2013 08:39:52
by Barak S (Standard support level)
Joined: 11/28/2013
Posts: 23

We're using CallbackFilter to add a reparse rule, and to get its OnReparseFileName callback as follows:
Code
_directoryToReparse = @"C:\Users\User\Dropbox\TmpFolder\";
_targetDirectory = @"C:\1\";
...
_filter.AddFilterCallbackRule(_directoryToReparse + "*.*", CbFltCallbackFlags.ReparseFileNameCallback);
_filter.AddReparseFileNameRule(_directoryToReparse + "*.*", _targetDirectory + "*.*", PRODUCT_NAME);


It works fine, but when Dropbox syncs a file from the web, we get the following callbacks (for "file.txt"):
Code
(1) OnReparseFileName: fileName = C:\Users\User\Dropbox\tmpFolder; reparsedFileName = C:\1
(2) OnReparseFileName: fileName = C:\Users\User\Dropbox\tmpFolder; reparsedFileName = C:\1
(3) OnReparseFileName: fileName = C:\Users\User\Dropbox\tmpFolder\file.txt; reparsedFileName = C:\1\file.txt
(4) OnReparseFileName: fileName = C:\Users\User\Dropbox\tmpFolder; reparsedFileName = C:\1
(5) OnReparseFileName: fileName = C:\Users\User\Dropbox\tmpFolder; reparsedFileName = C:\1\file.txt
(6) OnReparseFileName: fileName = C:\Users\User\Dropbox\tmpFolder\file.txt:com.dropbox.attributes; reparsedFileName = C:\1\file.txt:com.dropbox.attributes
(7) OnReparseFileName: fileName = C:\Users\User\Dropbox\tmpFolder\file.txt; reparsedFileName = C:\1\file.txt
(8) OnReparseFileName: fileName = C:\Users\User\Dropbox\tmpFolder\file.txt:com.dropbox.attributes; reparsedFileName = C:\1\file.txt:com.dropbox.attributes
(9) OnReparseFileName: fileName = C:\Users\User\Dropbox\tmpFolder; reparsedFileName = C:\1

Notice line (5). the fileName is missing the last component of the path (reparsedFileName is ok).
Can you explain this behavior?

We are using CallbackFilter V3 on a Win 7 x64 machine.

Thank you!
#27473
Posted: 11/28/2013 08:57:32
by Vladimir Cherniga (EldoS Corp.)

The request may come with a flag IO_OPEN_TARGET_DIRECTORY specified in IoCreateFile(). It does mean that parent directory should be opened, instead of file, specified in full path. Such type of request used a lot, in rename requests, for example. But we will check the issue for the possible bugs.
#27559
Posted: 12/04/2013 02:28:27
by Barak S (Standard support level)
Joined: 11/28/2013
Posts: 23

Hi Vladimir,
I still don't understand why this flag would cause inconsistency between the original file name vs. the reparsed file name.
Can you elaborate on that a little?

Thank you!
#27560
Posted: 12/04/2013 03:08:35
by Vladimir Cherniga (EldoS Corp.)

Hi, Barak,
I've explained already this problem in helpdesk ticket. This is a bug in reparese callback, it just display the source path without trailing file name, when file opened with flag IO_OPEN_TARGET_DIRECTORY. It doesn't change the reparse callback behavior, but only display the source path trimmed. With a flag set, file system doesn't open a target file, specified in full path, instead of this, it does open a parent directory. But in any cases resulting path in reparse callback must be "C:\1\file.txt"

Reply

Statistics

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