mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Access denied checking (fixes #1725)
(cherry picked from commit a0a9221472)
This commit is contained in:
parent
68107f6e08
commit
638fa8a748
2 changed files with 14 additions and 1 deletions
|
|
@ -324,7 +324,7 @@ begin
|
|||
with aFileView do
|
||||
CurrentPath := CurrentPath + IncludeTrailingPathDelimiter(aFile.Name);
|
||||
end
|
||||
else if ElevationRequired(LastError) then
|
||||
else if AccessDenied(LastError) then
|
||||
begin
|
||||
sPath:= ReadSymLink(aFile.FullPath);
|
||||
if sPath <> EmptyStr then
|
||||
|
|
|
|||
|
|
@ -166,6 +166,8 @@ function mbFileNameToSysEnc(const LongPath: String): String;
|
|||
}
|
||||
function mbFileNameToNative(const FileName: String): NativeString; inline;
|
||||
|
||||
function AccessDenied(LastError: Integer): Boolean; inline;
|
||||
|
||||
procedure FixFormIcon(Handle: LCLType.HWND);
|
||||
procedure HideConsoleWindow;
|
||||
procedure FixDateNamesToUTF8;
|
||||
|
|
@ -756,6 +758,17 @@ begin
|
|||
end;
|
||||
{$ENDIF}
|
||||
|
||||
function AccessDenied(LastError: Integer): Boolean;
|
||||
{$IF DEFINED(MSWINDOWS)}
|
||||
begin
|
||||
Result:= (LastError = ERROR_ACCESS_DENIED);
|
||||
end;
|
||||
{$ELSE}
|
||||
begin
|
||||
Result:= (LastError = ESysEPERM) or (LastError = ESysEACCES);
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
procedure FixFormIcon(Handle: LCLType.HWND);
|
||||
begin
|
||||
// Workaround for Lazarus issue 0018484.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue