Open files with FILE_SHARE_READ on Windows

This commit is contained in:
Thomas Goyne 2014-03-21 07:23:44 -07:00
parent ad193f70a9
commit 5750a660c2
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ using namespace boost::interprocess;
namespace agi {
file_mapping::file_mapping(agi::fs::path const& filename, boost::interprocess::mode_t mode)
#ifdef _WIN32
: handle(CreateFileW(filename.wstring().c_str(), (unsigned int)mode, 0, nullptr, OPEN_EXISTING, 0, 0))
: handle(CreateFileW(filename.wstring().c_str(), (unsigned int)mode, FILE_SHARE_READ, nullptr, OPEN_EXISTING, 0, 0))
{
if (handle == ipcdetail::invalid_file()) {
switch (GetLastError()) {