EldoS | Feel safer!

Software components for data protection, secure storage and transfer

FileMon not fire envnts

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
Posted: 12/17/2011 20:13:14
by Chanwoo Jung (Standard support level)
Joined: 12/17/2011
Posts: 5

I tested FileMon Sample with Delphi XE2.

All the cbfFilter...N events were fired.
but, cbfFilter...C events were not fired.

Did I mistake?
Let me know the basic usage of CallbackFilter.
I want to prevent copying, moving, deleting some file.
Posted: 12/18/2011 05:24:33
by Vladimir Cherniga (EldoS Corp.)

cbfFilter...C callbacks are not implemented in FileMon sample. You should add them manually. See the documentation for details.
Posted: 12/28/2011 09:43:58
by Chanwoo Jung (Standard support level)
Joined: 12/17/2011
Posts: 5

I coded "AddFilterCallbackRule" into your FileMon sample

procedure TfrmMain.btnSetFilterClick(Sender: TObject);
    fltReadNotify or
    fltRenameNotify or
  cbfFilter.ReadWriteFileInPreCreatePath := false;
  cbfFilter.FlushFilesOnClose := false;

procedure TfrmMain.cbfFilterCanFileBeDeletedC(Sender: TObject;
  FileName: TCBString; var DeleteFile: Boolean; var UserContext: Pointer;
  var ProcessRequest: Boolean);
  AddToLog(Format('cbfFilterCanFileBeDeletedC %s', [FileName]));


procedure TfrmMain.cbfFilterReadFileC(Sender: TObject; FileName: TCBString;
  var Position: Int64; Buffer: PByte; var BytesToRead: Cardinal;
  Cached: Boolean; var UserContext: Pointer; var ProcessRequest: Boolean);
  AddToLog(Format('cbfFilterReadFileC %s', [FileName]));


procedure TfrmMain.cbfFilterRenameOrMoveFileC(Sender: TObject; FileName,
  NewFileName: TCBString; var UserContext: Pointer;
  var ProcessRequest: Boolean);
  AddToLog(Format('cbfFilterRenameOrMoveFileC %s %s', [FileName, NewFileName]));

But, I can't catch any event
Did I mistake?
Posted: 12/28/2011 10:34:29
by Eugene Mayevski (EldoS Corp.)

You have not enabled *C events -- see lines 4-6 of your code, only *N events are enabled there.

Sincerely yours
Eugene Mayevski
Posted: 12/29/2011 10:25:44
by Chanwoo Jung (Standard support level)
Joined: 12/17/2011
Posts: 5

I just mistook the options.
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.



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