Bewerken

Delen via


WdfDeviceAllocAndQueryInterfaceProperty function (wdfdevice.h)

[Applies to UMDF only]

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

Syntax

NTSTATUS WdfDeviceAllocAndQueryInterfaceProperty(
  [in]           WDFDEVICE                           Device,
  [in]           PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData,
  [in]           POOL_TYPE                           PoolType,
  [in, optional] PWDF_OBJECT_ATTRIBUTES              PropertyMemoryAttributes,
  [out]          WDFMEMORY                           *PropertyMemory,
  [out]          PDEVPROPTYPE                        Type
);

Parameters

[in] Device

A handle to a framework device object.

[in] PropertyData

A pointer to a WDF_DEVICE_INTERFACE_PROPERTY_DATA structure that identifies the device interface 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-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

Requirement Value
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