Boost logo

Boost-Commit :

From: igaztanaga_at_[hidden]
Date: 2008-08-01 10:05:34


Author: igaztanaga
Date: 2008-08-01 10:05:32 EDT (Fri, 01 Aug 2008)
New Revision: 47929
URL: http://svn.boost.org/trac/boost/changeset/47929

Log:
Added FILE_SHARE_DELETE to CreateFile to allow unix-like behaviour when deleting shared memory
Text files modified:
   trunk/boost/interprocess/detail/win32_api.hpp | 3 ++-
   1 files changed, 2 insertions(+), 1 deletions(-)

Modified: trunk/boost/interprocess/detail/win32_api.hpp
==============================================================================
--- trunk/boost/interprocess/detail/win32_api.hpp (original)
+++ trunk/boost/interprocess/detail/win32_api.hpp 2008-08-01 10:05:32 EDT (Fri, 01 Aug 2008)
@@ -65,6 +65,7 @@
 
 static const unsigned long file_share_read = 0x00000001;
 static const unsigned long file_share_write = 0x00000002;
+static const unsigned long file_share_delete = 0x00000004;
 
 static const unsigned long generic_read = 0x80000000L;
 static const unsigned long generic_write = 0x40000000L;
@@ -355,7 +356,7 @@
 { return MapViewOfFileEx(handle, file_access, highoffset, lowoffset, numbytes, base_addr); }
 
 static inline void *create_file(const char *name, unsigned long access, unsigned long creation_flags, unsigned long attributes = 0)
-{ return CreateFileA(name, access, file_share_read | file_share_write, 0, creation_flags, attributes, 0); }
+{ return CreateFileA(name, access, file_share_read | file_share_write | file_share_delete, 0, creation_flags, attributes, 0); }
 
 static inline bool delete_file(const char *name)
 { return 0 != DeleteFileA(name); }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk