From a97f614de0984d6dda2173ca72815ac1062faf7a Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 18 Jun 2011 21:33:48 +0300 Subject: [PATCH] Add FILE_FLAG_OVERLAPPED in a couple of places --- source/io/pipe.cpp | 2 +- source/io/serial.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/io/pipe.cpp b/source/io/pipe.cpp index d8de5df..b52c2bc 100644 --- a/source/io/pipe.cpp +++ b/source/io/pipe.cpp @@ -21,7 +21,7 @@ Pipe::Pipe(): if(!handle[0]) throw system_error("CreateNamedPipe"); - *handle[1] = CreateFile(name.c_str(), GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0); + *handle[1] = CreateFile(name.c_str(), GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if(!handle[1]) { unsigned err = GetLastError(); diff --git a/source/io/serial.cpp b/source/io/serial.cpp index ac4f2b7..2ed11ae 100644 --- a/source/io/serial.cpp +++ b/source/io/serial.cpp @@ -158,7 +158,7 @@ Serial::Serial(const string &descr): #ifdef WIN32 port = "\\\\.\\"+port; - *handle = CreateFile(port.c_str(), GENERIC_READ|GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); + *handle = CreateFile(port.c_str(), GENERIC_READ|GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED, 0); if(!handle) throw system_error(format("CreateFile(%s)", port)); mode = M_READ|M_WRITE; -- 2.43.0