Using overlapped IO for console input?
问题 I'm attempting to use overlapped IO to read input from the console by opening CONIN$ with the FILE_FLAG_OVERLAPPED flag. However, ReadFile blocks when I use it, even with an OVERLAPPED parameter. I've read some posts reporting that this is a Windows 7 bug. I am using 7 so that could be possible. Here's the code I'm using: // Create a console window AllocConsole(); AttachConsole(GetProcessId(GetModuleHandle(NULL))); HANDLE overlappedConsoleIn = CreateFile(L"CONIN$", GENERIC_READ, FILE_SHARE