Subversion Repositories recyclebinunit

Rev

Rev 101 | Details | Compare with Previous | Last modification | View Log | RSS feed

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