Subversion Repositories recyclebinunit

Rev

Rev 82 | Rev 98 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 82 Rev 90
1
unit RecBinUnitLowLvl;
1
unit RecBinUnitLowLvl;
2
 
2
 
3
// TODO: Gain more information about drive '@' / Homedrive / Netdrive? Win2000 source
3
// TODO: Gain more information about drive '@' / Homedrive / Netdrive? Win2000 source
4
//       + überall verwenden
4
//       + überall verwenden
5
 
5
 
6
interface
6
interface
7
 
7
 
8
uses
8
uses
9
  Windows;
9
  Windows;
10
 
10
 
11
type
11
type
12
  PRbInfoHeader = ^TRbInfoHeader;
12
  PRbInfoHeader = ^TRbInfoHeader;
13
  TRbInfoHeader = record
13
  TRbInfoHeader = record
14
    format: DWORD;         // Unsure...
14
    format: DWORD;         // Unsure...
15
                           // Win95 (without IE4): 00 00 00 00
15
                           // Win95 (without IE4): 00 00 00 00
16
                           // Win95 (with IE4):    04 00 00 00
16
                           // Win95 (with IE4):    04 00 00 00
17
                           // Win NT4:             02 00 00 00
17
                           // Win NT4:             02 00 00 00
18
                           // Win XP:              05 00 00 00
18
                           // Win XP:              05 00 00 00
19
    totalEntries: DWORD;   // Only Win95 (without IE4) and Win NT4, unknown purpose for other OS versions
19
    totalEntries: DWORD;   // Only Win95 (without IE4) and Win NT4, unknown purpose for other OS versions
20
    nextPossibleID: DWORD; // Only Win95 (without IE4) and Win NT4, unknown purpose for other OS versions
20
    nextPossibleID: DWORD; // Only Win95 (without IE4) and Win NT4, unknown purpose for other OS versions
21
    recordLength: DWORD; // 0x181  =  INFO  structure (without Unicode)
21
    recordLength: DWORD; // 0x181  =  INFO  structure (without Unicode)
22
                         // 0x320  =  INFO2 structure (with Unicode)
22
                         // 0x320  =  INFO2 structure (with Unicode)
23
    totalSize: DWORD; // sum of all "originalSize" values;
23
    totalSize: DWORD; // sum of all "originalSize" values;
24
                      // Only Win95 (without IE4) and Win NT4, unknown purpose for other OS versions
24
                      // Only Win95 (without IE4) and Win NT4, unknown purpose for other OS versions
25
  end;
25
  end;
26
 
26
 
27
type
27
type
28
  // Windows 95:      INFO file with TRbInfoRecordA; Folder deletion NOT possible
28
  // Windows 95:      INFO file with TRbInfoRecordA; Folder deletion NOT possible
29
  // Windows 95 +IE4: INFO2 file with TRbInfoRecordA; Folder deletion possible
29
  // Windows 95 +IE4: INFO2 file with TRbInfoRecordA; Folder deletion possible
30
  PRbInfoRecordA = ^TRbInfoRecordA;
30
  PRbInfoRecordA = ^TRbInfoRecordA;
31
  TRbInfoRecordA = record
31
  TRbInfoRecordA = record
32
    sourceAnsi: array[0..MAX_PATH-3] of AnsiChar; // 258 elements
32
    sourceAnsi: array[0..MAX_PATH-3] of AnsiChar; // 258 elements
33
    recordNumber: DWORD;
33
    recordNumber: DWORD;
34
    sourceDrive: DWORD;
34
    sourceDrive: DWORD;
35
    deletionTime: FILETIME;
35
    deletionTime: FILETIME;
36
    originalSize: DWORD; // Size occupied on disk. Not the actual file size.
36
    originalSize: DWORD; // Size occupied on disk. Not the actual file size.
37
                         // INFO2, for folders: The whole folder size with contents
37
                         // INFO2, for folders: The whole folder size with contents
38
  end;
38
  end;
39
 
39
 
40
type
40
type
41
  // Windows NT4:   INFO file with TRbInfoRecordW; Folder deletion possible
41
  // Windows NT4:   INFO file with TRbInfoRecordW; Folder deletion possible
42
  // Windows 2000+: INFO2 file with TRbInfoRecordW; Folder deletion possible
42
  // Windows 2000+: INFO2 file with TRbInfoRecordW; Folder deletion possible
43
  PRbInfoRecordW = ^TRbInfoRecordW;
43
  PRbInfoRecordW = ^TRbInfoRecordW;
44
  TRbInfoRecordW = record
44
  TRbInfoRecordW = record
45
    sourceAnsi: array[0..MAX_PATH-3] of AnsiChar; // 258 elements
45
    sourceAnsi: array[0..MAX_PATH-3] of AnsiChar; // 258 elements
46
    recordNumber: DWORD;
46
    recordNumber: DWORD;
47
    sourceDrive: DWORD;
47
    sourceDrive: DWORD;
48
    deletionTime: FILETIME;
48
    deletionTime: FILETIME;
49
    originalSize: DWORD;
49
    originalSize: DWORD;
50
    sourceUnicode: array[0..MAX_PATH-3] of WideChar; // 258 elements
50
    sourceUnicode: array[0..MAX_PATH-3] of WideChar; // 258 elements
51
    unknown1: DWORD; // Dummy?
51
    unknown1: DWORD; // Dummy?
52
  end;
52
  end;
53
 
53
 
54
type
54
type
-
 
55
  // Introduced in Windows Vista
55
  PRbVistaRecord1 = ^TRbVistaRecord1;
56
  PRbVistaRecord1 = ^TRbVistaRecord1;
56
  TRbVistaRecord1 = record
57
  TRbVistaRecord1 = record
57
    version: int64; // Always 01 00 00 00 00 00 00 00
58
    version: int64; // Always 01 00 00 00 00 00 00 00
58
    originalSize: int64;
59
    originalSize: int64;
59
    deletionTime: FILETIME;
60
    deletionTime: FILETIME;
60
    sourceUnicode: array[0..MAX_PATH-1] of WideChar;
61
    sourceUnicode: array[0..MAX_PATH-1] of WideChar;
61
  end;
62
  end;
62
 
63
 
63
type
64
type
-
 
65
  // Introduced somewhere in a Win10 release
64
  PRbVistaRecord2Head = ^TRbVistaRecord2Head;
66
  PRbVistaRecord2Head = ^TRbVistaRecord2Head;
65
  TRbVistaRecord2Head = record
67
  TRbVistaRecord2Head = record
66
    version: int64; // Always 02 00 00 00 00 00 00 00
68
    version: int64; // Always 02 00 00 00 00 00 00 00
67
    originalSize: int64;
69
    originalSize: int64;
68
    deletionTime: FILETIME;
70
    deletionTime: FILETIME;
-
 
71
    (* sourceUnicode: BSTR; *)
69
    sourceCountChars: DWORD; // including NUL
72
    sourceCountChars: DWORD; // including NUL
70
    //sourceUnicode: array[0..sourceCountChars+1] of WideChar;
73
    //sourceUnicode: array[0..sourceCountChars+1] of WideChar;
71
  end;
74
  end;
72
 
75
 
73
type
76
type
74
  // Windows 95 + Windows NT 4
77
  // Windows 95 + Windows NT 4
75
  // HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\BitBucket: PurgeInfo (Binary)
78
  // HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\BitBucket: PurgeInfo (Binary)
76
  PRbWin95PurgeInfo = ^TRbWin95PurgeInfo;
79
  PRbWin95PurgeInfo = ^TRbWin95PurgeInfo;
77
  TRbWin95PurgeInfo = record
80
  TRbWin95PurgeInfo = record
78
    cbSize: DWORD;
81
    cbSize: DWORD;
79
    bGlobalSettings: BOOL;
82
    bGlobalSettings: BOOL;
80
    percentDrive: array['A'..'Z'] of WORD; // 0x00..0x64 = 0%..100%
83
    percentDrive: array['A'..'Z'] of WORD; // 0x00..0x64 = 0%..100%
81
    percentHomedrive: WORD;
84
    percentHomedrive: WORD;
82
    percentGlobal: WORD;
85
    percentGlobal: WORD;
83
    NukeOnDeleteBits: DWORD; // Flags "Nuke on delete"
86
    NukeOnDeleteBits: DWORD; // Flags "Nuke on delete"
84
                             // Bit 0 (LSB): Drive A
87
                             // Bit 0 (LSB): Drive A
85
                             // Bit 1: Drive B
88
                             // Bit 1: Drive B
86
                             // ...
89
                             // ...
87
                             // Bit 25: Drive Z
90
                             // Bit 25: Drive Z
88
                             // Bit 26: Homedrive
91
                             // Bit 26: Homedrive
89
                             // Bit 27: Global
92
                             // Bit 27: Global
90
                             // Bit 28..31 (MSB) probably unused
93
                             // Bit 28..31 (MSB) probably unused
91
    unknown1: DWORD; // For example 04 0D 02 00
94
    unknown1: DWORD; // For example 04 0D 02 00
92
  end;               // or          C4 0C 02 00
95
  end;               // or          C4 0C 02 00
93
 
96
 
94
implementation
97
implementation
95
 
98
 
96
end.
99
end.
97
 
100