Rev 28 | Rev 67 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 28 | Rev 30 | ||
---|---|---|---|
Line 369... | Line 369... | ||
369 | 369 | ||
370 | // ********************************************************** |
370 | // ********************************************************** |
371 | // INTERNALLY USED FUNCTIONS |
371 | // INTERNALLY USED FUNCTIONS |
372 | // ********************************************************** |
372 | // ********************************************************** |
373 | 373 | ||
374 | type |
- | |
375 | TNibble = $0..$F; |
- | |
376 | TBitPos = 0..7; |
- | |
377 | - | ||
378 | resourcestring |
374 | resourcestring |
379 | LNG_UNEXPECTED_STATE = 'Cannot determinate state of "%s" because of an unknown value in the configuration of your operation system. Please contact the developer of the Recycler Bin Unit and help improving the determination methods!'; |
375 | LNG_UNEXPECTED_STATE = 'Cannot determinate state of "%s" because of an unknown value in the configuration of your operation system. Please contact the developer of the Recycler Bin Unit and help improving the determination methods!'; |
380 | LNG_API_CALL_ERROR = 'Error while calling the API. Additional information: "%s".'; |
376 | LNG_API_CALL_ERROR = 'Error while calling the API. Additional information: "%s".'; |
381 | LNG_NOT_CALLABLE = '%s not callable'; |
377 | LNG_NOT_CALLABLE = '%s not callable'; |
382 | LNG_ERROR_CODE = '%s (Arguments: %s) returns error code %s'; |
378 | LNG_ERROR_CODE = '%s (Arguments: %s) returns error code %s'; |
383 | 379 | ||
384 | function FileSize(FileName: string): int64; |
380 | function _FileSize(FileName: string): int64; |
385 | var |
381 | var |
386 | fs: TFileStream; |
382 | fs: TFileStream; |
387 | begin |
383 | begin |
388 | fs := TFileStream.Create(FileName, fmOpenRead); |
384 | fs := TFileStream.Create(FileName, fmOpenRead); |
389 | try |
385 | try |
Line 418... | Line 414... | ||
418 | begin |
414 | begin |
419 | result := result + chr(buf[i]); |
415 | result := result + chr(buf[i]); |
420 | end; |
416 | end; |
421 | end; |
417 | end; |
422 | 418 | ||
423 | function _LowerNibble(B: Byte): TNibble; |
- | |
424 | begin |
- | |
425 | result := B and 15 {00001111}; |
- | |
426 | end; |
- | |
427 | - | ||
428 | (* function _UpperNibble(B: Byte): TNibble; |
- | |
429 | begin |
- | |
430 | result := B and 240 {11110000}; |
- | |
431 | end; |
- | |
432 | - | ||
433 | function _MakeByte(UpperNibble, LowerNibble: TNibble): Byte; |
- | |
434 | begin |
- | |
435 | result := LowerNibble + UpperNibble * $10; |
- | |
436 | end; *) |
- | |
437 | - | ||
438 | function _GetStringFromDLL(filename: string; num: integer): string; |
419 | function _GetStringFromDLL(filename: string; num: integer): string; |
439 | const |
420 | const |
440 | // http://www.eggheadcafe.com/forumarchives/vcmfc/sep2005/post23917443.asp |
421 | // http://www.eggheadcafe.com/forumarchives/vcmfc/sep2005/post23917443.asp |
441 | MAX_BUF = 4097; // OK? |
422 | MAX_BUF = 4097; // OK? |
442 | var |
423 | var |
Line 972... | Line 953... | ||
972 | tmp := infofile; |
953 | tmp := infofile; |
973 | tmp := _VistaChangeRealfileToIndexfile(tmp); |
954 | tmp := _VistaChangeRealfileToIndexfile(tmp); |
974 | if not fileexists(tmp) then exit; |
955 | if not fileexists(tmp) then exit; |
975 | 956 | ||
976 | // Check the file length |
957 | // Check the file length |
977 | result := FileSize(tmp) = vista_valid_index_size; |
958 | result := _FileSize(tmp) = vista_valid_index_size; |
978 | end; |
959 | end; |
979 | 960 | ||
980 | // ********************************************************** |
961 | // ********************************************************** |
981 | // PUBLIC FUNCTIONS |
962 | // PUBLIC FUNCTIONS |
982 | // ********************************************************** |
963 | // ********************************************************** |
Line 2147... | Line 2128... | ||
2147 | ZeroMemory(@rbuf, SizeOf(rbuf)); |
2128 | ZeroMemory(@rbuf, SizeOf(rbuf)); |
2148 | reg.ReadBinaryData('ShellState', rbuf, SizeOf(rbuf)); |
2129 | reg.ReadBinaryData('ShellState', rbuf, SizeOf(rbuf)); |
2149 | 2130 | ||
2150 | // Lese 3tes Bit vom 5ten Byte |
2131 | // Lese 3tes Bit vom 5ten Byte |
2151 | // bNoConfirmRecycle := ((rbuf[4] and 4) = 4); |
2132 | // bNoConfirmRecycle := ((rbuf[4] and 4) = 4); |
2152 | bNoConfirmRecycle := GetByteBit(ord(rbuf[4]), 2); |
2133 | bNoConfirmRecycle := GetByteBit(rbuf[4], 2); |
2153 | result := not bNoConfirmRecycle; |
2134 | result := not bNoConfirmRecycle; |
2154 | 2135 | ||
2155 | reg.CloseKey; |
2136 | reg.CloseKey; |
2156 | end |
2137 | end |
2157 | else |
2138 | else |
Line 2598... | Line 2579... | ||
2598 | // Windows 95 - Verschlüsselte Informationen liegen in PurgeInfo |
2579 | // Windows 95 - Verschlüsselte Informationen liegen in PurgeInfo |
2599 | 2580 | ||
2600 | // See comment at RecyclerSpecificIsNukeOnDelete() |
2581 | // See comment at RecyclerSpecificIsNukeOnDelete() |
2601 | 2582 | ||
2602 | dump := _registryReadDump(reg, 'PurgeInfo'); |
2583 | dump := _registryReadDump(reg, 'PurgeInfo'); |
2603 | result := GetByteBit(Ord(dump[68]), 3); |
2584 | result := GetAnsiCharBit(dump[68], 3); |
2604 | end |
2585 | end |
2605 | else |
2586 | else |
2606 | begin |
2587 | begin |
2607 | // Windows 95 - Standardwerte sind gegeben, deswegen existiert kein PurgeInfo |
2588 | // Windows 95 - Standardwerte sind gegeben, deswegen existiert kein PurgeInfo |
2608 | 2589 | ||
Line 2663... | Line 2644... | ||
2663 | // Already validated: |
2644 | // Already validated: |
2664 | // 0x64 = 04 (00000100) |
2645 | // 0x64 = 04 (00000100) |
2665 | // 0x67 = 08 (00001000) |
2646 | // 0x67 = 08 (00001000) |
2666 | 2647 | ||
2667 | d := _DriveNum(Drive); |
2648 | d := _DriveNum(Drive); |
2668 | result := GetByteBit(Ord(dump[65+(d div 7)]), d mod 7); |
2649 | result := GetAnsiCharBit(dump[65+(d div 7)], d mod 7); |
2669 | end |
2650 | end |
2670 | else |
2651 | else |
2671 | begin |
2652 | begin |
2672 | // Windows 95 - Standardwerte sind gegeben, deswegen existiert kein PurgeInfo |
2653 | // Windows 95 - Standardwerte sind gegeben, deswegen existiert kein PurgeInfo |
2673 | 2654 |