Subversion Repositories recyclebinunit

Compare Revisions

Regard whitespace Rev 92 → Rev 93

/trunk/Recycle Bin Unit/Changelog.txt
11,6 → 11,7
+ Added XP Theme to the demo application
+ Unicode Ready
+ 64 bit Ready
+ Fixed RecyclerGetAPIInfo issue in for 64 bit (TSHQueryRBInfo struct had to be 8 byte aligned for x64)
 
2016-07-01 (current version)
+ RecyclerRemoveItem() does now correctly delete directories.
/trunk/Recycle Bin Unit/Recycler64.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/Recycle Bin Unit v2/Changelog.txt
10,6 → 10,7
+ Demo application: Feature to open a file or directory by double-clicking!
+ Unicode Ready
+ 64 bit Ready
+ Fixed TRbDrive.GetAPIInfo issue in for 64 bit (TSHQueryRBInfo struct had to be 8 byte aligned for x64)
 
2016-11-01
+ Fixed memory leak in SID-Unit (thanks to Mikkao for finding this bug)
/trunk/Recycle Bin Unit v2/RecBinUnit2.pas
66,7 → 66,12
EInvalidDrive = class(Exception);
 
PSHQueryRBInfo = ^TSHQueryRBInfo;
{$IFDEF WIN64}
// ATTENTION! MUST NOT BE PACKED! Alignment for 64 bit must be 8 and for 32 bit must be 4
TSHQueryRBInfo = record
{$ELSE}
TSHQueryRBInfo = packed record
{$ENDIF}
cbSize : DWORD;
i64Size : int64;
i64NumItems : int64;
356,16 → 361,22
LNG_DRIVE_NOT_EXISTING = 'Drive %s does not exist.';
 
const
{$IFDEF UNICODE}
C_SHEmptyRecycleBin = 'SHEmptyRecycleBinW';
C_SHQueryRecycleBin = 'SHQueryRecycleBinW';
C_GetVolumeNameForVolumeMountPoint = 'GetVolumeNameForVolumeMountPointW';
{$ELSE}
C_SHEmptyRecycleBin = 'SHEmptyRecycleBinA';
C_SHQueryRecycleBin = 'SHQueryRecycleBinA';
C_GetVolumeNameForVolumeMountPoint = 'GetVolumeNameForVolumeMountPointA';
C_SHEmptyRecycleBinA = 'SHEmptyRecycleBinA';
{$ENDIF}
C_SHGetSettings = 'SHGetSettings';
C_SHGetSetSettings = 'SHGetSetSettings';
 
type
TSHQueryRecycleBin = function(pszRootPath: LPCTSTR; var pSHQueryRBInfo: TSHQueryRBInfo): HRESULT; stdcall;
TGetVolumeNameForVolumeMountPointA = function(lpszVolumeMountPoint: LPCSTR; lpszVolumeName: LPSTR; cchBufferLength: DWORD): BOOL; stdcall;
TSHEmptyRecycleBin = function(Wnd: HWND; pszRootPath: PChar; dwFlags: DWORD): HRESULT; stdcall;
TGetVolumeNameForVolumeMountPoint = function(lpszVolumeMountPoint: LPCTSTR; lpszVolumeName: LPTSTR; cchBufferLength: DWORD): BOOL; stdcall;
TSHEmptyRecycleBin = function(Wnd: HWND; pszRootPath: LPCTSTR; dwFlags: DWORD): HRESULT; stdcall;
TSHGetSettings = procedure(var lpss: SHELLSTATE; dwMask: DWORD); stdcall;
TSHGetSetSettings = procedure(var lpss: SHELLSTATE; dwMask: DWORD; bSet: BOOL); stdcall;
 
404,9 → 415,9
 
function GetDriveGUID(driveLetter: AnsiChar; var guid: TGUID): DWORD;
var
Buffer: array[0..50] of AnsiChar;
Buffer: array[0..50] of Char;
x: string;
PGetVolumeNameForVolumeMountPointA: TGetVolumeNameForVolumeMountPointA;
PGetVolumeNameForVolumeMountPoint: TGetVolumeNameForVolumeMountPoint;
RBHandle: THandle;
begin
RBHandle := LoadLibrary(kernel32);
413,8 → 424,8
try
if RBHandle <> 0 then
begin
PGetVolumeNameForVolumeMountPointA := GetProcAddress(RBHandle, C_GetVolumeNameForVolumeMountPoint);
if not Assigned(@PGetVolumeNameForVolumeMountPointA) then
PGetVolumeNameForVolumeMountPoint := GetProcAddress(RBHandle, C_GetVolumeNameForVolumeMountPoint);
if not Assigned(@PGetVolumeNameForVolumeMountPoint) then
begin
result := GetLastError;
FreeLibrary(RBHandle);
422,7 → 433,7
end
else
begin
if PGetVolumeNameForVolumeMountPointA(PAnsiChar(AnsiString(driveLetter+':\')), Buffer, SizeOf(Buffer)) then
if PGetVolumeNameForVolumeMountPoint(PChar(driveLetter+':\'), Buffer, SizeOf(Buffer)) then
begin
x := string(buffer);
x := copy(x, 11, 38);
1620,7 → 1631,7
try
if LibHandle <> 0 then
begin
@PSHEmptyRecycleBin := GetProcAddress(LibHandle, C_SHEmptyRecycleBinA);
@PSHEmptyRecycleBin := GetProcAddress(LibHandle, C_SHEmptyRecycleBin);
if @PSHEmptyRecycleBin <> nil then
begin
PSHEmptyRecycleBin(hInstance, nil, flags);