From 3cdd79d3d63d12c5042d57270a67cd55f5a5e69d Mon Sep 17 00:00:00 2001 From: Maximus5 Date: Sun, 17 Apr 2022 18:27:01 +0200 Subject: [PATCH] Internal. Stabilize tests Use limited FILE_READ_ATTRIBUTES to check if file exists --- src/common/WObjects.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/WObjects.cpp b/src/common/WObjects.cpp index f08fd4a28..fe3a964fb 100644 --- a/src/common/WObjects.cpp +++ b/src/common/WObjects.cpp @@ -74,7 +74,7 @@ bool FileExists(const wchar_t* asFilePath, uint64_t* pnSize /*= nullptr*/) MHandle hFile; MWow64Disable wow; - if (!hFile.SetHandle(CreateFileW(asFilePath, GENERIC_READ, FILE_SHARE_READ, + if (!hFile.SetHandle(CreateFileW(asFilePath, FILE_READ_ATTRIBUTES, FILE_SHARE_READ, nullptr, OPEN_EXISTING, 0, nullptr), CloseHandle)) { const DWORD nErrCode = GetLastError(); @@ -84,7 +84,7 @@ bool FileExists(const wchar_t* asFilePath, uint64_t* pnSize /*= nullptr*/) { wow.Disable(); - hFile.SetHandle(CreateFileW(asFilePath, GENERIC_READ, FILE_SHARE_READ, + hFile.SetHandle(CreateFileW(asFilePath, FILE_READ_ATTRIBUTES, FILE_SHARE_READ, nullptr, OPEN_EXISTING, 0, nullptr), CloseHandle); } #endif