mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Error in mbFileAccess under Windows
This commit is contained in:
parent
a833efa703
commit
e7ff98a585
1 changed files with 9 additions and 2 deletions
11
uOSUtils.pas
11
uOSUtils.pas
|
|
@ -918,11 +918,18 @@ const
|
|||
GENERIC_WRITE,
|
||||
GENERIC_READ or GENERIC_WRITE);
|
||||
var
|
||||
hFile: THandle;
|
||||
wFileName: WideString;
|
||||
begin
|
||||
Result:= False;
|
||||
wFileName:= UTF8Decode(FileName);
|
||||
Result:= CreateFileW(PWChar(wFileName), AccessMode[Mode and 3],
|
||||
0, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) <> 0;
|
||||
hFile:= CreateFileW(PWChar(wFileName), AccessMode[Mode and 3],
|
||||
0, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
if hFile <> 0 then
|
||||
begin
|
||||
Result:= True;
|
||||
FileClose(hFile);
|
||||
end;
|
||||
end;
|
||||
{$ELSE}
|
||||
const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue