From 808af66bb0567d9d4de8a598a4d02220e6c3a0b2 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Mon, 7 Jan 2019 00:22:13 +0100 Subject: [PATCH] task: Add header information to data --- source/windows/task.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/windows/task.cpp b/source/windows/task.cpp index e2621bd..14d8882 100644 --- a/source/windows/task.cpp +++ b/source/windows/task.cpp @@ -18,9 +18,12 @@ along with this program. If not, see . #include "task.hpp" +#define SIZE_ELEMENT uint32_t + void datapath::windows::task::_assign(const std::vector& data, std::shared_ptr ov){ - this->buffer.resize(data.size()); - std::memcpy(buffer.data(), data.data(), data.size()); + this->buffer.resize(data.size() + sizeof(SIZE_ELEMENT)); + std::memcpy(buffer.data() + sizeof(SIZE_ELEMENT), data.data(), data.size()); + reinterpret_cast(buffer[0]) = SIZE_ELEMENT(data.size()); this->overlapped = ov; }