From b83bf4e7cecf8ac6a5ae792975e290fd0a4fd679 Mon Sep 17 00:00:00 2001 From: hogliux Date: Tue, 29 Aug 2017 09:44:45 +0100 Subject: [PATCH] Windows: Ensure that memory mapped files behave the same on all targets by allowing other code to open the memory mapped file with write priveleges even if the map was created with read priveleges only --- modules/juce_core/native/juce_win32_Files.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_core/native/juce_win32_Files.cpp b/modules/juce_core/native/juce_win32_Files.cpp index 5185d12087..6ecaf91c7e 100644 --- a/modules/juce_core/native/juce_win32_Files.cpp +++ b/modules/juce_core/native/juce_win32_Files.cpp @@ -360,7 +360,7 @@ void MemoryMappedFile::openInternal (const File& file, AccessMode mode, bool exc } HANDLE h = CreateFile (file.getFullPathName().toWideCharPointer(), accessMode, - exclusive ? 0 : (FILE_SHARE_READ | (mode == readWrite ? FILE_SHARE_WRITE : 0)), 0, + exclusive ? 0 : FILE_SHARE_WRITE, 0, createType, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, 0); if (h != INVALID_HANDLE_VALUE)