Subject: [Boost-bugs] [Boost C++ Libraries] #1080: boost::interprocess win32 global file mapping issue
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-07-05 10:23:52
#1080: boost::interprocess win32 global file mapping issue
-----------------------------------+----------------------------------------
Reporter: matroskin222_at_[hidden] | Type: Bugs
Status: new | Milestone: Boost 1.35.0
Component: None | Version:
Severity: Problem | Keywords: interprocess global shared memory win32
-----------------------------------+----------------------------------------
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 '''"Access is denied"'''
error you can reimplement this function as:
''static inline void * create_file_mapping (void * handle, unsigned long
access, unsigned long high_size, unsigned long low_size, const char *
name)
{
SECURITY_ATTRIBUTES sa;
SECURITY_DESCRIPTOR sd;
InitializeSecurityDescriptor(&sd,SECURITY_DESCRIPTOR_REVISION);
SetSecurityDescriptorDacl(&sd, true, NULL, false);
sa.lpSecurityDescriptor = &sd;
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.bInheritHandle = FALSE;
return CreateFileMappingA (handle, &sa, access, high_size,
low_size, name);
}''
--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1080>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:56 UTC