This should help
I/O Completion Ports[
^]
Do something like this:
Open the serial port with CreateFile() and remember to pass the FILE_FLAG_OVERLAPPED value in the dwFlagsAndAttributes parameter.
You can modify the serial port state as using GetCommState() and SetCommState().
GetCommTimeouts() and SetCommTimeouts() allows you to modify timeouts.
At this point you can use the handle with an IO completion port like a file or socket handle.
Attach the handle to a completion port using CreateIoCompletionPort(), initiate I/O operations with ReadFile() or WriteFile() using an OVERLAPPED structure, dequeue completed, failed or canceled operations from the completion port using GetQueuedCompletionStatus().
Regards
Espen Harlinn