Win32 FS: Always use FILE_SHARE_DELETE

This commit is contained in:
Eladash 2020-09-12 07:13:11 +03:00 committed by Ivan
parent d0f1b29b39
commit 6b11d82dd0

View File

@ -967,7 +967,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
disp = mode & fs::trunc ? TRUNCATE_EXISTING : OPEN_EXISTING;
}
DWORD share = 0;
DWORD share = FILE_SHARE_DELETE;
if (!(mode & fs::unread) || !(mode & fs::write))
{
share |= FILE_SHARE_READ;
@ -975,7 +975,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
if (!(mode & (fs::lock + fs::unread)) || !(mode & fs::write))
{
share |= FILE_SHARE_WRITE | FILE_SHARE_DELETE;
share |= FILE_SHARE_WRITE;
}
const HANDLE handle = CreateFileW(to_wchar(path).get(), access, share, NULL, disp, FILE_ATTRIBUTE_NORMAL, NULL);