NetCharDevQPurge or Net32CharDevQPurge

The NetCharDevQPurge API deletes all pending requests on a serial device queue.

This function deletes only requests that have not yet been assigned to a device. A process that currently has a device open is unaffected. All pending requests queued on pszQueueName are canceled, returning the ERROR_BAD_NET_RESP error code for each call to the DosOpen function. All handles still are valid.