WDFDEVICE_INIT
[Applies to KMDF and UMDF]
The WDFDEVICE_INIT structure is an opaque structure that is defined and allocated by the framework.
Function and filter drivers receive a pointer to this structure as input to a EvtDriverDeviceAdd callback function or as a return value from WdfControlDeviceInitAllocate.
Bus drivers receive a structure pointer as input to a EvtChildListCreateDevice callback function or as the return value from WdfPdoInitAllocate.
After a driver receives a WDFDEVICE_INIT structure, it passes the structure pointer to initialization functions. These functions use the WDFDEVICE_INIT structure to store information that the framework uses to create a framework device object. There are three sets of initialization methods:
After calling initialization functions, the driver must call WdfDeviceCreate to create the framework device object.
If your driver encounters an error while initializing a new framework device object, and if the driver received the WDFDEVICE_INIT structure from a call to WdfPdoInitAllocate or WdfControlDeviceInitAllocate, the driver must call WdfDeviceInitFree instead of WdfDeviceCreate.
If your driver received the WDFDEVICE_INIT structure as input to its EvtDriverDeviceAdd callback function, the driver does not need to call WdfDeviceInitFree because the framework deletes the structure after the callback function returns.
The WDFDEVICE_INIT structure is available in version 1.0 and later versions of KMDF.