Rev 77 | Rev 80 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 77 | Rev 78 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | //////////////////////////////////////////////////////////////////////////////////// |
3 | //////////////////////////////////////////////////////////////////////////////////// |
4 | // RECYCLE-BIN-UNIT V2 BY DANIEL MARSCHALL, VIATHINKSOFT // |
4 | // RECYCLE-BIN-UNIT V2 BY DANIEL MARSCHALL, VIATHINKSOFT // |
5 | // E-MAIL: info@daniel-marschall.de // |
5 | // E-MAIL: info@daniel-marschall.de // |
6 | // Web: www.daniel-marschall.de & www.viathinksoft.de // |
6 | // Web: www.daniel-marschall.de & www.viathinksoft.de // |
7 | //////////////////////////////////////////////////////////////////////////////////// |
7 | //////////////////////////////////////////////////////////////////////////////////// |
8 | // Revision: 03 JUL 2016 // |
8 | // Revision: 17 JUL 2016 // |
9 | // This unit is freeware, but please link to my website if you are using it! // |
9 | // This unit is freeware, but please link to my website if you are using it! // |
10 | //////////////////////////////////////////////////////////////////////////////////// |
10 | //////////////////////////////////////////////////////////////////////////////////// |
11 | // Successfully tested with: // |
11 | // Successfully tested with: // |
12 | // Windows 95b (without IE4 Shell Extensions) // |
12 | // Windows 95b (without IE4 Shell Extensions) // |
13 | // Windows 95b (with IE4 Shell Extensions) // |
13 | // Windows 95b (with IE4 Shell Extensions) // |
Line 25... | Line 25... | ||
25 | // - Remove "static" |
25 | // - Remove "static" |
26 | // - Remove "strict" |
26 | // - Remove "strict" |
27 | // - Remove "$REGION" |
27 | // - Remove "$REGION" |
28 | 28 | ||
29 | // TODO: ReadBuffer überall try-except |
29 | // TODO: ReadBuffer überall try-except |
30 | // TODO: Win7 : Drive GUIDs |
- | |
31 | // TODO: Win7 : Absolute vs. Relative size limitations |
- | |
32 | // TODO: Always check EOF before reading anything? |
30 | // TODO: Always check EOF before reading anything? |
33 | // TODO: Don't crash when timestamp is invalid. Do something else instead. |
31 | // TODO: Don't crash when timestamp is invalid. Do something else instead. |
34 | // TODO: Is it possible to identify a Vista-file that is not named $Ixxxxxx.ext? |
32 | // TODO: Is it possible to identify a Vista-file that is not named $Ixxxxxx.ext? |
35 | // TODO: RecyclerGetInfofiles() check additionally for removable device? |
33 | // TODO: RecyclerGetInfofiles() check additionally for removable device? |
36 | // RecyclerIsValid() is false. |
34 | // RecyclerIsValid() is false. |
Line 39... | Line 37... | ||
39 | // - How does Windows 9x/NT manage the daylight saving time (if it does)? |
37 | // - How does Windows 9x/NT manage the daylight saving time (if it does)? |
40 | // - How does Windows Vista+ react to a RECYCLER\ folder on a NTFS device? |
38 | // - How does Windows Vista+ react to a RECYCLER\ folder on a NTFS device? |
41 | // - How does Windows Vista+ react to a RECYCLED\ folder on a FAT device? ==> Win7: is ignored! |
39 | // - How does Windows Vista+ react to a RECYCLED\ folder on a FAT device? ==> Win7: is ignored! |
42 | // - How does Windows XP react to RECYCLED\ folder on a FAT device? |
40 | // - How does Windows XP react to RECYCLED\ folder on a FAT device? |
43 | // TODO: Translate all comments from German to English |
41 | // TODO: Translate all comments from German to English |
44 | // TODO: do we need this (maybe not all drives have A: till Z:?) http://stackoverflow.com/questions/17110543/how-to-retrieve-the-disk-signature-of-all-the-disks-in-windows-using-delphi-7 |
42 | // TODO: Do we need this (maybe not all drives have A: till Z:?) http://stackoverflow.com/questions/17110543/how-to-retrieve-the-disk-signature-of-all-the-disks-in-windows-using-delphi-7 |
- | 43 | // TODO: Add a lot of setters for system config stuff |
|
45 | 44 | ||
46 | // If enabled, the deletion timestamps will not be converted by the WinAPI. |
45 | // If enabled, the deletion timestamps will not be converted by the WinAPI. |
47 | {.$DEFINE FILETIME_DELPHI_CODE} |
46 | {.$DEFINE FILETIME_DELPHI_CODE} |
48 | 47 | ||
49 | // If a value is set in HKEY_LOCAL_MACHINE, it will be prefered, even if gpedit.msc shows "Not configured"! |
48 | // If a value is set in HKEY_LOCAL_MACHINE, it will be prefered, even if gpedit.msc shows "Not configured"! |
50 | {$DEFINE GroupPolicyAcceptHKLMTrick} |
49 | {$DEFINE GroupPolicyAcceptHKLMTrick} |
51 | 50 | ||
52 | interface |
51 | interface |
53 | 52 | ||
54 | uses |
53 | uses |
55 | Windows, SysUtils, Classes, ContNrs, ShellAPI, Registry, Messages; |
54 | Windows, SysUtils, Classes, ContNrs, ShellAPI, Registry, Messages, Math; |
56 | 55 | ||
57 | const |
56 | const |
58 | RECBINUNIT_VERSION = '2016-07-05'; |
57 | RECBINUNIT_VERSION = '2016-07-17'; |
59 | 58 | ||
60 | RECYCLER_CLSID: TGUID = '{645FF040-5081-101B-9F08-00AA002F954E}'; |
59 | RECYCLER_CLSID: TGUID = '{645FF040-5081-101B-9F08-00AA002F954E}'; |
61 | NULL_GUID: TGUID = '{00000000-0000-0000-0000-000000000000}'; |
60 | NULL_GUID: TGUID = '{00000000-0000-0000-0000-000000000000}'; |
62 | 61 | ||
63 | type |
62 | type |
Line 161... | Line 160... | ||
161 | // TODO: Wie sieht es aus mit Laufwerken, die nur als Mount-Point eingebunden sind? |
160 | // TODO: Wie sieht es aus mit Laufwerken, die nur als Mount-Point eingebunden sind? |
162 | TRbDrive = class(TObject) |
161 | TRbDrive = class(TObject) |
163 | strict private |
162 | strict private |
164 | FDriveLetter: Char; |
163 | FDriveLetter: Char; |
165 | 164 | ||
166 | // will return NULL_GUID in case of an error or if it is not supported |
165 | function OldCapacityPercent(var res: integer): boolean; // in % (0-100) |
- | 166 | function NewCapacityAbsolute(var res: integer): boolean; // in MB |
|
- | 167 | ||
167 | function GetVolumeGUID: TGUID; |
168 | function DiskSize: integer; // in MB |
168 | function GetVolumeGUIDAvailable: boolean; protected |
169 | function DriveNumber: integer; |
169 | strict protected |
170 | strict protected |
170 | function IsFAT: boolean; |
171 | function IsFAT: boolean; |
171 | procedure CheckDriveExisting; |
172 | procedure CheckDriveExisting; |
- | 173 | ||
- | 174 | // will return NULL_GUID in case of an error or if it is not supported |
|
- | 175 | function GetVolumeGUID: TGUID; |
|
- | 176 | function GetVolumeGUIDAvailable: boolean; |
|
- | 177 | ||
- | 178 | // TODO: get drive serial |
|
172 | public |
179 | public |
173 | constructor Create(ADriveLetter: Char); |
180 | constructor Create(ADriveLetter: Char); |
174 | 181 | ||
175 | // Wenn UserSID='', dann werden alle Recycler gefunden |
182 | // Wenn UserSID='', dann werden alle Recycler gefunden |
176 | procedure ListRecycleBins(list: TObjectList{TRbRecycleBin}; UserSID: string=''); |
183 | procedure ListRecycleBins(list: TObjectList{TRbRecycleBin}; UserSID: string=''); |
Line 181... | Line 188... | ||
181 | function GetAPIInfo: TSHQueryRBInfo; |
188 | function GetAPIInfo: TSHQueryRBInfo; |
182 | function GetSize: int64; |
189 | function GetSize: int64; |
183 | function GetNumItems: int64; |
190 | function GetNumItems: int64; |
184 | function IsEmpty: boolean; |
191 | function IsEmpty: boolean; |
185 | 192 | ||
186 | function GetMaxPercentUsage: integer; |
193 | function GetMaxPercentUsage: Extended; // 0..1 |
- | 194 | function GetMaxAbsoluteUsage: integer; // in MB |
|
187 | function GetNukeOnDelete: boolean; |
195 | function GetNukeOnDelete: boolean; |
188 | - | ||
189 | // These functions will check the global configuration and group policy, too. |
- | |
190 | function RecyclerGetPercentUsageAutoDeterminate: integer; |
- | |
191 | function RecyclerIsNukeOnDeleteAutoDeterminate: boolean; |
- | |
192 | end; |
196 | end; |
193 | 197 | ||
194 | GPOLICYBOOL = (gpUndefined, gpEnabled, gpDisabled); |
198 | GPOLICYBOOL = (gpUndefined, gpEnabled, gpDisabled); |
195 | 199 | ||
196 | TRecycleBinManager = class(TObject) |
200 | TRecycleBinManager = class(TObject) |
Line 935... | Line 939... | ||
935 | 939 | ||
936 | procedure TRbDrive.CheckDriveExisting; |
940 | procedure TRbDrive.CheckDriveExisting; |
937 | begin |
941 | begin |
938 | // Does the drive exist? |
942 | // Does the drive exist? |
939 | // see http://www.delphipraxis.net/post2933.html |
943 | // see http://www.delphipraxis.net/post2933.html |
940 | if not GetLogicalDrives and (1 shl DriveLetterToDriveNumber(FDriveLetter)) <> 0 then |
944 | if not GetLogicalDrives and (1 shl DriveNumber) <> 0 then |
941 | begin |
945 | begin |
942 | raise EInvalidDrive.CreateFmt(LNG_DRIVE_NOT_EXISTING, [UpperCase(FDriveLetter)+':']); |
946 | raise EInvalidDrive.CreateFmt(LNG_DRIVE_NOT_EXISTING, [UpperCase(FDriveLetter)+':']); |
943 | end; |
947 | end; |
944 | end; |
948 | end; |
945 | 949 | ||
Line 949... | Line 953... | ||
949 | 953 | ||
950 | FDriveLetter := ADriveLetter; |
954 | FDriveLetter := ADriveLetter; |
951 | CheckDriveExisting; |
955 | CheckDriveExisting; |
952 | end; |
956 | end; |
953 | 957 | ||
- | 958 | function TRbDrive.DiskSize: integer; |
|
- | 959 | begin |
|
- | 960 | result := SysUtils.DiskSize(DriveNumber+1 {0 is current, 1 is A}) div (1024*1024); |
|
- | 961 | end; |
|
- | 962 | ||
- | 963 | function TRbDrive.DriveNumber: integer; |
|
- | 964 | begin |
|
- | 965 | result := DriveLetterToDriveNumber(FDriveLetter); |
|
- | 966 | end; |
|
- | 967 | ||
954 | function TRbDrive.GetAPIInfo: TSHQueryRBInfo; |
968 | function TRbDrive.GetAPIInfo: TSHQueryRBInfo; |
955 | var |
969 | var |
956 | PSHQueryRecycleBin: TSHQueryRecycleBin; |
970 | PSHQueryRecycleBin: TSHQueryRecycleBin; |
957 | RBHandle: THandle; |
971 | RBHandle: THandle; |
958 | res: HRESULT; |
972 | res: HRESULT; |
Line 998... | Line 1012... | ||
998 | finally |
1012 | finally |
999 | if RBHandle <> 0 then FreeLibrary(RBHandle); |
1013 | if RBHandle <> 0 then FreeLibrary(RBHandle); |
1000 | end; |
1014 | end; |
1001 | end; |
1015 | end; |
1002 | 1016 | ||
1003 | function TRbDrive.GetMaxPercentUsage: integer; |
1017 | function TRbDrive.GetMaxPercentUsage: Extended; |
- | 1018 | var |
|
- | 1019 | abs: integer; // in MB |
|
- | 1020 | rel: integer; // in % (0-100) |
|
- | 1021 | gpSetting: integer; |
|
- | 1022 | const |
|
- | 1023 | DEFAULT_PERCENT = 10; // Windows 95 default |
|
- | 1024 | begin |
|
- | 1025 | gpSetting := TRecycleBinManager.RecyclerGroupPolicyRecycleBinSize; |
|
- | 1026 | if gpSetting <> -1 then |
|
- | 1027 | result := gpSetting / 100 |
|
- | 1028 | else if TRecycleBinManager.UsesGlobalSettings then |
|
- | 1029 | result := TRecycleBinManager.GetGlobalMaxPercentUsage / 100 |
|
- | 1030 | else if OldCapacityPercent(rel) then |
|
- | 1031 | begin |
|
- | 1032 | result := rel / 100; |
|
- | 1033 | end |
|
- | 1034 | else if NewCapacityAbsolute(abs) then |
|
- | 1035 | begin |
|
- | 1036 | result := abs / DiskSize; |
|
- | 1037 | end |
|
- | 1038 | else |
|
- | 1039 | begin |
|
- | 1040 | result := DEFAULT_PERCENT / 100; |
|
- | 1041 | end; |
|
- | 1042 | end; |
|
- | 1043 | ||
- | 1044 | function TRbDrive.GetMaxAbsoluteUsage: integer; |
|
- | 1045 | var |
|
- | 1046 | abs: integer; // in MB |
|
- | 1047 | rel: integer; // in % (0-100) |
|
- | 1048 | gpSetting: integer; |
|
- | 1049 | const |
|
- | 1050 | DEFAULT_PERCENT = 10; // Windows 95 default |
|
- | 1051 | begin |
|
- | 1052 | gpSetting := TRecycleBinManager.RecyclerGroupPolicyRecycleBinSize; |
|
- | 1053 | if gpSetting <> -1 then |
|
- | 1054 | result := Ceil(gpSetting/100 * DiskSize) |
|
- | 1055 | else if TRecycleBinManager.UsesGlobalSettings then |
|
- | 1056 | result := Ceil(TRecycleBinManager.GetGlobalMaxPercentUsage/100 * DiskSize) |
|
- | 1057 | else if NewCapacityAbsolute(abs) then |
|
- | 1058 | begin |
|
- | 1059 | result := abs; |
|
- | 1060 | end |
|
- | 1061 | else if OldCapacityPercent(rel) then |
|
- | 1062 | begin |
|
- | 1063 | result := Ceil(rel/100 * DiskSize); |
|
- | 1064 | end |
|
- | 1065 | else |
|
- | 1066 | begin |
|
- | 1067 | result := Ceil(DEFAULT_PERCENT/100 * DiskSize); |
|
- | 1068 | end; |
|
- | 1069 | end; |
|
- | 1070 | ||
- | 1071 | function TRbDrive.OldCapacityPercent(var res: integer): boolean; |
|
1004 | var |
1072 | var |
1005 | reg: TRegistry; |
1073 | reg: TRegistry; |
1006 | purgeInfo: TRbWin95PurgeInfo; |
1074 | purgeInfo: TRbWin95PurgeInfo; |
1007 | const |
- | |
1008 | RES_DEFAULT = 10; // Windows 95 - Standardwert |
- | |
1009 | begin |
1075 | begin |
- | 1076 | if Win32MajorVersion >= 6 then |
|
- | 1077 | begin |
|
- | 1078 | // Only available till Windows XP |
|
- | 1079 | result := false; |
|
- | 1080 | exit; |
|
- | 1081 | end; |
|
- | 1082 | ||
1010 | result := RES_DEFAULT; |
1083 | result := false; |
1011 | 1084 | ||
1012 | reg := TRegistry.Create; |
1085 | reg := TRegistry.Create; |
1013 | try |
1086 | try |
1014 | reg.RootKey := HKEY_LOCAL_MACHINE; |
1087 | reg.RootKey := HKEY_LOCAL_MACHINE; |
1015 | 1088 | ||
Line 1021... | Line 1094... | ||
1021 | begin |
1094 | begin |
1022 | if reg.ValueExists('Percent') then |
1095 | if reg.ValueExists('Percent') then |
1023 | begin |
1096 | begin |
1024 | // Windows 2000 - Informationen liegen aufgeschlüsselt in der Registry |
1097 | // Windows 2000 - Informationen liegen aufgeschlüsselt in der Registry |
1025 | 1098 | ||
1026 | result := reg.ReadInteger('Percent'); |
1099 | res := reg.ReadInteger('Percent'); |
- | 1100 | result := true; |
|
1027 | end; |
1101 | end; |
1028 | end |
1102 | end |
1029 | else |
1103 | else |
1030 | begin |
1104 | begin |
1031 | if reg.ValueExists('PurgeInfo') then |
1105 | if reg.ValueExists('PurgeInfo') then |
1032 | begin |
1106 | begin |
1033 | // Windows 95 - Kodierte Informationen liegen in PurgeInfo |
1107 | // Windows 95 - Kodierte Informationen liegen in PurgeInfo |
1034 | 1108 | ||
1035 | reg.ReadBinaryData('PurgeInfo', purgeInfo, SizeOf(purgeInfo)); |
1109 | reg.ReadBinaryData('PurgeInfo', purgeInfo, SizeOf(purgeInfo)); |
1036 | 1110 | ||
1037 | result := purgeInfo.percentDrive[FDriveLetter]; |
1111 | res := purgeInfo.percentDrive[FDriveLetter]; |
- | 1112 | result := true; |
|
1038 | end; |
1113 | end; |
1039 | end; |
1114 | end; |
1040 | 1115 | ||
1041 | reg.CloseKey; |
1116 | reg.CloseKey; |
1042 | end; |
1117 | end; |
1043 | finally |
1118 | finally |
1044 | reg.Free; |
1119 | reg.Free; |
1045 | end; |
1120 | end; |
1046 | end; |
1121 | end; |
1047 | 1122 | ||
1048 | function TRbDrive.RecyclerGetPercentUsageAutoDeterminate: integer; |
1123 | function TRbDrive.NewCapacityAbsolute(var res: integer): boolean; |
1049 | var |
1124 | var |
1050 | gpSetting: integer; |
1125 | reg: TRegistry; |
1051 | begin |
1126 | begin |
1052 | gpSetting := TRecycleBinManager.RecyclerGroupPolicyRecycleBinSize; |
- | |
1053 | if gpSetting <> -1 then |
1127 | if Win32MajorVersion < 6 then |
1054 | result := gpSetting |
1128 | begin |
1055 | else if TRecycleBinManager.UsesGlobalSettings then |
1129 | // Only available since Windows Vista |
1056 | result := TRecycleBinManager.GetGlobalMaxPercentUsage |
1130 | result := false; |
1057 | else |
1131 | exit; |
1058 | result := GetMaxPercentUsage; |
- | |
1059 | end; |
1132 | end; |
1060 | 1133 | ||
- | 1134 | result := false; |
|
- | 1135 | ||
- | 1136 | reg := TRegistry.Create; |
|
- | 1137 | try |
|
- | 1138 | reg.RootKey := HKEY_CURRENT_USER; |
|
- | 1139 | ||
1061 | function TRbDrive.RecyclerIsNukeOnDeleteAutoDeterminate: boolean; |
1140 | if reg.OpenKeyReadOnly('Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume') then |
1062 | begin |
1141 | begin |
- | 1142 | // Windows Vista and upwards |
|
1063 | if TRecycleBinManager.RecyclerGroupPolicyNoRecycleFiles = gpEnabled then |
1143 | if reg.OpenKeyReadOnly(GUIDToString(VolumeGUID)) then |
1064 | result := true |
1144 | begin |
1065 | else if TRecycleBinManager.UsesGlobalSettings then |
1145 | res := reg.ReadInteger('MaxCapacity'); // in MB |
1066 | result := TRecycleBinManager.GetGlobalNukeOnDelete |
1146 | result := true; |
- | 1147 | end; |
|
- | 1148 | reg.CloseKey; |
|
1067 | else |
1149 | end; |
- | 1150 | finally |
|
1068 | result := GetNukeOnDelete; |
1151 | reg.Free; |
- | 1152 | end; |
|
1069 | end; |
1153 | end; |
1070 | 1154 | ||
1071 | function TRbDrive.GetNukeOnDelete: boolean; |
1155 | function TRbDrive.GetNukeOnDelete: boolean; |
1072 | var |
1156 | var |
1073 | reg: TRegistry; |
1157 | reg: TRegistry; |
1074 | purgeInfo: TRbWin95PurgeInfo; |
1158 | purgeInfo: TRbWin95PurgeInfo; |
1075 | const |
1159 | const |
1076 | RES_DEFAULT = false; // Windows 95 - Standardwert |
1160 | RES_DEFAULT = false; // Windows 95 default |
- | 1161 | begin |
|
- | 1162 | if TRecycleBinManager.RecyclerGroupPolicyNoRecycleFiles = gpEnabled then |
|
- | 1163 | result := true |
|
- | 1164 | else if TRecycleBinManager.UsesGlobalSettings then |
|
- | 1165 | result := TRecycleBinManager.GetGlobalNukeOnDelete |
|
- | 1166 | else |
|
1077 | begin |
1167 | begin |
1078 | result := RES_DEFAULT; |
1168 | result := RES_DEFAULT; |
1079 | 1169 | ||
1080 | reg := TRegistry.Create; |
1170 | reg := TRegistry.Create; |
1081 | try |
1171 | try |
- | 1172 | reg.RootKey := HKEY_CURRENT_USER; |
|
- | 1173 | ||
- | 1174 | if reg.OpenKeyReadOnly('Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume') then |
|
- | 1175 | begin |
|
- | 1176 | // Windows Vista and upwards |
|
- | 1177 | if reg.OpenKeyReadOnly(GUIDToString(VolumeGUID)) then |
|
- | 1178 | begin |
|
- | 1179 | result := reg.ReadBool('NukeOnDelete'); |
|
- | 1180 | end; |
|
- | 1181 | reg.CloseKey; |
|
- | 1182 | end |
|
- | 1183 | else |
|
- | 1184 | begin |
|
1082 | reg.RootKey := HKEY_LOCAL_MACHINE; |
1185 | reg.RootKey := HKEY_LOCAL_MACHINE; |
1083 | 1186 | ||
1084 | // Im Auslieferungszustand von Windows 95 ist dieser Schlüssel nicht vorhanden. |
1187 | // Im Auslieferungszustand von Windows 95 ist dieser Schlüssel nicht vorhanden. |
1085 | // Er wird bei der ersten Änderung der Papierkorb-Einstellungen erstellt. |
1188 | // Er wird bei der ersten Änderung der Papierkorb-Einstellungen erstellt. |
1086 | if reg.OpenKeyReadOnly('SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\BitBucket') then |
1189 | if reg.OpenKeyReadOnly('SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\BitBucket') then |
Line 1100... | Line 1203... | ||
1100 | begin |
1203 | begin |
1101 | // Windows 95 - Kodierte Informationen liegen in PurgeInfo |
1204 | // Windows 95 - Kodierte Informationen liegen in PurgeInfo |
1102 | 1205 | ||
1103 | reg.ReadBinaryData('PurgeInfo', purgeInfo, SizeOf(purgeInfo)); |
1206 | reg.ReadBinaryData('PurgeInfo', purgeInfo, SizeOf(purgeInfo)); |
1104 | 1207 | ||
1105 | result := ((purgeInfo.NukeOnDeleteBits shr DriveLetterToDriveNumber(FDriveLetter)) and 1) = 1; |
1208 | result := ((purgeInfo.NukeOnDeleteBits shr DriveNumber) and 1) = 1; |
1106 | end; |
1209 | end; |
1107 | end; |
1210 | end; |
1108 | 1211 | ||
1109 | reg.CloseKey; |
1212 | reg.CloseKey; |
1110 | end; |
1213 | end; |
- | 1214 | end; |
|
1111 | finally |
1215 | finally |
1112 | reg.Free; |
1216 | reg.Free; |
1113 | end; |
1217 | end; |
1114 | end; |
1218 | end; |
- | 1219 | end; |
|
1115 | 1220 | ||
1116 | function TRbDrive.GetNumItems: int64; |
1221 | function TRbDrive.GetNumItems: int64; |
1117 | begin |
1222 | begin |
1118 | result := GetAPIInfo.i64NumItems; |
1223 | result := GetAPIInfo.i64NumItems; |
1119 | end; |
1224 | end; |
Line 1488... | Line 1593... | ||
1488 | reg: TRegistry; |
1593 | reg: TRegistry; |
1489 | purgeInfo: TRbWin95PurgeInfo; |
1594 | purgeInfo: TRbWin95PurgeInfo; |
1490 | const |
1595 | const |
1491 | RES_DEFAULT = 10; // Windows 95 - Standardwert |
1596 | RES_DEFAULT = 10; // Windows 95 - Standardwert |
1492 | begin |
1597 | begin |
- | 1598 | if Win32MajorVersion >= 6 then |
|
- | 1599 | begin |
|
- | 1600 | // Only available till Windows XP |
|
- | 1601 | result := -1; |
|
- | 1602 | exit; |
|
- | 1603 | end; |
|
- | 1604 | ||
1493 | result := RES_DEFAULT; |
1605 | result := RES_DEFAULT; |
1494 | 1606 | ||
1495 | reg := TRegistry.Create; |
1607 | reg := TRegistry.Create; |
1496 | try |
1608 | try |
1497 | reg.RootKey := HKEY_LOCAL_MACHINE; |
1609 | reg.RootKey := HKEY_LOCAL_MACHINE; |
Line 1526... | Line 1638... | ||
1526 | reg: TRegistry; |
1638 | reg: TRegistry; |
1527 | purgeInfo: TRbWin95PurgeInfo; |
1639 | purgeInfo: TRbWin95PurgeInfo; |
1528 | const |
1640 | const |
1529 | RES_DEFAULT = false; // Windows 95 - Standardwert |
1641 | RES_DEFAULT = false; // Windows 95 - Standardwert |
1530 | begin |
1642 | begin |
- | 1643 | if Win32MajorVersion >= 6 then |
|
- | 1644 | begin |
|
- | 1645 | // Only available till Windows XP |
|
- | 1646 | result := false; |
|
- | 1647 | exit; |
|
- | 1648 | end; |
|
- | 1649 | ||
1531 | result := RES_DEFAULT; |
1650 | result := RES_DEFAULT; |
1532 | 1651 | ||
1533 | reg := TRegistry.Create; |
1652 | reg := TRegistry.Create; |
1534 | try |
1653 | try |
1535 | reg.RootKey := HKEY_LOCAL_MACHINE; |
1654 | reg.RootKey := HKEY_LOCAL_MACHINE; |
Line 1573... | Line 1692... | ||
1573 | reg: TRegistry; |
1692 | reg: TRegistry; |
1574 | purgeInfo: TRbWin95PurgeInfo; |
1693 | purgeInfo: TRbWin95PurgeInfo; |
1575 | const |
1694 | const |
1576 | RES_DEFAULT = true; // Windows 95 - Standardwert |
1695 | RES_DEFAULT = true; // Windows 95 - Standardwert |
1577 | begin |
1696 | begin |
- | 1697 | if Win32MajorVersion >= 6 then |
|
- | 1698 | begin |
|
- | 1699 | // Only available till Windows XP |
|
- | 1700 | result := false; |
|
- | 1701 | exit; |
|
- | 1702 | end; |
|
- | 1703 | ||
1578 | result := RES_DEFAULT; |
1704 | result := RES_DEFAULT; |
1579 | 1705 | ||
1580 | reg := TRegistry.Create; |
1706 | reg := TRegistry.Create; |
1581 | try |
1707 | try |
1582 | reg.RootKey := HKEY_LOCAL_MACHINE; |
1708 | reg.RootKey := HKEY_LOCAL_MACHINE; |