EVT_SERCX_FILECLOSE callback function

The EvtSerCxFileClose event callback function notifies the serial controller driver that the file object that represents the serial controller device has been released.

Syntax


EVT_SERCX_FILECLOSE EvtSerCxFileClose;

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

Parameters

Device [in]

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

Return value

None.

Remarks

This function should remove the serial controller device from the state in which it is ready to receive and transmit data. This function should disable interrupts if interrupts are enabled. Any memory that is allocated only for the lifetime of the file object should be deallocated either in this function or in the EvtSerCxFileCleanup function.

If the serial controller driver implements an EvtSerCxFileCleanup function, the serial framework extension (SerCx) calls this function before it calls the EvtSerCxFileClose function. SerCx calls the EvtSerCxFileCleanup function when a client closes the last handle to the file object that represents the serial controller device. After this call, the driver receives no new requests for I/O operations. SerCx calls the EvtSerCxFileClose function when the file object is released, which occurs only after all outstanding I/O requests are either completed or canceled.

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

For more information, see Framework File Objects.

Examples

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


typedef VOID
  EVT_SERCX_FILECLOSE(
    __in WDFDEVICE Device
    );

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


EVT_SERCX_FILECLOSE MyEvtSerCxFileClose;

Then, implement your callback function as follows.


VOID
  MyEvtSerCxFileClose(
    __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

Desktop

Version

Available starting with Windows 8.

Header

1.0\Sercx.h

IRQL

Called at IRQL <= DISPATCH_LEVEL

See also

EvtSerCxFileCleanup
SerCxInitialize

 

 

Send comments about this topic to Microsoft

Show: