Frédéric Delanoy frederic.delanoy@gmail.com writes:
Yes, but it can fail for other reasons as well. If it really is a console handle, but ReadConsoleW fails, isn't it better to return failure early rather than trying to read from (assumed) file handle h?
It probably doesn't matter much, but you can always check last error or something like that.