Bewerken

Delen via


SpbDeviceInitConfig function (spbcx.h)

The SpbDeviceInitConfig method attaches the SPB framework extension (SpbCx) to the I/O-request chain for a WDFDEVICE (FDO or PDO) object that is to be created.

Syntax

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

Parameters

[in, out] DeviceInit

A pointer to the WDFDEVICE_INIT structure that is to be configured.

Return value

SpbDeviceInitConfig returns STATUS_SUCCESS if the call is successful. Possible return values include the following error code.

Return code Description
STATUS_INSUFFICIENT_RESOURCES
Cannot allocate the required system resources.

Remarks

This method associates the configuration information for SpbCx with the WDFDEVICE_INIT structure for the device object (PDO or FDO) that is to be created. Your driver's EvtDriverDeviceAdd callback routine should call SpbDeviceInitConfig before it calls the WdfDeviceCreate method to create the device object.

Examples

The following code example shows how to use the SpbDeviceInitConfig method to associate the SpbCx framework extension's configuration information with the WDFDEVICE_INIT structure.

//
// 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,...);


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

EvtDriverDeviceAdd

WDFDEVICE_INIT

WdfDeviceCreate

WdfPdoInitAllocate