EVT_SERCX_RECEIVE_CANCEL function

The EvtSerCxReceiveCancel event callback function notifies the serial controller driver that the pending receive request is canceled.

Syntax


EVT_SERCX_RECEIVE_CANCEL EvtSerCxReceiveCancel;

VOID EvtSerCxReceiveCancel(
  _In_ WDFDEVICE Device
)
{ ... }

Parameters

Device [in]

A WDFDEVICE handle to the framework device object that represents the serial controller.

Return value

None.

Remarks

The serial framework extension (SerCx) calls this function to inform the serial controller driver that the current receive request has been canceled. If the driver has an outstanding receive operation in progress, the driver should cancel this operation and call the SerCxProgressReceive method to report the cancellation. In the SerCxProgressReceive call, set BytesReceived to the number of bytes received before the operation was canceled, and set ReceiveStatus to SerCxStatusCancelled.

To register an EvtSerCxReceiveCancel callback function, the driver must call the SerCxInitialize method.

Examples

The function type for this callback is declared in Sercx.h, as follows.


typedef VOID
  EVT_SERCX_RECEIVE_CANCEL(
    __in WDFDEVICE Device
    );

To define an EvtSerCxReceiveCancel callback function that is named MyEvtSerCxReceiveCancel, you must first provide a function declaration that Static Driver Verifier (SDV) and other verification tools require, as follows.


EVT_SERCX_RECEIVE_CANCEL MyEvtSerCxReceiveCancel;

Then, implement your callback function as follows.


VOID
  MyEvtSerCxReceiveCancel(
    __in WDFDEVICE Device
    )
{ ... }

For more information about SDV requirements for function declarations, see Declaring Functions Using Function Role Types for KMDF Drivers.

Requirements

Target platform

Version

Available starting with Windows 8.

Header

1.0\Sercx.h

IRQL

Called at IRQL <= DISPATCH_LEVEL

See also

SerCxInitialize
SerCxProgressReceive

 

 

Send comments about this topic to Microsoft

Show: