EldoS | Feel safer!

Software components for data protection, secure storage and transfer

why the postReadC Callback function can not be fired

Also by EldoS: SecureBlackbox
200+ components and classes for digital security, signing, encryption and secure networking.
#8845
Posted: 02/11/2009 01:58:28
by lcp lcp (Basic support level)
Joined: 10/07/2008
Posts: 17

I used the version 1.0.13.35

the postReadC and postWriteC callback functions can not be fired.

why? I have set the fltReadCallback or fltWriteCallback flag to the filter.

#8847
Posted: 02/11/2009 03:03:56
by Vladimir Cherniga (EldoS Corp.)

Hi,
does it mean that preWriteC and preReadC work correctly? Could you specify the files type that is monitored and the application that performes access to that files ?
#8848
Posted: 02/11/2009 03:27:54
by lcp lcp (Basic support level)
Joined: 10/07/2008
Posts: 17

Yes, preWriteC and preReadC work correctly.
I open the sample Encrypt, set moniter path to "c:\Crypt\*.txt"
and create a file "c:\Crypt\1.txt", open it with notepad.exe, then start filter.
The programe work correctly.But I can not see the postReadC or PostWriteC be fired.

I changed the code , change the ProcessRequest in preReadC or preWriteC to True
Can not see the fire log too.




#8849
Posted: 02/11/2009 06:04:24
by Vladimir Cherniga (EldoS Corp.)

Have you added the code in a postReadC,postWriteC that puts messages to the log (AddToLog()) ?
#8860
Posted: 02/11/2009 19:20:48
by lcp lcp (Basic support level)
Joined: 10/07/2008
Posts: 17

Yes,i add the log.
-------------------
1.set the fltReadCallback filter
-------------------
procedure TfrmMain.btnSetFilterClick(Sender: TObject);
begin
cbfFilter.AddFilterCallbackRule(edtPath.Text,
fltReadCallback or
fltWriteCallback or
fltCreateCallback or
fltRenameCallback or
fltSetSizesCallback or
fltDeleteCallback or
fltSetBasicInfoCallback or
fltEnumerateDirectoryCallback or
fltOpenCallback or
fltCloseCallback
);
cbfFilter.AttachFilter(0);
UpdateAllButtons;
end;
-------------------------
2. add log to readfileC
-------------------------
procedure TfrmMain.CallbackFilterReadFileC(Sender: TObject;
FileName: TCBString; var Position: Int64; Buffer: PByte;
var BytesToRead: Cardinal; var UserContext: Pointer;
var ProcessRequest: Boolean);
var
Context: TEncryptContext;
begin

Context := TEncryptContext(UserContext);
AddToLog(Format('ReadFileC %s, FileHandle = %x', [FileName,Context.FHandle]));
Context.Read(Position, Buffer, BytesToRead);
ProcessRequest := False;

end;
-----------------------
3. add log to PostreadfileC
------------------------------
procedure TfrmMain.cbfFilterPostReadFileC(Sender: TObject;
FileName: TCBString; Position: Int64; Buffer: PByte;
BytesToRead: Cardinal; var UserContext: Pointer;
var ProcessRequest: Boolean);
begin
addTolog('xxxxxxxxxxxxxxxxxxxxx');
ProcessRequest:=false;
end;
-----------------------------------

I can see the readfilec log,can not see the postreadfilec log.
#8878
Posted: 02/12/2009 14:56:01
by Vladimir Cherniga (EldoS Corp.)

Quote
-------------------------
2. add log to readfileC
-------------------------
...
Context.Read(Position, Buffer, BytesToRead);
ProcessRequest := False;


In order to receive PostReadC event you should rewrite the next string:
Code
ProcessRequest := True;

I have tested "Encrypt" and it works properly.
Try doing the tests with a "Base Filter" sample. It more sutaible for callbacks monitoring purposes.
Also by EldoS: SecureBlackbox
200+ components and classes for digital security, signing, encryption and secure networking.

Reply

Statistics

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