Bewerken

Delen via


WdfPdoInitAllocate function (wdfpdo.h)

[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.

Syntax

PWDFDEVICE_INIT WdfPdoInitAllocate(
  [in] WDFDEVICE ParentDevice
);

Parameters

[in] 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).

Return value

If the operation succeeds, the method returns a pointer to a framework-allocated WDFDEVICE_INIT structure. Otherwise, the method returns NULL.

Remarks

If a bus driver uses static enumeration, it reports a new device by:

  1. Calling WdfPdoInitAllocate to allocate a WDFDEVICE_INIT structure.
  2. 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.
  3. Calling WdfDeviceCreate to create a framework device object, supplying the initialized WDFDEVICE_INIT structure as input.
For more information about static enumeration, see Enumerating the Devices on a Bus.

Examples

For a code example that uses WdfPdoInitAllocate, see WdfFdoAddStaticChild.

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.0
Header wdfpdo.h (include Wdf.h)
Library Wdf01000.sys (see Framework Library Versioning.)
IRQL PASSIVE_LEVEL
DDI compliance rules AddPdoToStaticChildList(kmdf), DoubleDeviceInitFree(kmdf), DriverCreate(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf), PdoDeviceInitAPI(kmdf), PdoInitFreeDeviceCallback(kmdf), PdoInitFreeDeviceCreate(kmdf), PdoInitFreeDeviceCreateType2(kmdf), PdoInitFreeDeviceCreateType4(kmdf)

See also

WdfControlDeviceInitAllocate