[Applies to KMDF only]
The WdfPdoInitAllocate method allocates a WDFDEVICE_INIT structure for a framework-based bus driver, which the bus driver uses when reporting a new device.
PWDFDEVICE_INIT WdfPdoInitAllocate( WDFDEVICE ParentDevice );
A handle to a framework device object that represents the parent device of the new device. The framework device object must represent a functional device object (FDO).
If the operation succeeds, the method returns a pointer to a framework-allocated WDFDEVICE_INIT structure. Otherwise, the method returns NULL.
If a bus driver uses static enumeration, it reports a new device by:
- Calling WdfPdoInitAllocate to allocate a WDFDEVICE_INIT structure.
- Calling framework device object initialization methods and framework PDO initialization methods, as needed, to initialize the WDFDEVICE_INIT structure. If a call to one of these methods fails, the driver must call WdfDeviceInitFree.
- Calling WdfDeviceCreate to create a framework device object, supplying the initialized WDFDEVICE_INIT structure as input.
For a code example that uses WdfPdoInitAllocate, see WdfFdoAddStaticChild.
|Minimum KMDF version||1.0|
|Header||wdfpdo.h (include Wdf.h)|
|Library||Wdf01000.sys (see Framework Library Versioning.)|
|DDI compliance rules||AddPdoToStaticChildList, DriverCreate, KmdfIrql, KmdfIrql2, PdoDeviceInitAPI, PdoInitFreeDeviceCallback, PdoInitFreeDeviceCreate, PdoInitFreeDeviceCreateType2, PdoInitFreeDeviceCreateType4|