共用方式為


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 回呼例程應該先呼叫 SpbDeviceInitConfig,再呼叫 WdfDeviceCreate 方法來建立裝置物件。

例子

下列程式代碼範例示範如何使用 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