SpbDeviceInitConfig, fonction (spbcx.h)
La méthode SpbDeviceInitConfig attache l’extension de framework SPB (SpbCx) à la chaîne de demande 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 de retour
SpbDeviceInitConfig retourne STATUS_SUCCESS si l’appel réussit. Les valeurs de retour possibles incluent le code d’erreur suivant.
Retourner le code | Description |
---|---|
|
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,...);
Exigences
Exigence | Valeur |
---|---|
client minimum pris en charge | Disponible à partir de Windows 8. |
plateforme cible | Universel |
d’en-tête | spbcx.h |
bibliothèque | Spbcxstubs.lib |
IRQL | PASSIVE_LEVEL |