EVT_SERCX2_PIO_RECEIVE_CLEANUP_TRANSACTION callback function (sercx.h)

The EvtSerCx2PioReceiveCleanupTransaction event callback function is called by version 2 of the serial framework extension (SerCx2) to clean up the serial controller's hardware state after a PIO-receive transaction ends.

Syntax

EVT_SERCX2_PIO_RECEIVE_CLEANUP_TRANSACTION EvtSercx2PioReceiveCleanupTransaction;

void EvtSercx2PioReceiveCleanupTransaction(
  [in] SERCX2PIORECEIVE PioReceive
)
{...}

Parameters

[in] PioReceive

A SERCX2PIORECEIVE handle to a PIO-receive object. The serial controller driver previously called the SerCx2PioReceiveCreate method to create this object.

Return value

None

Remarks

Your serial controller driver can, as an option, implement this function. If implemented, the driver registers the function in the call to the SerCx2PioReceiveCreate method that creates the PIO-receive object.

Your serial controller driver should implement an EvtSerCx2PioReceiveCleanupTransaction function if it needs to clean up the serial controller state at the end of a PIO-receive transaction. SerCx2 calls this function, if it is implemented, after a PIO-receive transaction ends. In response to the EvtSerCx2PioReceiveCleanupTransaction call, the serial controller driver must call the SerCx2PioReceiveCleanupTransactionComplete method to notify SerCx2 after the clean-up work is done.

For more information, see SerCx2 PIO-Receive Transactions.

Examples

To define an EvtSerCx2PioReceiveCleanupTransaction callback function, you must first provide a function declaration that identifies the type of callback function you're defining. Windows provides a set of callback function types for drivers. Declaring a function using the callback function types helps Code Analysis for Drivers, Static Driver Verifier (SDV), and other verification tools find errors, and it's a requirement for writing drivers for the Windows operating system.

For example, to define an EvtSerCx2PioReceiveCleanupTransaction callback function that is named MyPioReceiveCleanupTransaction, use the EVT_SERCX2_PIO_RECEIVE_CLEANUP_TRANSACTION function type, as shown in this code example:

EVT_SERCX2_PIO_RECEIVE_CLEANUP_TRANSACTION  MyPioReceiveCleanupTransaction;

Then, implement your callback function as follows:

_Use_decl_annotations_
VOID
  MyPioReceiveCleanupTransaction(
    SERCX2PIORECEIVE  PioReceive
    )
  {...}

The EVT_SERCX2_PIO_RECEIVE_CLEANUP_TRANSACTION function type is defined in the Sercx.h header file. To more accurately identify errors when you run the code analysis tools, be sure to add the Use_decl_annotations annotation to your function definition. The Use_decl_annotations annotation ensures that the annotations that are applied to the EVT_SERCX2_PIO_RECEIVE_CLEANUP_TRANSACTION function type in the header file are used. For more information about the requirements for function declarations, see Declaring Functions by Using Function Role Types for KMDF Drivers. For more information about Use_decl_annotations, see Annotating Function Behavior.

Requirements

Requirement Value
Minimum supported client Available starting with Windows 8.1.
Target Platform Desktop
Header sercx.h
IRQL Called at IRQL <= DISPATCH_LEVEL.

See also

SERCX2PIORECEIVE

SerCx2PioReceiveCleanupTransactionComplete

SerCx2PioReceiveCreate