Share via


Fonction SpbDeviceInitConfig (spbcx.h)

La méthode SpbDeviceInitConfig attache l’extension d’infrastructure SPB (SpbCx) à la chaîne de demandes d’E/S pour un objet WDFDEVICE (FDO ou PDO) à créer.

Syntaxe

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

Paramètres

[in, out] DeviceInit

Pointeur vers la structure WDFDEVICE_INIT à configurer.

Valeur retournée

SpbDeviceInitConfig retourne STATUS_SUCCESS si l’appel réussit. Les valeurs de retour possibles incluent le code d’erreur suivant.

Code de retour Description
STATUS_INSUFFICIENT_RESOURCES
Impossible d’allouer les ressources système requises.

Remarques

Cette méthode associe les informations de configuration de SpbCx à la structure WDFDEVICE_INIT de l’objet d’appareil (PDO ou FDO) à créer. La routine de rappel EvtDriverDeviceAdd de votre pilote doit appeler SpbDeviceInitConfig avant d’appeler la méthode WdfDeviceCreate pour créer l’objet d’appareil.

Exemples

L’exemple de code suivant montre comment utiliser la méthode SpbDeviceInitConfig pour associer les informations de configuration de l’extension de framework SpbCx à la structure 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,...);


Configuration requise

Condition requise Valeur
Client minimal pris en charge Disponible à partir de Windows 8.
Plateforme cible Universal
En-tête spbcx.h
Bibliothèque Spbcxstubs.lib
IRQL PASSIVE_LEVEL

Voir aussi

EvtDriverDeviceAdd

WDFDEVICE_INIT

WdfDeviceCreate

WdfPdoInitAllocate