A Query about SERIAL_EV_RXCHAR

Hi all,

I am writing a filter driver in which, I need to know how I can wait on an
event mask(say, SERIAL_EV_RXCHAR ). Particularily on which KEVENT object
should I wait on.
Shail

At 20:53 11/12/00 +0500, Shail wrote:

I am writing a filter driver in which, I need to know how I can wait on an
event mask(say, SERIAL_EV_RXCHAR ). Particularily on which KEVENT object
should I wait on.

Shail, my driver waits on EV_RXCHAR but doesn’t really use a KEVENT object.
This is how I do it.

Create an IRP with:
Irp = IoBuildDeviceIoControlRequest (IOCTL_SERIAL_SET_WAIT_MASK, etc.)

Nominate a function that you wish to be called when your IRP is completed
(when EX_RXCHAR happens):
IoSetCompletionRoutine (Irp, FunctionToBeCalled, ReferenceData, etc.)

Send this IRP to the serial driver:
IoCallDriver (Extension->SerialPort, Irp)

When the serial driver received a character, the IoManager will call your
FunctionToBeCalled, passing ReferenceData as a parameter. (It will also
pass the pointer to your IRP, so you can re-use it, and wait for another
EV_RXCHAR, if you like.)

Hope this is useful,

Malcolm Malcolm Hannah Limited, Glasgow, Scotland