Subversion Repositories recyclebinunit

Rev

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

  1. unit RecBinUnitLowLvl;
  2.  
  3. // TODO: Gain more information about drive '@' / Homedrive / Netdrive?
  4.  
  5. interface
  6.  
  7. uses
  8.   Windows;
  9.  
  10. type
  11.   PRbInfoHeader = ^TRbInfoHeader;
  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
  24.   end;
  25.  
  26. type
  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;
  30.   TRbInfoRecordA = packed record
  31.     sourceAnsi: array[0..MAX_PATH-1] of AnsiChar; // 260 characters (including NUL terminator)
  32.     recordNumber: DWORD;
  33.     sourceDrive: DWORD; // 0=A, 1=B, 2=C, ...
  34.     deletionTime: FILETIME;
  35.     originalSize: DWORD; // Size occupied on disk. Not the actual file size.
  36.                          // INFO2, for folders: The whole folder size with contents
  37.   end;
  38.  
  39. type
  40.   // Windows NT4:   INFO file with TRbInfoRecordW; Folder deletion possible
  41.   // Windows 2000+: INFO2 file with TRbInfoRecordW; Folder deletion possible
  42.   PRbInfoRecordW = ^TRbInfoRecordW;
  43.   TRbInfoRecordW = packed record
  44.     sourceAnsi: array[0..MAX_PATH-1] of AnsiChar; // 260 characters (including NUL terminator)
  45.     recordNumber: DWORD;
  46.     sourceDrive: DWORD; // 0=A, 1=B, 2=C, ...
  47.     deletionTime: FILETIME;
  48.     originalSize: DWORD;
  49.     sourceUnicode: array[0..MAX_PATH-1] of WideChar; // 260 characters (including NUL terminator)
  50.   end;
  51.  
  52. type
  53.   // Introduced in Windows Vista
  54.   PRbVistaRecord1 = ^TRbVistaRecord1;
  55.   TRbVistaRecord1 = packed record
  56.     version: int64; // Always 01 00 00 00 00 00 00 00
  57.     originalSize: int64;
  58.     deletionTime: FILETIME;
  59.     sourceUnicode: array[0..MAX_PATH-1] of WideChar;
  60.   end;
  61.  
  62. type
  63.   // Introduced somewhere in a Win10 release
  64.   PRbVistaRecord2Head = ^TRbVistaRecord2Head;
  65.   TRbVistaRecord2Head = packed record
  66.     version: int64; // Always 02 00 00 00 00 00 00 00
  67.     originalSize: int64;
  68.     deletionTime: FILETIME;
  69.     (* sourceUnicode: BSTR; *)
  70.     sourceCountChars: DWORD; // including NUL
  71.     //sourceUnicode: array[0..sourceCountChars+1] of WideChar;
  72.   end;
  73.  
  74. type
  75.   // Windows 95 + Windows NT 4
  76.   // HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\BitBucket: PurgeInfo (Binary)
  77.   PRbWin95PurgeInfo = ^TRbWin95PurgeInfo;
  78.   TRbWin95PurgeInfo = packed record
  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.
  98.