Subversion Repositories recyclebinunit

Rev

Rev 98 | Rev 100 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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