EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Delete File Handle ... How

Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.
#14996
Posted: 11/09/2010 21:14:13
by Linden ROTH (Basic support level)
Joined: 08/23/2010
Posts: 20

G'day

Finally started to dig deeper and found that I can't do what I need

1) the SetSize and SetEof call backs raise exceptions in your code ... sometimes AV @ 00402d19 Addr FFFFFFFC

2) How do I get a handle for a file that is to be deleted - (or am I missing something) ... would it be possible to have a second set of call back events that return a file handle instead of the file name (or both)

Linden

BTW Did the security issue dump I sent help ??
#14997
Posted: 11/10/2010 02:36:49
by Eugene Mayevski (EldoS Corp.)

1) Can you please clarify what code you are talking about and provide any additional information you have? The AV indicates that there's an invalid pointer somewhere, but it's not clear where this pointer comes from.

2) no -- the file is deleted by name, and it can be deleted only when it's not open and thus there exist no open handles for it.


Sincerely yours
Eugene Mayevski
#15011
Posted: 11/11/2010 00:04:40
by Linden ROTH (Basic support level)
Joined: 08/23/2010
Posts: 20

Quote
Eugene Mayevski wrote:
1) Can you please clarify what code you are talking about and provide any additional information you have? The AV indicates that there's an invalid pointer somewhere, but it's not clear where this pointer comes from.


Ok I constructed a simple test app enabling
Code
cbfMain.AddFilterCallbackRule( _drive + '\*.*', fltSetSizesCallBack ); //OnSetAllocationSizeC

procedure TfCallBackFilter.CbFltSetAllocationSizeC(Sender: TObject; FileName: TCBString;
  var AllocationSize: Int64; var Context: Pointer; var ProcessRequest: Boolean);
var
  size : int64;
begin
  size := GetFileSearchSize( filename ); //get size using a findfirst call
  if size > AllocationSize then
    AddItem( 'CbFltSetAllocationSizeC ' + inttostr( size ) + ' ' + inttostr( AllocationSize ), filename );//display in a listbox
  ProcessRequest := true;
end;


This code works for a while displaying messages but will AV with the above (not in my code area)

Quote
Eugene Mayevski wrote:
2) no -- the file is deleted by name, and it can be deleted only when it's not open and thus there exist no open handles for it.


Simply put before I delete a file how can I interrogate it ... primarily I want to get its RUN List ... eg

Code
      Status := NtFsControlFile(hFile, 0, nil, nil, @ioStatus, FSCTL_GET_RETRIEVAL_POINTERS, @startVcn, sizeof(int64), fileMappings, SizeOf(GET_RETRIEVAL_DESCRIPTOR));


where hFile is a File Handle to the file in question


HTH
TIA
#15014
Posted: 11/11/2010 03:27:59
by Vladimir Cherniga (EldoS Corp.)

Could you post a full code that cause AV so i could reproduce the bug locally ?
Also if possible post here stack trace for this bug. Thanks.
#15025
Posted: 11/11/2010 22:55:14
by Linden ROTH (Basic support level)
Joined: 08/23/2010
Posts: 20

code sent to cto - stack to follow
#15060
Posted: 11/16/2010 07:21:13
by Vladimir Cherniga (EldoS Corp.)

Is it possible to fix the issue with missing modules reference in main project file:
Code
implementation
uses
  Utils_NTFS, runLists, PairList;


or otherwise fix the code in order to not use them ?
#15066
Posted: 11/16/2010 11:14:36
by Eugene Mayevski (EldoS Corp.)

Also please post your project to HelpDesk. E-mail is a very bad way to send anything.


Sincerely yours
Eugene Mayevski
#15084
Posted: 11/17/2010 19:26:32
by Linden ROTH (Basic support level)
Joined: 08/23/2010
Posts: 20

Quote
Vladimir Cherniga wrote:
Is it possible to fix the issue with missing modules reference in main project file:
Code
implementation
uses
  Utils_NTFS, runLists, PairList;


or otherwise fix the code in order to not use them ?


Woops playing with delete issue

delete uses and change (just remove references to units) AddItem method

to
Code
var
  i : integer;
  j : integer;

begin
  while lbResults.items.count > 1000 do
    lbResults.items.Delete( 1 );
  lbResults.AddItem( DateTimetoStr( now ) + ' : ' + _func + '  ' + _fName, nil );
end;
#15091
Posted: 11/22/2010 05:34:55
by Vladimir Cherniga (EldoS Corp.)

Hi, i run your code on WinXP 32bit system trying to catch the error, but cannot reproduce the situation. Should i follow the specific conditions to reproduce the bug ? Also i would like to ask about Callback Filter version used by you. Also interested in date/time stamp of the object files resides in VCL\Sources\Obj\ directory of your installation. Thanks.
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 2918 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!