Add FILE_FLAG_OVERLAPPED in a couple of places
[libs/core.git] / source / io / serial.cpp
index ac4f2b764d8666332de5cf932e62e66cd5d764b2..2ed11ae9fddd900b4ab695a2acc05770deaf5e18 100644 (file)
@@ -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;