From a73db6fc4789e96782daee145d0d8ee6111e6ab1 Mon Sep 17 00:00:00 2001 From: Berserker Date: Wed, 29 May 2019 16:40:51 +0300 Subject: [PATCH] Replaced HasFlag with new flag helper routines --- Vfs.dproj | 6 +----- Vfs.res | Bin 5160 -> 5160 bytes VfsBase.pas | 2 +- VfsControl.pas | 4 ++-- VfsHooks.pas | 4 ++-- VfsUtils.pas | 2 +- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Vfs.dproj b/Vfs.dproj index 2de826e..e6e9842 100644 --- a/Vfs.dproj +++ b/Vfs.dproj @@ -30,11 +30,7 @@ Delphi.Personality VCLApplication -FalseTrueFalseTrueTrue1020FalseFalseFalseFalseFalse10491251Alexander Shostak (aka EtherniDee)Virtual File System1.0.2.01.0.0.0Vfs.dpr - - - - +FalseTrueFalseTrueTrue1024FalseFalseFalseFalseFalse10491251Alexander Shostak (aka EtherniDee)Virtual File System1.0.2.41.0.0.0Vfs.dpr Microsoft Office 2000 Sample Automation Server Wrapper Components diff --git a/Vfs.res b/Vfs.res index 44bbf33974009fe5aefde56dd2bcbee316fff61a..43bf0487c0b3a2f6ad7693cb9d46b94c16fe8cce 100644 GIT binary patch delta 29 kcmZ3Xu|i`*gCHjh0}}%S10w^==1xI-Mn;p(Cxzk}0cVZ|rT_o{ delta 29 kcmZ3Xu|i`*gCHjZ0}}%S10w^&=1xI-Mn;3pCxzk}0cP$7ng9R* diff --git a/VfsBase.pas b/VfsBase.pas index a922ffc..5de8b1c 100644 --- a/VfsBase.pas +++ b/VfsBase.pas @@ -577,7 +577,7 @@ begin with SysScanDir(AbsRealPath, '*') do begin while IterNext(FileInfo.FileName, @FileInfo.Base) do begin - if Utils.HasFlag(Windows.FILE_ATTRIBUTE_DIRECTORY, FileInfo.Base.FileAttributes) then begin + if Utils.Flags(FileInfo.Base.FileAttributes).Have(Windows.FILE_ATTRIBUTE_DIRECTORY) then begin if (FileInfo.FileName <> '.') and (FileInfo.FileName <> '..') then begin Subdirs.Add(TFileInfo.Create(@FileInfo)); end; diff --git a/VfsControl.pas b/VfsControl.pas index 6b83f5d..7e98eb7 100644 --- a/VfsControl.pas +++ b/VfsControl.pas @@ -149,8 +149,8 @@ begin AbsRootDir := VfsUtils.NormalizePath(RootDir); AbsModsDir := VfsUtils.NormalizePath(ModsDir); result := (AbsRootDir <> '') and (AbsModsDir <> '') and - VfsUtils.GetFileInfo(AbsRootDir, FileInfo) and Utils.HasFlag(Windows.FILE_ATTRIBUTE_DIRECTORY, FileInfo.Base.FileAttributes) and - VfsUtils.GetFileInfo(AbsModsDir, FileInfo) and Utils.HasFlag(Windows.FILE_ATTRIBUTE_DIRECTORY, FileInfo.Base.FileAttributes); + VfsUtils.GetFileInfo(AbsRootDir, FileInfo) and Utils.Flags(FileInfo.Base.FileAttributes).Have(Windows.FILE_ATTRIBUTE_DIRECTORY) and + VfsUtils.GetFileInfo(AbsModsDir, FileInfo) and Utils.Flags(FileInfo.Base.FileAttributes).Have(Windows.FILE_ATTRIBUTE_DIRECTORY); if result then begin ModPathPrefix := VfsUtils.AddBackslash(AbsModsDir); diff --git a/VfsHooks.pas b/VfsHooks.pas index 44a8a66..2c47110 100644 --- a/VfsHooks.pas +++ b/VfsHooks.pas @@ -111,7 +111,7 @@ begin // Return cached VFS file info if RedirectedPath <> '' then begin - if not HadTrailingDelim or Utils.HasFlag(FILE_ATTRIBUTE_DIRECTORY, FileInfo.Base.FileAttributes) then begin + if not HadTrailingDelim or Utils.Flags(FileInfo.Base.FileAttributes).Have(FILE_ATTRIBUTE_DIRECTORY) then begin FileInformation.CreationTime := FileInfo.Base.CreationTime; FileInformation.LastAccessTime := FileInfo.Base.LastAccessTime; FileInformation.LastWriteTime := FileInfo.Base.LastWriteTime; @@ -171,7 +171,7 @@ begin // Return cached VFS file info if RedirectedPath <> '' then begin - if not HadTrailingDelim or Utils.HasFlag(FILE_ATTRIBUTE_DIRECTORY, FileInfo.Base.FileAttributes) then begin + if not HadTrailingDelim or Utils.Flags(FileInfo.Base.FileAttributes).Have(FILE_ATTRIBUTE_DIRECTORY) then begin FileInformation.CreationTime := FileInfo.Base.CreationTime; FileInformation.LastAccessTime := FileInfo.Base.LastAccessTime; FileInformation.LastWriteTime := FileInfo.Base.LastWriteTime; diff --git a/VfsUtils.pas b/VfsUtils.pas index fd809e5..c78ff2c 100644 --- a/VfsUtils.pas +++ b/VfsUtils.pas @@ -506,7 +506,7 @@ var FileAttrs: integer; begin - result := GetFileAttrs(Path, FileAttrs) and Utils.HasFlag(Windows.FILE_ATTRIBUTE_DIRECTORY, FileAttrs); + result := GetFileAttrs(Path, FileAttrs) and Utils.Flags(FileAttrs).Have(Windows.FILE_ATTRIBUTE_DIRECTORY); end; function SysOpenFile (const NtAbsPath: WideString; {OUT} var Res: Windows.THandle; const OpenMode: TSysOpenFileMode = OPEN_AS_ANY; const AccessMode: ACCESS_MASK = FILE_GENERIC_READ): boolean;