Subversion Repositories recyclebinunit

Compare Revisions

No changes between revisions

Regard whitespace Rev 26 → Rev 27

/trunk/Recycle Bin Unit/RecyclerFunctions.pas
3,7 → 3,7
// E-MAIL: info@daniel-marschall.de //
// WEB: www.daniel-marschall.de //
////////////////////////////////////////////////////////////////////////////////////
// Revision: 04 JUL 2010 //
// Revision: 05 JUL 2010 //
// This unit is freeware, but please link to my website if you are using it! //
////////////////////////////////////////////////////////////////////////////////////
// Successful tested with: //
44,8 → 44,6
 
== TODO LISTE ==
 
WINDOWS 7 COMPATIBILITY: No VALID recyclers found!
 
Wichtig! Windows XP: InfoTip, IntroText und LocalizedString sind Resourcenangaben und müssen ausgelesen werden!
Testen: Wie reagiert Windows, wenn Bitbucket\C existiert, aber kein Wert 'Percent' hat? Mit der Standardeinstellung?
Bug: Windows 2000 bei bestehenden Windows 95 Partition: Recycler Filename ist dann Recycled und nicht Recycler!
115,8 → 113,7
uses
Windows, SysUtils, Classes, {$IFDEF DEL6UP}DateUtils,{$ENDIF}
ShellApi{$IFNDEF DEL6UP}, FileCtrl{$ENDIF}, Registry,
Messages, BitOps,
Dialogs;
Messages, BitOps;
 
type
EUnknownState = class(Exception);
755,34 → 752,6
end;
end;
 
// http://www.delphipages.com/tips/thread.cfm?ID=294
// Changed
(* function IsWin95: boolean;
var
OS: TOSVersionInfo;
begin
ZeroMemory(@OS, SizeOf(OS));
OS.dwOSVersionInfoSize := SizeOf(OS);
GetVersionEx(OS);
// http://www.gaijin.at/lstwinver.php
Result := (OS.dwMajorVersion = 4) and (OS.dwMinorVersion <= 3) and
(OS.dwPlatformId=VER_PLATFORM_WIN32_WINDOWS);
end; *)
 
// http://www.delphipages.com/tips/thread.cfm?ID=294
// Changed
function _isVistaOrHigher: boolean;
var
OS: TOSVersionInfo;
begin
ZeroMemory(@OS, SizeOf(OS));
OS.dwOSVersionInfoSize := SizeOf(OS);
GetVersionEx(OS);
// http://www.gaijin.at/lstwinver.php
Result := (OS.dwMajorVersion >= 6) (* and (OS.dwMinorVersion >= 0) *) and
(OS.dwPlatformId = VER_PLATFORM_WIN32_NT);
end;
 
// **********************************************************
// VISTA AND WINDOWS 7 FUNCTIONS, INTERNAL USED
// **********************************************************
1573,11 → 1542,8
// Bei Vista und W2k3 (VM) erhalte ich bei LW A: die Meldung
// "c0000013 Kein Datenträger". Exception Abfangen geht nicht.
// Daher erstmal überprüfen, ob Laufwerk existiert.
ShowMessage('Is Valid? ' + drive);
result := false;
ShowMessage('A');
if not RecyclerIsPossible(drive) then exit;
ShowMessage('B');
 
result := RecyclerIsValid(drive, '');
end;
1590,10 → 1556,7
result := false;
if not RecyclerIsPossible(drive) then exit;
 
ShowMessage('C');
infofile := RecyclerGetPath(drive, UserSID, false);
ShowMessage(infofile);
ShowMessage('D');
result := RecyclerIsValid(infofile);
end;
 
1608,14 → 1571,11
 
tmp := InfofileOrRecycleFolder;
 
ShowMessage('F');
if _isFileVistaNamed(tmp) then
begin
ShowMessage('F2');
result := _VistaIsValid(tmp);
exit;
end;
ShowMessage('F3');
 
{$IFDEF allow_all_filenames}
if not RecyclerIsValid(tmp) and fileexists(tmp) then
1662,9 → 1622,7
end;
end;
 
ShowMessage('G');
if not fileexists(tmp) then exit;
ShowMessage('H');
 
result := _checkInfo1or2File(tmp);
end;
1823,10 → 1781,8
var
dir: string;
begin
(* if Win32Platform = VER_PLATFORM_WIN32_NT then
begin *)
if _isVistaOrHigher() then
begin
// Find recyclers from Windows Vista or higher
 
if _isFAT(drive) then
begin
dir := drive + DriveDelim + PathDelim + '$recycle.bin' + PathDelim;
1867,13 → 1823,11
end
else
begin
ShowMessage('X'+_getMySID());
dir := drive + DriveDelim + PathDelim + '$recycle.bin'+PathDelim+_getMySID()+PathDelim;
if IncludeInfofile and (fileid <> '') then
begin
if fileExists(dir + '$I'+fileid) then
begin
showmessage('Y2 ' + dir + '$I'+fileid);
result.Add(dir + '$I'+fileid);
end;
end
1881,15 → 1835,14
begin
if directoryExists(dir) then
begin
showmessage('Y1 ' + dir);
result.Add(dir);
end;
end;
end;
end;
end
else
begin
 
// Find recyclers from Windows before Vista
 
if _isFAT(drive) then
begin
dir := drive + DriveDelim + PathDelim + 'Recycled' + PathDelim;
1939,21 → 1892,6
end;
end;
end;
(* end;
else
begin
if isWin95() then
begin
result := drive + DriveDelim + PathDelim + 'Recycled' + PathDelim;
if IncludeInfofile then result := result + 'INFO';
end
else
begin
result := drive + DriveDelim + PathDelim + 'Recycled' + PathDelim;
if IncludeInfofile then result := result + 'INFO2';
end;
end; *)
end;
 
procedure RecyclerGetInfofiles(drive: char; UserSID: string; IncludeInfofile: boolean; result: TStringList); overload;
begin
3087,7 → 3025,7
 
function RecyclerLibraryVersion: string;
begin
result := 'ViaThinkSoft Recycle Bin Unit [04 JUL 2010]';
result := 'ViaThinkSoft Recycle Bin Unit [05 JUL 2010]';
end;
 
end.
/trunk/Recycle Bin Unit/Recycler.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream