Which IOCTL code of Serial.sys is equivalent to the api ClearCommError()??

Hi:
I want to clear all errors in kernel-mode when an error occurs.

Any reply is appreciated.

Regards.
Paul

** Reply to message from “Paul” on Fri, 10 May 2002
15:07:47 +0800

> I want to clear all errors in kernel-mode when an error occurs.

Well, that’s interesting…

There is no equivalent IOCTL to a Win32 API. Rather, the Win32 code
implementing ClearCommError() or other serial port APIs makes one or several
IOCTL calls into the driver. I believe, however, that in this case you will
find what you are looking for in the handler for IOCTL_SERIAL_GET_COMMSTATUS.
It should be a simple matter of clearing the ErrorWord variable.

Sincerely,

Chris Myers
Senior Project Engineer
Quatech, Inc.

Hi:
I have tried IOCTL_SERIAL_GET_COMMSTATUS and it did not clear errors.

In fact, IOCTL_SERIAL_CLEAR_STATS will do that for me.

Thanks
Paul

----- Original Message -----
From: “Chris Myers”
To: “NT Developers Interest List”
Sent: Friday, May 10, 2002 8:48 PM
Subject: [ntdev] Re: Which IOCTL code of Serial.sys is equivalent to the api ClearCommError()??

> ** Reply to message from “Paul” on Fri, 10 May 2002
> 15:07:47 +0800
>
>
> > I want to clear all errors in kernel-mode when an error occurs.
>
> Well, that’s interesting…
>
> There is no equivalent IOCTL to a Win32 API. Rather, the Win32 code
> implementing ClearCommError() or other serial port APIs makes one or several
> IOCTL calls into the driver. I believe, however, that in this case you will
> find what you are looking for in the handler for IOCTL_SERIAL_GET_COMMSTATUS.
> It should be a simple matter of clearing the ErrorWord variable.
>
> Sincerely,
>
> Chris Myers
> Senior Project Engineer
> Quatech, Inc.
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@cnuninet.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

** Reply to message from “Paul” on Sat, 11 May 2002
09:12:07 +0800

> I have tried IOCTL_SERIAL_GET_COMMSTATUS and it did not clear errors.
>
> In fact, IOCTL_SERIAL_CLEAR_STATS will do that for me.

GET_COMMSTATUS will clear the “immediate” errors that accumulate in the port’s
error dword. CLEAR_STATS clears the error counters in the performance data and
WMI data structures. You’d need to call both IOCTLs to clear all of this
information. Your first post didn’t make clear which ones you were interested
in :-).

Sincerely,

Chris Myers
Senior Project Engineer
Quatech, Inc.