Bug in TTY example ?

Bug in TTY example ?

Post by Rene Balver » Fri, 09 May 1997 04:00:00



I'm writing some communications software for Window NT, and studied
the TTY example from the VC 4.2 CD ROM.

The file 'COMMDEV ( npTTYInfo )' is opened with the FILE_FLAG_OVERLAPPED
value. In the ComWatchProc function (thread) the function
WaitCommEvent() is called:

        WaitCommEvent( COMDEV( npTTYInfo ), &dwEvtMask, NULL );

The third parameter is NULL, but according to the books-on-line
the OVERLAPPED (third) parameter should not be NULL for overlapped
files/communication handles:

(Help for WaitCommEvent)
"If hFile was opened with FILE_FLAG_OVERLAPPED, the lpOverlapped
parameter must not be NULL. It must point to a valid OVERLAPPED
structure. If hFile was opened with FILE_FLAG_OVERLAPPED and
lpOverlapped is NULL, the function can incorrectly report that the
operation is complete."

Anyway, I think the TTY example is hard to understand.

Any reactions ?

Regards,

Rene Balvert

 
 
 

1. Bug in TTY example ?

I'm writing some communications software for Window NT, and studied
the TTY example from the VC 4.2 CD ROM.

The file 'COMMDEV ( npTTYInfo )' is opened with the FILE_FLAG_OVERLAPPED
value. In the ComWatchProc function (thread) the function
WaitCommEvent() is called:

        WaitCommEvent( COMDEV( npTTYInfo ), &dwEvtMask, NULL );

The third parameter is NULL, but according to the books-on-line
the OVERLAPPED (third) parameter should not be NULL for overlapped
files/communication handles:

(Help for WaitCommEvent)
"If hFile was opened with FILE_FLAG_OVERLAPPED, the lpOverlapped
parameter must not be NULL. It must point to a valid OVERLAPPED
structure. If hFile was opened with FILE_FLAG_OVERLAPPED and
lpOverlapped is NULL, the function can incorrectly report that the
operation is complete."

Anyway, I think the TTY example is hard to understand.

Any reactions ?

Regards,

Rene Balvert

2. Bug in 1394 driver?

3. Win2K: POLSTORE.DLL -- bugs and bugs and bugs

4. If-then in IDC

5. BUG BUG BUG / VIRUS VIRUS VIRUS

6. UN: Norton Cmnder for OS/

7. BUGS, BUGS, BUGS...HERE IS SOME HELP

8. newsgroup removal : what to do?

9. BUG: CSocket examples

10. Bug in MSDN example code for multithreaded pipe server

11. Bug in MSDN Library example?

12. Bug in MS example for overlapped named pipes?

13. Norton example code uncovers possible windows bug?