Remarque
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de vous connecter ou de modifier des répertoires.
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de modifier des répertoires.
[S’applique uniquement à KMDF]
La méthode WdfDeviceInitFree libère une structure WDFDEVICE_INIT.
Syntaxe
VOID WdfDeviceInitFree(
[in] PWDFDEVICE_INIT DeviceInit
);
Paramètres
[in] DeviceInit
Pointeur vers une structure WDFDEVICE_INIT.
Valeur de retour
Aucun
Remarques
Si votre pilote reçoit une structure WDFDEVICE_INIT d’un appel à WdfPdoInitAllocate ou WdfControlDeviceInitAllocate, et si le pilote rencontre par la suite génère une erreur lorsqu’il appelle une méthode d’initialisation d’objet d’appareil ou WdfDeviceCreate, le pilote doit appeler WdfDeviceInitFree.
Votre pilote ne doit pas appeler WdfDeviceInitFree une fois qu’il appelle WdfDeviceCreate correctement.
Votre pilote n’a pas besoin d’appeler WdfDeviceInitFree s’il a reçu la structure WDFDEVICE_INIT comme entrée à son EvtDriverDeviceAdd fonction de rappel, car l’infrastructure supprime la structure une fois la fonction de rappel retournée.
Pour plus d’informations sur l’appel WdfDeviceCreate, consultez Création d’un objet d’appareil Framework.
Exemples
L’exemple de code suivant appelle WdfDeviceInitFree si un appel à WdfPdoInitAssignRawDevice échoue.
NTSTATUS status;
status = WdfPdoInitAssignRawDevice(
pDeviceInit,
&GUID_DEVCLASS_KEYBOARD
);
if (!NT_SUCCESS(status)) {
WdfDeviceInitFree(pDeviceInit);
pDeviceInit = NULL;
return STATUS;
}
Exigences
| Exigence | Valeur |
|---|---|
| plateforme cible | Universel |
| version minimale de KMDF | 1.0 |
| d’en-tête | wdfdevice.h (include Wdf.h) |
| bibliothèque | Wdf01000.sys (voir Versioning de la bibliothèque Framework.) |
| IRQL | <= DISPATCH_LEVEL |
| règles de conformité DDI | DoubleDeviceInitFree(kmdf), DriverCreate(kmdf), InitFreeDeviceCallback(kmdf), InitFreeDeviceCreate (kmdf), InitFreeDeviceCreateType2(kmdf), InitFreeDeviceCreateType4(kmdf), InitFreeNull() kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf), PdoInitFreeDeviceCallback(kmdf), PdoInitFreeDeviceCreate(kmdf), PdoInitFreeDeviceCreateType2(kmdf), PdoInitFreeDeviceCreateType4(kmdf) |