Editar

Compartir a través de


SERCX2_CONFIG structure (sercx.h)

The SERCX2_CONFIG structure contains configuration information for version 2 of the serial framework extension (SerCx2).

Syntax

typedef struct _SERCX2_CONFIG {
  ULONG                                            Size;
  PFN_SERCX2_FILEOPEN                              EvtSerCx2FileOpen;
  PFN_SERCX2_FILECLOSE                             EvtSerCx2FileClose;
  PFN_SERCX2_SET_WAIT_MASK                         EvtSerCx2SetWaitMask;
  PFN_SERCX2_PURGE_FIFOS                           EvtSerCx2PurgeFifos;
  PFN_SERCX2_CONTROL                               EvtSerCx2Control;
  PFN_SERCX2_APPLY_CONFIG                          EvtSerCx2ApplyConfig;
  PFN_SERCX2_SELECT_NEXT_RECEIVE_TRANSACTION_TYPE  EvtSerCx2SelectNextReceiveTransactionType;
  PFN_SERCX2_SELECT_NEXT_TRANSMIT_TRANSACTION_TYPE EvtSerCx2SelectNextTransmitTransactionType;
  PWDF_OBJECT_ATTRIBUTES                           RequestAttributes;
} SERCX2_CONFIG, *PSERCX2_CONFIG;

Members

Size

The size, in bytes, of this structure. The SerCx2InitializeDevice method uses this member to determine which version of the structure the caller is using. The size of this structure might change in future versions of the Sercx.h header file.

EvtSerCx2FileOpen

A pointer to the driver-implemented EvtSerCx2FileOpen event callback function. This member is optional and can be set to NULL to indicate that the driver does not implement the function. However, a driver that implements this function must also implement an EvtSerCx2FileClose function.

EvtSerCx2FileClose

A pointer to the driver-implemented EvtSerCx2FileClose event callback function. This member is optional and can be set to NULL to indicate that the driver does not implement the function.

EvtSerCx2SetWaitMask

A pointer to the driver-implemented EvtSerCx2SetWaitmask event callback function. This member must point to a valid function.

EvtSerCx2PurgeFifos

A pointer to the driver-implemented EvtSerCx2PurgeFifos event callback function. This member must point to a valid function.

EvtSerCx2Control

A pointer to the driver-implemented EvtSerCx2Control event callback function. This member must point to a valid function.

EvtSerCx2ApplyConfig

A pointer to the driver-implemented EvtSerCx2ApplyConfig event callback function. This member must point to a valid function.

EvtSerCx2SelectNextReceiveTransactionType

A pointer to the driver-implemented EvtSerCx2SelectNextReceiveTransactionType event callback function. This member is optional and can be set to NULL to indicate that the driver does not implement the function.

EvtSerCx2SelectNextTransmitTransactionType

A pointer to the driver-implemented EvtSerCx2SelectNextTransmitTransactionType event callback function. This member is optional and can be set to NULL to indicate that the driver does not implement the function.

RequestAttributes

A pointer to a WDF_OBJECT_ATTRIBUTES structure that describes the attributes to assign to the framework request objects that SerCx2 passes to the serial controller driver. Before calling the SerCx2InitializeDevice method, the caller must call the WDF_OBJECT_ATTRIBUTES_INIT function to initialize the structure. This member is optional and can be specified as WDF_NO_OBJECT_ATTRIBUTES if the serial controller driver does not need to assign attributes to the object. For more information, see Remarks.

Remarks

The SerCx2InitializeDevice method accepts a pointer to a SERCX2_CONFIG structure as an input parameter. Before calling SerCx2InitializeDevice, call the SERCX2_CONFIG_INIT function to initialize this structure.

If the RequestAttributes member points to a WDF_OBJECT_ATTRIBUTES structure, the caller must not overwrite the values that the WDF_OBJECT_ATTRIBUTES_INIT initialization function writes to the ParentObject, ExecutionLevel, and SynchronizationScope members of this structure.

A driver might need to store information in context areas in the framework request objects that the driver receives. Typically, the driver calls the WdfDeviceInitSetRequestAttributes method to specify the required attributes for request objects. These attributes include the name and size of the context area in each request object. Additionally, in the current implementation of SerCx2, a serial controller driver that requires a request context should specify these same attributes in the RequestAttributes member of the SERCX2_CONFIG structure that the driver passes to SerCx2InitializeDevice. That is, the driver should specify the same request attributes twice—in the SerCx2InitializeDevice call, and in the WdfDeviceInitSetRequestAttributes call. For more information, see SerCx2 Custom-Receive Transactions and SerCx2 Custom-Transmit Transactions.

A driver that never needs a request context does not need to call WdfDeviceInitSetRequestAttributes, and can set the RequestAttributes member of the SERCX2_CONFIG structure to WDF_NO_OBJECT_ATTRIBUTES.

Requirements

Requirement Value
Minimum supported client Supported starting with Windows 8.1.
Header sercx.h

See also

EvtSerCx2ApplyConfig

EvtSerCx2Control

EvtSerCx2FileClose

EvtSerCx2FileOpen

EvtSerCx2PurgeFifos

EvtSerCx2SelectNextReceiveTransactionType

EvtSerCx2SelectNextTransmitTransactionType

EvtSerCx2SetWaitmask

SERCX2_CONFIG_INIT

SerCx2InitializeDevice

WDF_OBJECT_ATTRIBUTES

WDF_OBJECT_ATTRIBUTES_INIT