EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Problem with SolStorage.FindFirst

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#3723
Posted: 09/09/2007 20:39:34
by Anthoni Gardner (Basic support level)
Joined: 07/24/2007
Posts: 29

Here is my Delphi Code

Code
procedure TdmSol.SolRestore;
var
  sr: TStorageSearch;
  sFile: String;

begin
  //
  If SolStorage.FindFirst(sr, '*.*', attrFile) Then
  Begin
    Repeat
      sFile := sr.FileName;
      If BHO.MediaType(sFile) <> mtNone Then
        DB.Add(sFile, 'virtual');
    Until SolStorage.FindNext(sr) = False;
    SolStorage.FindClose(sr);
  End;
end;


Even though there are files in the storage (2 to be exact) it does not enter the if condition.
It just jumps straight out without finding anything.

What am I doing wrong ?

Regards
Anthoni
#3724
Posted: 09/09/2007 20:42:07
by Anthoni Gardner (Basic support level)
Joined: 07/24/2007
Posts: 29

Sorry forgot to add I am using the Driver Edition of SolFS
1.5.14.255 -- > Sol Disk Driver
1.5.14.209 -- > SolFS Driver

Delphi 7 Enterprise
#3725
Posted: 09/10/2007 01:48:16
by Eugene Mayevski (EldoS Corp.)

The path is missing.


Sincerely yours
Eugene Mayevski
#3727
Posted: 09/10/2007 11:43:39
by Anthoni Gardner (Basic support level)
Joined: 07/24/2007
Posts: 29

Hi Eugene,

How do you mean the path is missing?
Do I put it in the wildcard place ?
Is so, what do i put, as my files are in the root of the drive, so something like
SolStorage.FindFirst(sr, '\*.*', attrFile) does not work.

To access the virtual drive by normal Delphi I use the \\?\mydisk\
But I was under the impression that you do not need to do that if using Sol functions directly?
Or am I wrong again?

Regards
Anthoni
#3728
Posted: 09/10/2007 11:50:33
by Anthoni Gardner (Basic support level)
Joined: 07/24/2007
Posts: 29

As an addition,

I just tried doing
SolStorage.FindFirst(sr, '\\?\mydisk\*.*', attrFile) and it threw an exception saying can not find the path specified.
#3729
Posted: 09/10/2007 14:23:31
by Anthoni Gardner (Basic support level)
Joined: 07/24/2007
Posts: 29

I think I've solved, partially at least.

SolStorage.FindFirst(sr, '*.*', attrFile AND attrDirectory)
Here I added the AND attrDirectory and it now finds all the files without the need for the path indicator in the wild card section (mainly because I do not know what to put here).

However, if there are NO files in the storage this throws an exception, saying it cant find the path specified !! It works flawlessly if there are files in the solfs file.

Any clues ?
#3731
Posted: 09/11/2007 00:05:01
by Eugene Mayevski (EldoS Corp.)

You DO need to specify the path to the files.


Sincerely yours
Eugene Mayevski
#3732
Posted: 09/11/2007 00:24:10
by Eugene Mayevski (EldoS Corp.)

BTW Thanks for the tip, we will update the code to reject any calls without the path.


Sincerely yours
Eugene Mayevski
#3739
Posted: 09/11/2007 16:58:00
by Anthoni Gardner (Basic support level)
Joined: 07/24/2007
Posts: 29

Hi Eugene,

How do you specify the path though ?
Each way I tried it, it kept failing.

Like I said, I've managed to do without specifying the path BUT if you alter the code its not going to work, so I need to know what I put in for the path.

All my files are in the root, no folders. My mounting point is \\?\mydisk\

Please advice.

Regards
Anthoni
#3742
Posted: 09/12/2007 02:44:24
by Alexander Plas (EldoS Corp.)

Hello.

For calling methods of SolFSStorage or SolFSStream you should use internal SolFS file names. For example – to find all files in the root directory of SolFS storage you can use SolStorage.FindFirst(sr, '\*.*', attrFile) call. For calling OS API functions you should use fully qualified file names, like '\\?\mydisk\*.*'. You can convert internal file names to system and vice versa with SolFSStorage methods ConvertFileNameToSystem and ConvertFileNameToStorage.
Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.

Reply

Statistics

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