/trunk/FORMAT.md |
---|
3,7 → 3,7 |
## Locations of the index files |
### FAT drives: |
### FAT drives |
- Windows 95 native: `C:\RECYCLED\INFO` (with ANSI records, folder deletion is NOT possible, format `00 00 00 00`) |
- Windows 95+IE4, 98SE: `C:\RECYCLED\INFO2` (with ANSI records, folder deletion is possible, format `04 00 00 00`) |
11,7 → 11,7 |
- Windows Vista+: `C:\$RECYCLE.BIN\$I...` |
- Windows 95 (Beta 58s) `C:\CHICAGO\DESKTOP\RECYCLE.BIN` (a normal folder with the deleted files. There are no index files and deleted files won't get renamed). In beta build 122, the recycle bin was removed and re-added in beta build 180 with the INFO-format we know from the RTM release. |
### NTFS drives: |
### NTFS drives |
- Windows NT4: `C:\RECYCLER\<UserSID>\INFO` (with Unicode records, folder deletion is possible, format `02 00 00 00`) |
- Windows 2000, XP: `C:\RECYCLER\<UserSID>\INFO2` (with Unicode records, folder deletion is possible, format `05 00 00 00`) |
/trunk/Recycle Bin Unit v2/Changelog.txt |
---|
1,6 → 1,11 |
=== Changelog RecBinUnit v2 === |
2023-04-06 |
+ Fixed a bug where a Vista data file ($R) was evaluated as index file ($I). Probably a bug in Delphi/WinAPI. |
+ Demo application: Wait indicator added |
+ Demo application: Tree can now be saved as TXT file |
2022-07-03 |
+ Added support for "Network home drives" recycle bin (from Win95 days) |
/trunk/Recycle Bin Unit v2/RecBinUnit2.pas |
---|
5,7 → 5,7 |
// E-MAIL: info@daniel-marschall.de // |
// Web: www.daniel-marschall.de & www.viathinksoft.de // |
//////////////////////////////////////////////////////////////////////////////////// |
// Revision: 07 JUL 2022 // |
// Revision: 04 JUN 2023 // |
// This unit is freeware, but please link to my website if you are using it! // |
//////////////////////////////////////////////////////////////////////////////////// |
// Successfully tested with: // |
55,7 → 55,7 |
Windows, SysUtils, Classes, ContNrs, ShellAPI, Registry, Messages, Math; |
const |
RECBINUNIT_VERSION = '2022-07-07'; |
RECBINUNIT_VERSION = '2023-06-04'; |
RECYCLER_CLSID: TGUID = '{645FF040-5081-101B-9F08-00AA002F954E}'; |
NULL_GUID: TGUID = '{00000000-0000-0000-0000-000000000000}'; |
930,6 → 930,7 |
end; |
end; |
// TODO: Nice would be some progress callback function |
procedure _HandleVistaDir(ADirectory: string); |
var |
SR: TSearchRec; |
938,9 → 939,14 |
begin |
ADirectory := IncludeTrailingPathDelimiter(ADirectory); |
if FindFirst(ADirectory + '$I*', faAnyFile, SR) = 0 then |
//if FindFirst(ADirectory + '$I*', faAnyFile, SR) = 0 then |
if FindFirst(ADirectory + '*', faAnyFile, SR) = 0 then |
begin |
repeat |
// FindFirst filter '$I*' finds the file '$RJK3R4P.~43~' and '$RJB99A3.~55~' (yes, $R !!!) Why?! |
// ... so, we just filter for '*' and try to find the '$I*' files ourselves... |
if UpperCase(Copy(sr.Name,1,2)) = '$I' then |
begin |
id := sr.Name; |
{ id := ChangeFileExt(id, ''); } // Removed code: We keep the file extention as part of the ID, because we do not know if the ID is otherwise unique |
id := Copy(id, 3, Length(id)-2); |
952,6 → 958,7 |
finally |
FreeAndNil(fs); |
end; |
end; |
until FindNext(SR) <> 0; |
end; |
FindClose(SR); |
1581,14 → 1588,14 |
r1: TRbVistaRecord1; |
r2: TRbVistaRecord2Head; |
r2SourceUnicode: array of WideChar; |
version: int64; |
ver: int64; |
i: Integer; |
resourcestring |
LNG_VISTA_WRONG_FORMAT = 'Invalid Vista index format version %d'; |
LNG_VISTA_WRONG_FORMAT = 'Invalid Vista index format version %d at file %s'; |
begin |
stream.ReadBuffer(version, SizeOf(version)); |
stream.ReadBuffer(ver, SizeOf(ver)); |
if version = 1 then |
if ver = 1 then |
begin |
stream.Seek(0, soBeginning); |
stream.ReadBuffer(r1, SizeOf(r1)); |
1608,7 → 1615,7 |
FDeletionTime := FileTimeToDateTime(r1.deletionTime); |
FOriginalSize := r1.originalSize; |
end |
else if version = 2 then |
else if ver = 2 then |
begin |
stream.Seek(0, soBeginning); |
stream.ReadBuffer(r2, SizeOf(r2)); |
1634,7 → 1641,7 |
end |
else |
begin |
raise Exception.CreateFmt(LNG_VISTA_WRONG_FORMAT, [version]); |
raise Exception.CreateFmt(LNG_VISTA_WRONG_FORMAT, [ver, FID]); |
end; |
// Remove #0 at the end. There are some bugs where #0 is added to ANSI/Unicode read paths?! (probably in the ReadVista stuff) |
1668,9 → 1675,9 |
constructor TRbVistaItem.Create(fs: TStream; AIndexFile, AID: string); |
begin |
inherited Create; |
ReadFromStream(fs); |
FIndexFile := AIndexFile; |
FID := AID; |
ReadFromStream(fs); |
end; |
{ TRecycleBinManager } |
/trunk/Recycle Bin Unit v2/RecyclerListing.exe |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/Recycle Bin Unit v2/RecyclerListing.res |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/Recycle Bin Unit v2/RecyclerListing64.exe |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/Recycle Bin Unit v2/RecyclerListingMain.dfm |
---|
91,7 → 91,16 |
TabOrder = 5 |
OnClick = Button3Click |
end |
object Button4: TButton |
Left = 736 |
Top = 48 |
Width = 137 |
Height = 33 |
Caption = 'Save tree to TXT file' |
TabOrder = 6 |
OnClick = Button4Click |
end |
end |
object OpenDialog1: TOpenDialog |
Left = 928 |
Top = 16 |
635,4 → 644,11 |
FFFFFFFF07FF47FFFFFFFFFF9FFF9FFF00000000000000000000000000000000 |
000000000000} |
end |
object SaveDialog1: TSaveDialog |
DefaultExt = '.txt' |
Filter = 'Text files (*.txt)|*.txt|All files (*.*)|*.*' |
Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing] |
Left = 928 |
Top = 112 |
end |
end |
/trunk/Recycle Bin Unit v2/RecyclerListingMain.pas |
---|
18,11 → 18,14 |
ImageList1: TImageList; |
CheckBox2: TCheckBox; |
Button3: TButton; |
Button4: TButton; |
SaveDialog1: TSaveDialog; |
procedure Button1Click(Sender: TObject); |
procedure Button2Click(Sender: TObject); |
procedure FormShow(Sender: TObject); |
procedure TreeView1DblClick(Sender: TObject); |
procedure Button3Click(Sender: TObject); |
procedure Button4Click(Sender: TObject); |
private |
localRecyclersNode: TTreeNode; |
individualRecyclersNode: TTreeNode; |
50,6 → 53,9 |
ICON_UNKNOWN = 8; |
ICON_FOLDER = 10; |
resourcestring |
S_PLEASE_WAIT = 'Please wait'; |
procedure TRecyclerListingMainForm.Button1Click(Sender: TObject); |
var |
drives: TObjectList{TRbDrive}; |
67,9 → 73,14 |
item: TRbRecycleBinItem; |
nItem: TTreeNode; |
sCaption: string; |
bakCaption: string; |
resourcestring |
S_DRIVE = 'Drive %s'; |
begin |
bakCaption := Button1.Caption; |
Button1.Caption := S_PLEASE_WAIT; |
try |
localRecyclersNode.DeleteChildren; // TODO: Will the objects be freed? This is important to avoid memory leaks. |
TreeView1.Items.BeginUpdate; |
135,7 → 146,10 |
end; |
localRecyclersNode.Expand(false); |
finally |
Button1.Caption := bakCaption; |
end; |
end; |
procedure TRecyclerListingMainForm.Button2Click(Sender: TObject); |
var |
147,7 → 161,11 |
item: TRbRecycleBinItem; |
nItem: TTreeNode; |
sCaption: string; |
bakCaption: string; |
begin |
bakCaption := Button2.Caption; |
Button2.Caption := S_PLEASE_WAIT; |
try |
bin := TRbRecycleBin.Create(LabeledEdit1.Text); |
nBin := TreeView1.Items.AddChildObject(individualRecyclersNode, bin.FileOrDirectory, bin); |
184,7 → 202,10 |
end; |
nBin.Expand(false); |
finally |
Button2.Caption := bakCaption; |
end; |
end; |
procedure TRecyclerListingMainForm.Button3Click(Sender: TObject); |
begin |
192,6 → 213,14 |
LabeledEdit1.Text := OpenDialog1.FileName; |
end; |
procedure TRecyclerListingMainForm.Button4Click(Sender: TObject); |
begin |
if SaveDialog1.Execute then |
begin |
TreeView1.SaveToFile(SaveDialog1.FileName); |
end; |
end; |
procedure TRecyclerListingMainForm.FormShow(Sender: TObject); |
resourcestring |
S_LOCAL_RECYCLE_BINS = 'Local recycle bins'; |
/trunk/Recycle Bin Unit v2 |
---|
Property changes: |
Modified: svn:global-ignores |
*.local |
*.identcache |
__history |
+__recovery |
*.dcu |