Subversion Repositories recyclebinunit

Rev

Rev 92 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 92 Rev 96
Line 385... Line 385...
385
resourcestring
385
resourcestring
386
  LNG_UNEXPECTED_STATE = 'Cannot determinate state of "%s" because of an unknown value in the configuration of your operation system. Please contact the developer of the Recycler Bin Unit and help improving the determination methods!';
386
  LNG_UNEXPECTED_STATE = 'Cannot determinate state of "%s" because of an unknown value in the configuration of your operation system. Please contact the developer of the Recycler Bin Unit and help improving the determination methods!';
387
  LNG_API_CALL_ERROR = 'Error while calling the API. Additional information: "%s".';
387
  LNG_API_CALL_ERROR = 'Error while calling the API. Additional information: "%s".';
388
  LNG_NOT_CALLABLE = '%s not callable';
388
  LNG_NOT_CALLABLE = '%s not callable';
389
  LNG_ERROR_CODE = '%s (Arguments: %s) returns error code %s';
389
  LNG_ERROR_CODE = '%s (Arguments: %s) returns error code %s';
-
 
390
  LNG_UNEXPECTED_VISTA_FORMAT = 'Unexpeceted version %d of Vista index file';
390
 
391
 
391
function _DeleteDirectory(const Name: string): boolean;
392
function _DeleteDirectory(const Name: string): boolean;
392
var
393
var
393
  F: TSearchRec;
394
  F: TSearchRec;
394
begin
395
begin
Line 964... Line 965...
964
 
965
 
965
  fs := TFileStream.Create(tmp, fmOpenRead);
966
  fs := TFileStream.Create(tmp, fmOpenRead);
966
  try
967
  try
967
    fs.ReadBuffer(version, 4);
968
    fs.ReadBuffer(version, 4);
968
    if version > 2 then
969
    if version > 2 then
969
      raise Exception.CreateFmt('Unexpeceted version %d of Vista index file', [version]);
970
      raise Exception.CreateFmt(LNG_UNEXPECTED_VISTA_FORMAT, [version]);
970
    fs.seek(drive_vista_position, soFromBeginning);
971
    fs.seek(drive_vista_position, soFromBeginning);
971
    result := _readChar(fs);
972
    result := _readChar(fs);
972
  finally
973
  finally
973
    fs.free;
974
    fs.free;
974
  end;
975
  end;
Line 991... Line 992...
991
 
992
 
992
  fs := TFileStream.Create(tmp, fmOpenRead);
993
  fs := TFileStream.Create(tmp, fmOpenRead);
993
  try
994
  try
994
    fs.ReadBuffer(version, 4);
995
    fs.ReadBuffer(version, 4);
995
    if version > 2 then
996
    if version > 2 then
996
      raise Exception.CreateFmt('Unexpeceted version %d of Vista index file', [version]);
997
      raise Exception.CreateFmt(LNG_UNEXPECTED_VISTA_FORMAT, [version]);
997
    fs.seek(timestamp_vista_position, soFromBeginning);
998
    fs.seek(timestamp_vista_position, soFromBeginning);
998
    result := _fileTimeToDateTime(_readInt64(fs));
999
    result := _fileTimeToDateTime(_readInt64(fs));
999
  finally
1000
  finally
1000
    fs.free;
1001
    fs.free;
1001
  end;
1002
  end;
Line 1024... Line 1025...
1024
      // Note: This is not the official way to read the source. Actually, you should check the size and only read this specified size
1025
      // Note: This is not the official way to read the source. Actually, you should check the size and only read this specified size
1025
      fs.seek(unicode_vista_position_v2, soFromBeginning)
1026
      fs.seek(unicode_vista_position_v2, soFromBeginning)
1026
    else if version = 1 then
1027
    else if version = 1 then
1027
      fs.seek(unicode_vista_position_v1, soFromBeginning)
1028
      fs.seek(unicode_vista_position_v1, soFromBeginning)
1028
    else
1029
    else
1029
      raise Exception.CreateFmt('Unexpeceted version %d of Vista index file', [version]);
1030
      raise Exception.CreateFmt(LNG_UNEXPECTED_VISTA_FORMAT, [version]);
1030
    result := _readNullTerminatedWideString(fs);
1031
    result := _readNullTerminatedWideString(fs);
1031
  finally
1032
  finally
1032
    fs.free;
1033
    fs.free;
1033
  end;
1034
  end;
1034
end;
1035
end;
Line 1049... Line 1050...
1049
 
1050
 
1050
  fs := TFileStream.Create(tmp, fmOpenRead);
1051
  fs := TFileStream.Create(tmp, fmOpenRead);
1051
  try
1052
  try
1052
    fs.ReadBuffer(version, 4);
1053
    fs.ReadBuffer(version, 4);
1053
    if version > 2 then
1054
    if version > 2 then
1054
      raise Exception.CreateFmt('Unexpeceted version %d of Vista index file', [version]);
1055
      raise Exception.CreateFmt(LNG_UNEXPECTED_VISTA_FORMAT, [version]);
1055
    fs.seek(size_vista_position, soFromBeginning);
1056
    fs.seek(size_vista_position, soFromBeginning);
1056
    result := _readInt32(fs);
1057
    result := _readInt32(fs);
1057
  finally
1058
  finally
1058
    fs.free;
1059
    fs.free;
1059
  end;
1060
  end;
Line 2217... Line 2218...
2217
  end;
2218
  end;
2218
end;
2219
end;
2219
 
2220
 
2220
function RecyclerShellStateConfirmationDialogEnabled: boolean;
2221
function RecyclerShellStateConfirmationDialogEnabled: boolean;
2221
type
2222
type
2222
  TSHGetSettings = procedure (var lpss: SHELLSTATE; dwMask: DWORD) stdcall;
2223
  TSHGetSettings = procedure (var lpss: SHELLSTATE; dwMask: DWORD); stdcall;
2223
const
2224
const
2224
  C_SHGetSettings = 'SHGetSettings';
2225
  C_SHGetSettings = 'SHGetSettings';
2225
var
2226
var
2226
  lpss: SHELLSTATE;
2227
  lpss: SHELLSTATE;
2227
  bNoConfirmRecycle: boolean;
2228
  bNoConfirmRecycle: boolean;
Line 2289... Line 2290...
2289
  if (RBHandle <> 0) then FreeLibrary(RBHandle);
2290
  if (RBHandle <> 0) then FreeLibrary(RBHandle);
2290
end;
2291
end;
2291
 
2292
 
2292
procedure RecyclerConfirmationDialogSetEnabled(NewSetting: boolean);
2293
procedure RecyclerConfirmationDialogSetEnabled(NewSetting: boolean);
2293
type
2294
type
2294
  TSHGetSetSettings = procedure (var lpss: SHELLSTATE; dwMask: DWORD; bSet: BOOL) stdcall;
2295
  TSHGetSetSettings = procedure (var lpss: SHELLSTATE; dwMask: DWORD; bSet: BOOL); stdcall;
2295
const
2296
const
2296
  C_SHGetSetSettings = 'SHGetSetSettings';
2297
  C_SHGetSetSettings = 'SHGetSetSettings';
2297
var
2298
var
2298
  lpss: SHELLSTATE;
2299
  lpss: SHELLSTATE;
2299
 
2300