Boost C++ Libraries: Ticket #1080: boost::interprocess win32 global file mapping issue https://svn.boost.org/trac10/ticket/1080 <p> There is a serious bug in boost::interprocess library. It is unable to create global shared memory between services and simle applications. An exception is thrown ( m_err = 5, m_str = "Access is denied" ) I shortly investigated the way to fix this issue and found that call of CreateFileMappingA winAPI in winapi::create_file_mapping function sets lpAttributes parameter as NULL. To get rid of <strong>"Access is denied"</strong> error you can reimplement this function as: <em>static inline void * create_file_mapping (void * handle, unsigned long access, unsigned long high_size, unsigned long low_size, const char * name) { </em></p> <blockquote> <p> SECURITY_ATTRIBUTES sa; SECURITY_DESCRIPTOR sd; </p> </blockquote> <blockquote> <p> <a class="missing wiki">InitializeSecurityDescriptor</a>(&amp;sd,SECURITY_DESCRIPTOR_REVISION); <a class="missing wiki">SetSecurityDescriptorDacl</a>(&amp;sd, true, NULL, false); </p> </blockquote> <blockquote> <p> sa.lpSecurityDescriptor = &amp;sd; sa.nLength = sizeof(SECURITY_ATTRIBUTES); sa.bInheritHandle = FALSE; return CreateFileMappingA (handle, &amp;sa, access, high_size, low_size, name); </p> </blockquote> <p> }<em> </em></p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1080 Trac 1.4.3 Ion Gaztañaga Sun, 19 Aug 2007 16:56:21 GMT owner set https://svn.boost.org/trac10/ticket/1080#comment:1 https://svn.boost.org/trac10/ticket/1080#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Ion Gaztañaga</span> </li> </ul> Ticket Marshall Clow Tue, 21 Aug 2007 21:13:16 GMT component changed https://svn.boost.org/trac10/ticket/1080#comment:2 https://svn.boost.org/trac10/ticket/1080#comment:2 <ul> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">interprocess</span> </li> </ul> Ticket Ion Gaztañaga Fri, 31 Aug 2007 11:58:07 GMT <link>https://svn.boost.org/trac10/ticket/1080#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1080#comment:3</guid> <description> <p> Changed SVN adding suggested code. Reporter: close this bug if the problem has completely disappeared. </p> </description> <category>Ticket</category> </item> <item> <author>matroskin222@…</author> <pubDate>Mon, 01 Oct 2007 10:42:30 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1080#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1080#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/1080#comment:3" title="Comment 3">igaztanaga</a>: </p> <blockquote class="citation"> <p> Changed SVN adding suggested code. Reporter: close this bug if the problem has completely disappeared. </p> </blockquote> <p> Problem didn't completely disappeared. You have to pass such security attributes in each <a class="missing wiki">WinApi</a> call where SA parameter is required. Or allow users to specify SA by themselves. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Thu, 26 Aug 2010 11:16:27 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/1080#comment:5 https://svn.boost.org/trac10/ticket/1080#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.36.0</span> → <span class="trac-field-new">Boost-1.45.0</span> </li> </ul> <p> New permission scheme added for Boost 1.45, the user can specify permissions. </p> Ticket