How to check if a HANDLE is valid or not?

In C++, I have opened a serial port that has a HANDLE. Since the port may close by an external application, how can I verify that the HANDLE is still valid before reading data?

I think it can be done by checking the HANDLE against a suitable API function, but which? Thank you.

19
задан Pooven 3 July 2014 в 07:43
поделиться