Развернуть Свернуть

WdfFdoInitAllocAndQueryPropertyEx method

[Applies to KMDF and UMDF]

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

Syntax


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
);

Parameters

DeviceInit [in]

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

DeviceProperty [in]

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

PoolType [in]

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

PropertyMemoryAttributes [in, optional]

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 [out]

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

Type [out]

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 codeDescription
STATUS_INVALID_PARAMETER

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.

Remarks

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.

Requirements

Minimum KMDF version

1.13

Minimum UMDF version

2.0

Header

Wdffdo.h (include Wdf.h)

Library

Wdf01000.sys (KMDF);
WUDFx02000.dll (UMDF)

IRQL

PASSIVE_LEVEL

See also

WdfFdoInitAllocAndQueryProperty

 

 

Send comments about this topic to Microsoft

Показ:
© 2014 Microsoft