From 858b206553dcccc9c78cb8c337f404ad3888ab54 Mon Sep 17 00:00:00 2001 From: hogliux Date: Wed, 30 Aug 2017 11:42:00 +0100 Subject: [PATCH] Revert recent commit - 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 6ecaf91c7e..5185d12087 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_WRITE, 0, + exclusive ? 0 : (FILE_SHARE_READ | (mode == readWrite ? FILE_SHARE_WRITE : 0)), 0, createType, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, 0); if (h != INVALID_HANDLE_VALUE)