SpbDeviceInitConfig 函数 (spbcx.h)

SpbDeviceInitConfig 方法将 SPB 框架扩展 (SpbCx) 附加到要创建的 WDFDEVICE (FDO 或 PDO) 对象的 I/O 请求链。

语法

NTSTATUS SpbDeviceInitConfig(
  [in, out] WDFDEVICE_INIT *DeviceInit
);

参数

[in, out] DeviceInit

指向要配置的 WDFDEVICE_INIT 结构的指针。

返回值

SpbDeviceInitConfig 如果调用成功,则返回STATUS_SUCCESS。 可能的返回值包括以下错误代码。

返回代码 描述
STATUS_INSUFFICIENT_RESOURCES
无法分配所需的系统资源。

言论

此方法将 SpbCx 的配置信息与要创建的设备对象(PDO 或 FDO)的 WDFDEVICE_INIT 结构相关联。 驱动程序的 EvtDriverDeviceAdd 回调例程应在调用 WdfDeviceCreate 方法创建设备对象之前调用 SpbDeviceInitConfig

例子

下面的代码示例演示如何使用 SpbDeviceInitConfig 方法将 SpbCx 框架扩展的配置信息与 WDFDEVICE_INIT 结构相关联。

//
// FxDeviceInit is a pointer to a WDFDEVICE_INIT structure that comes as a
// parameter for an EvtDriverDeviceAdd handler, or from WdfPdoInitAllocate.
//

status = SpbDeviceInitConfig(FxDeviceInit);

if (!NT_SUCCESS(status))
{
    return status;
}

// 
// Set WDF and SpbCx device-level configuration options.
//

...

//
// Call WdfDeviceCreate
//

status = WdfDeviceCreate(&FxDeviceInit,...);


要求

要求 价值
最低支持的客户端 从 Windows 8 开始可用。
目标平台 普遍
标头 spbcx.h
Spbcxstubs.lib
IRQL PASSIVE_LEVEL

另请参阅

EvtDriverDeviceAdd

WDFDEVICE_INIT

WdfDeviceCreate

WdfPdoInitAllocate