13 #ifndef __STOUT_INTERNAL_WINDOWS_OVERLAPPED_HPP__ 14 #define __STOUT_INTERNAL_WINDOWS_OVERLAPPED_HPP__ 17 #include <type_traits> 32 OVERLAPPED overlapped = {};
43 overlapped.hEvent = ::CreateEventW(
nullptr, FALSE, FALSE,
nullptr);
44 if (overlapped.hEvent ==
nullptr) {
54 overlapped.hEvent =
reinterpret_cast<HANDLE>(
55 reinterpret_cast<uintptr_t
>(overlapped.hEvent) | 1);
72 bool successful_return_code,
size_t bytes_transfered)
75 if (successful_return_code) {
76 return bytes_transfered;
80 if (error.
code == ERROR_IO_PENDING) {
93 #endif // __STOUT_INTERNAL_WINDOWS_OVERLAPPED_HPP__
Try< OVERLAPPED > init_overlapped_for_sync_io()
Definition: overlapped.hpp:30
Result< size_t > process_async_io_result(bool successful_return_code, size_t bytes_transfered)
Definition: overlapped.hpp:71
Definition: error.hpp:108
const DWORD code
Definition: error.hpp:29
constexpr Handle HANDLE
Definition: ingress.hpp:37
Definition: attributes.hpp:24
std::string error(const std::string &msg, uint32_t code)