Skip to content

Commit

Permalink
Internal. Stabilize tests
Browse files Browse the repository at this point in the history
Use limited FILE_READ_ATTRIBUTES to check if file exists
  • Loading branch information
Maximus5 committed Apr 17, 2022
1 parent 8ec9769 commit 3cdd79d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/WObjects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
Expand Down

0 comments on commit 3cdd79d

Please sign in to comment.