WdfPdoInitAllocate - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfpdo.h

PWDFDEVICE_INIT WdfPdoInitAllocate(
  [in] WDFDEVICE ParentDevice
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfpdo-wdfpdoinitallocate)

WdfPdoInitAllocate function

Description

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

Parameters

ParentDevice [in]

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.

See also

WdfControlDeviceInitAllocate