If you mean: "Can I open the same serial port, via
CreateFile
more than once at time?" the answer is
no.
The serial port is not a shared device and the documentation clearly states (
"Communications Resources" at MSDN[
^]):
When the process uses CreateFile to open a communications resource, it must specify certain values for the following parameters:
- The fdwShareMode parameter must be zero, opening the resource for exclusive access.
- The fdwCreate parameter must specify the OPEN_EXISTING flag.
- The hTemplateFile parameter must be NULL.