Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/boost/interprocess/sync/windows/named_sync.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <boost/interprocess/errors.hpp>
#include <boost/interprocess/exceptions.hpp>
#include <string>
#include <cstring>
#include <boost/assert.hpp>

namespace boost {
Expand Down Expand Up @@ -83,6 +84,7 @@ inline void windows_named_sync::close(windows_named_sync_interface &sync_interfa
{
const unsigned long buflen = static_cast<unsigned long>(sync_interface.get_data_size());
winapi::interprocess_overlapped overlapped;
std::memset(&overlapped, 0, sizeof(overlapped));
if(winapi::lock_file_ex
(m_file_hnd, winapi::lockfile_exclusive_lock, 0, 1, 0, &overlapped)){
if(winapi::set_file_pointer(m_file_hnd, sizeof(sync_id::internal_type), 0, winapi::file_begin)){
Expand Down Expand Up @@ -133,6 +135,7 @@ inline void windows_named_sync::open_or_create
typedef sync_id::internal_type unique_id_type;
const std::size_t sizeof_file_info = sizeof(unique_id_type) + buflen;
winapi::interprocess_overlapped overlapped;
std::memset(&overlapped, 0, sizeof(overlapped));
if(winapi::lock_file_ex
(m_file_hnd, winapi::lockfile_exclusive_lock, 0, 1, 0, &overlapped)){
__int64 filesize = 0;
Expand Down
Loading