Hello!
I have a basic question. I am reading serial WDF sample that comes with DDK. I wonder how this driver notifies Windows upon the reception of a new event. For example, if the driver detects a parity error, how does it wake the WaitCommEvent function?
I have seen IOCTL_SERIAL_GET_COMMSTATUS call, but I don not think it is the way since that would mean Windows is polling the driver.
Thank you very much,
Igor
xxxxx@gmail.com wrote:
I have a basic question. I am reading serial WDF sample that comes with DDK. I wonder how this driver notifies Windows upon the reception of a new event. For example, if the driver detects a parity error, how does it wake the WaitCommEvent function?
I have seen IOCTL_SERIAL_GET_COMMSTATUS call, but I don not think it is the way since that would mean Windows is polling the driver.
WaitCommEvent uses IOCTL_SERIAL_WAIT_ON_MASK. That request is held in
the driver until something interesting occurs. Then, the driver
completes it and the app submits another. This technique is called
“inverted call”.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Thank you very much!!
Igor