windows_shared_memory - does memory block exists?
Hi, Why native windows shared memory does not include any means to check for existance of memory block without throwing exceptions? A small function would be enough: // boost::interprocess::windows_shared_memory static bool exists(const std::string &a_path) { using namespace boost::interprocess; try { unsigned long file_map_access = winapi::page_readonly; unsigned long map_access = winapi::file_map_read; void *test_handle = winapi::open_file_mapping(map_access, a_path.c_str()); bool res = (test_handle != NULL); if(res) winapi::close_handle(test_handle); return res; } catch(...) { return false; } } Without this I have to use Boost internals (winapi::*) in my application. Would somebody consider including this code or something similar? Regards, Piotr
participants (1)
-
piotr.ns