EldoS | Feel safer!

Software components for data protection, secure storage and transfer

How to use SetOnReparseFileName?

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
#13952
Posted: 07/19/2010 06:34:06
by ndee  (Basic support level)
Joined: 05/19/2010
Posts: 26

I'm creating a callback with this method, but it never gets called. What's wrong?
Code
g_CbFlt.SetOnReparseFileName(CbFltReparseFileNameC);
g_CbFlt.AddFilterCallbackRule(g_FilterPath + L"\\*", (CallbackFilter::CbFltCallbackFlags)(
      CallbackFilter::ReparseFileNameCallback
      ));
g_CbFlt.AttachFilter(1000);
#13953
Posted: 07/19/2010 07:12:37
by Vladimir Cherniga (EldoS Corp.)

Reparse callback works for currently active reparse rules. Add some reparse point rule, after that should be triggered callback.
#13954
Posted: 07/19/2010 11:38:45
by ndee  (Basic support level)
Joined: 05/19/2010
Posts: 26

I've tried, but that doesn't work too. Redirection rule works, but callback isn't called.
#13955
Posted: 07/19/2010 11:52:20
by ndee  (Basic support level)
Joined: 05/19/2010
Posts: 26

BTW, are you sure args of AddReparseFileNameRule are given in correct order? Manual states first arg is source and second is destination of redirection, but a test shows these args work in opposite way.
#13956
Posted: 07/19/2010 12:55:55
by Vladimir Cherniga (EldoS Corp.)

Please specify in details, what callback filter and reparse rule input parameters did you specify ? Did you try to set reparse rule for such simple form like,
for example:
g_CbFlt.AddReparseFileNameRule(L"c:\\1.txt", L"c:\\2.txt");

Please specify the sample when redirection rule works in opposite way.
#13960
Posted: 07/19/2010 22:37:00
by ndee  (Basic support level)
Joined: 05/19/2010
Posts: 26

1. the opposite way
c:\temp containes some data
c:\temp2 is empty
Code
g_CbFlt.AddReparseFileNameRule(L"c:\\temp\\*", L"c:\\temp2\\*", g_AppName);

This rule makes c:\temp to show empty folder (while it should be opposite, and make c:\temp2 the mirror of c:\temp)

2.
Code
g_CbFlt.DeleteAllReparseFileNameRules(g_AppName);
g_CbFlt.AddReparseFileNameRule(L"c:\\temp2\\*", L"c:\\temp\\*", g_AppName);

g_CbFlt.SetOnReparseFileName(CbFltReparseFileNameC);
g_CbFlt.AddFilterCallbackRule(L"c:\\*", (CallbackFilter::CbFltCallbackFlags)(
      CallbackFilter::ReparseFileNameCallback
      ));
g_CbFlt.AttachFilter(1000);

I can see and view redirected files, but callback never gets called.

P.S. I've tried with simpler rules like g_CbFlt.AddReparseFileNameRule(L"c:\\temp\\1.txt", L"c:\\temp\\2.txt");
But it doesn't trigger callback too.
#13961
Posted: 07/20/2010 03:02:07
by Eugene Mayevski (EldoS Corp.)

1) You are misreading the description. The intended behavior is exactly the one you've described above.


Sincerely yours
Eugene Mayevski
#13962
Posted: 07/20/2010 03:07:25
by Vladimir Cherniga (EldoS Corp.)

Quote
This rule makes c:\temp to show empty folder (while it should be opposite, and make c:\temp2 the mirror of c:\temp)

The logic is next - if you open c:\temp directory it will be reparsed to open directory c:\temp2, the last one is empty, so you see nothing in c:\temp

Quote
But it doesn't trigger callback too.


Please put here your executable for the tests. Also make sure that you build your sample with a cbflt library file from the last build.
#13963
Posted: 07/20/2010 05:29:40
by ndee  (Basic support level)
Joined: 05/19/2010
Posts: 26

1. ok, I see
2. it seems the reason was an extra slash in the path:
g_CbFlt.AddFilterCallbackRule(L"c:\\\\*", ......
Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.

Reply

Statistics

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