SpbRequestCaptureIoOtherTransferList 函数 (spbcx.h)
SpbRequestCaptureIoOtherTransferList 方法检索自定义 IOCTL 请求的输入缓冲区中的 SPB_TRANSFER_LIST 结构。
语法
NTSTATUS SpbRequestCaptureIoOtherTransferList(
SPBREQUEST Request
);
参数
Request
SPBREQUEST 自定义 IOCTL 请求的句柄。 SPB 控制器驱动程序以前通过其注册的 事件回调函数之一接收此句柄。
返回值
如果调用成功,SpbRequestCaptureIoOtherTransferList 返回STATUS_SUCCESS。 可能的返回值包括以下错误代码。
返回值 | 描述 |
---|---|
|
SPBREQUEST 参数无效或请求中的 SPB_TRANSFER_LIST 结构格式不正确。 |
|
无法分配此作所需的系统资源。 |
言论
必须在缓冲区地址有效的进程上下文中调用此方法。 通常,SPB 控制器驱动程序从 EvtIoInCallerContext 事件回调函数中调用此方法,驱动程序将其作为输入参数提供给 SpbControllerSetIoOtherCallback 方法。
SPB 控制器驱动程序可以调用此方法的最大 IRQL 取决于 I/O 请求的发起方是在用户模式下还是在内核模式下运行。 如果请求源自用户模式,驱动程序必须在PASSIVE_LEVEL调用此方法。 如果请求源自内核模式,驱动程序必须在 IRQL <= DISPATCH_LEVEL 调用此方法。 驱动程序可以调用 WdfRequestGetRequestorMode 方法来确定发起者的模式。 但是,此调用通常是不必要的,因为驱动程序可以依赖 SPB 框架扩展(SpbCx)在适当的 IRQL 中调用驱动程序的 EvtIoInCallerContext 函数。
例子
以下代码示例演示 SPB 控制器驱动程序的 EvtIoInCallerContext 事件回调函数如何使用 SpbRequestCaptureIoOtherTransferList 方法从自定义 IOCTL 请求获取 I/O 缓冲区或缓冲区。
VOID
EvtIoInCallerContext(
_In_ WDFDEVICE SpbController,
_In_ WDFREQUEST FxRequest
)
{
NTSTATUS status;
//
// NOTE: The driver should check for custom IOCTLs that this
// driver handles. If an IOCTL is not recognized, mark the
// request as STATUS_NOT_SUPPORTED, and complete the request.
//
status = SpbRequestCaptureIoOtherTransferList((SPBREQUEST)FxRequest);
//
// If the preceding call fails, the driver must complete the
// request instead of queueing the request.
//
if (!NT_SUCCESS(status))
{
goto exit;
}
status = WdfDeviceEnqueueRequest(SpbController, FxRequest);
if (!NT_SUCCESS(status))
{
goto exit;
}
exit:
if (!NT_SUCCESS(status))
{
WdfRequestComplete(FxRequest, status);
}
}
要求
要求 | 价值 |
---|---|
最低支持的客户端 | 从 Windows 8 开始可用。 |
目标平台 | 普遍 |
标头 | spbcx.h |
库 | Spbcxstubs.lib |
IRQL | 请参阅“备注”。 |