diff options
Diffstat (limited to 'boost/asio/detail/win_iocp_handle_write_op.hpp')
-rw-r--r-- | boost/asio/detail/win_iocp_handle_write_op.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/boost/asio/detail/win_iocp_handle_write_op.hpp b/boost/asio/detail/win_iocp_handle_write_op.hpp index a53db910a8..b6b1483265 100644 --- a/boost/asio/detail/win_iocp_handle_write_op.hpp +++ b/boost/asio/detail/win_iocp_handle_write_op.hpp @@ -21,12 +21,12 @@ #if defined(BOOST_ASIO_HAS_IOCP) #include <boost/asio/error.hpp> -#include <boost/asio/detail/addressof.hpp> #include <boost/asio/detail/bind_handler.hpp> #include <boost/asio/detail/buffer_sequence_adapter.hpp> #include <boost/asio/detail/fenced_block.hpp> #include <boost/asio/detail/handler_alloc_helpers.hpp> #include <boost/asio/detail/handler_invoke_helpers.hpp> +#include <boost/asio/detail/memory.hpp> #include <boost/asio/detail/operation.hpp> #include <boost/asio/detail/push_options.hpp> @@ -46,16 +46,18 @@ public: buffers_(buffers), handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)) { + handler_work<Handler>::start(handler_); } - static void do_complete(io_service_impl* owner, operation* base, + static void do_complete(void* owner, operation* base, const boost::system::error_code& ec, std::size_t bytes_transferred) { // Take ownership of the operation object. win_iocp_handle_write_op* o(static_cast<win_iocp_handle_write_op*>(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; + handler_work<Handler> w(o->handler_); - BOOST_ASIO_HANDLER_COMPLETION((o)); + BOOST_ASIO_HANDLER_COMPLETION((*o)); #if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING) if (owner) @@ -82,7 +84,7 @@ public: { fenced_block b(fenced_block::half); BOOST_ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - boost_asio_handler_invoke_helpers::invoke(handler, handler.handler_); + w.complete(handler, handler.handler_); BOOST_ASIO_HANDLER_INVOCATION_END; } } |