WdfDeviceAllocAndQueryInterfaceProperty function

[Applies to UMDF only]

The WdfDeviceAllocAndQueryInterfaceProperty method allocates a buffer and retrieves a specified device interface property.

Syntax

NTSTATUS WdfDeviceAllocAndQueryInterfaceProperty(
  WDFDEVICE                           Device,
  PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData,
  POOL_TYPE                           PoolType,
  PWDF_OBJECT_ATTRIBUTES              PropertyMemoryAttributes,
  WDFMEMORY                           *PropertyMemory,
  PDEVPROPTYPE                        Type
);

Parameters

Device

A handle to a framework device object.

PropertyData

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

PoolType

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

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.

PropertyMemory

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

Type

A pointer to a DEVPROPTYPE-typed variable that, on return, identifies the type of property data contained in PropertyMemory.

Return Value

If the WdfDeviceAllocAndQueryInterfaceProperty method encounters no errors, it returns STATUS_SUCCESS. Additional return values include:

Return code Description
STATUS_INVALID_PARAMETER
One of the parameters is incorrect.
 

The method might return other NTSTATUS values.

Remarks

The WdfDeviceAllocAndQueryInterfaceProperty 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.

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

Requirements

   
Minimum supported client Windows 8.1
Target Platform Universal
Minimum UMDF version 2.0
Header wdfdevice.h (include Wdf.h)
Library WUDFx02000.lib
DLL WUDFx02000.dll
IRQL PASSIVE_LEVEL

See Also

WDF_DEVICE_INTERFACE_PROPERTY_DATA

WDF_DEVICE_INTERFACE_PROPERTY_DATA_INIT

WdfDeviceAssignInterfaceProperty

WdfDeviceQueryInterfaceProperty