This procedure outlines how to implement serial communications in an application. With the exception of step 3, the procedure is identical for all three approaches.
Port numbers are stored in the \HKEY_LOCAL_MACHINE\Drivers registry key. Active drivers are listed in the \HKEY_LOCAL_MACHINE\Active registry key.
The colon (:) is part of the port name and must be included. Set the lpSecurityAttributes parameter to NULL and the dwFlagsAndAttributes parameter to zero.
When one thread is waiting for a ReadFile function to return, ReadFile calls issued by other threads are blocked until the initial ReadFile call returns. The same is true for the WriteFile function.