WdfFdoInitAllocAndQueryPropertyEx function (wdffdo.h)

[Applies to KMDF and UMDF]

The WdfFdoInitAllocAndQueryPropertyEx method allocates a buffer and retrieves a specified device property.


NTSTATUS WdfFdoInitAllocAndQueryPropertyEx(
  [in]           PWDFDEVICE_INIT           DeviceInit,
  [in]           PWDF_DEVICE_PROPERTY_DATA DeviceProperty,
  [in]           POOL_TYPE                 PoolType,
  [in, optional] PWDF_OBJECT_ATTRIBUTES    PropertyMemoryAttributes,
  [out]          WDFMEMORY                 *PropertyMemory,
  [out]          PDEVPROPTYPE              Type


[in] DeviceInit

A pointer to a WDFDEVICE_INIT structure that the driver obtained from its EvtDriverDeviceAdd callback function.

[in] DeviceProperty

A pointer to a WDF_DEVICE_PROPERTY_DATA structure that identifies the device property to be retrieved.

[in] PoolType

A POOL_TYPE-typed enumerator that specifies the type of memory to be allocated.

[in, optional] PropertyMemoryAttributes

A pointer to a caller-allocated WDF_OBJECT_ATTRIBUTES structure that describes object attributes for the memory object that the function will allocate. This parameter is optional and can be WDF_NO_OBJECT_ATTRIBUTES.

[out] PropertyMemory

A pointer to a WDFMEMORY-typed location that receives a handle to a framework memory object.

[out] Type

A pointer to a DEVPROPTYPE variable. If the method is successful, upon return this parameter contains the property type value of the property data stored in PropertyMemory.

Return value

If the operation succeeds, WdfFdoInitAllocAndQueryPropertyEx returns STATUS_SUCCESS. Additional return values include:

Return code Description
The specified DeviceProperty value is invalid.

The method might return other NTSTATUS values.

A bug check occurs if the driver supplies an invalid object handle.


The WdfFdoInitAllocAndQueryPropertyEx method determines the amount of memory that is necessary to hold the requested device interface property. It allocates enough memory to hold the data, and returns a handle to a framework memory object that describes the allocated memory. To access the data, your driver can call WdfMemoryGetBuffer.

The driver can call WdfFdoInitAllocAndQueryPropertyEx only before calling WdfDeviceCreate. For more information about calling WdfDeviceCreate, see Creating a Framework Device Object.

After calling WdfDeviceCreate, a driver can obtain device property information by calling WdfDeviceAllocAndQueryPropertyEx.

For information about related methods, see Accessing the Unified Device Property Model.


Target Platform Universal
Minimum KMDF version 1.13
Minimum UMDF version 2.0
Header wdffdo.h (include Wdf.h)
Library Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)

See also