Bewerken

Delen via


SpbControllerSetIoOtherCallback function (spbcx.h)

The SpbControllerSetIoOtherCallback method registers an SPB controller driver's EvtSpbControllerIoOther callback function.

Syntax

void SpbControllerSetIoOtherCallback(
  [in]           WDFDEVICE                    FxDevice,
  [in]           PFN_SPB_CONTROLLER_OTHER     EvtSpbControllerIoOther,
  [in, optional] PFN_WDF_IO_IN_CALLER_CONTEXT EvtIoInCallerContext
);

Parameters

[in] FxDevice

A WDFDEVICE handle to the device object that represents the SPB controller.

[in] EvtSpbControllerIoOther

A pointer to an EvtSpbControllerIoOther callback function. The SPB controller driver implements this function. The SPB framework extension (SpbCx) calls this function to pass an I/O control request to the controller driver. For more information about the type of I/O requests that are passed to this function, see the following Remarks section.

[in, optional] EvtIoInCallerContext

A pointer to an EvtIoInCallerContext callback function that is called when an I/O control request first arrives at the controller's I/O queue, and the request contains an IOCTL code that the SPB framework extension (SpbCx) does not recognize. This callback runs in the process context of the request originator, and can preprocess requests that will later be processed by the EvtSpbControllerIoOther callback. This parameter is optional and can be specified as NULL if no such preprocessing is required. For more information, see the following Remarks section.

Return value

None

Remarks

This method provides a way for your SPB controller driver to declare its support for custom I/O control codes (IOCTLs) that are bus-specific or driver-specific. If the SPB controller driver does not call this method, SpbCx rejects all such I/O control requests, and the SPB controller driver never sees them.

SpbCx manages the I/O queue for the SPB controller. By default, if SpbCx receives an I/O control request that has an IOCTL that it does not support, SpbCx completes the request with error status code STATUS_INVALID_DEVICE_REQUEST.

However, by calling SpbControllerSetIoOtherCallback, the SPB controller driver declares its support for I/O control requests that the SPB framework extension (SpbCx) does not support. In this case, when SpbCx receives an I/O control request that has an IOCTL code that it does not support, SpbCx calls the EvtSpbControllerIoOther function to pass the request to the SPB controller driver for processing. The SPB controller driver is responsible for completing the request.

For a list of the IOCTLs that SpbCx supports, see SpbCx I/O Control Codes.

The optional EvtIoInCallerContext callback function runs in the process context of the request originator, and can preprocess context-dependent request parameters, such as buffer pointers, before the request is passed to the EvtSpbControllerIoOther callback function. When the EvtIoInCallerContext function is called, any per-request context that the SPB controller driver requested in a previous call to SpbControllerSetRequestAttributes will already be allocated and assigned to the request.

The SPB controller driver must call this method before it commits the device object—that is, before it returns from the EvtDriverDeviceAdd callback or adds the PDO to the controller's child list. The child list represents the devices that are attached to the bus. For more information, see Enumerating the Devices on a Bus.

Requirements

Requirement Value
Minimum supported client Available starting with Windows 8.
Target Platform Universal
Header spbcx.h
Library Spbcxstubs.lib
IRQL PASSIVE_LEVEL

See also

EvtIoInCallerContext

EvtSpbControllerIoOther

SpbControllerSetRequestAttributes