WdfDeviceAssignProperty function (wdfdevice.h)

[Applies to KMDF and UMDF]

The WdfDeviceAssignProperty method modifies the current setting of a device property.

Syntax

NTSTATUS WdfDeviceAssignProperty(
  [in]           WDFDEVICE                 Device,
  [in]           PWDF_DEVICE_PROPERTY_DATA DeviceProperty,
  [in]           DEVPROPTYPE               Type,
  [in]           ULONG                     Size,
  [in, optional] PVOID                     Data
);

Parameters

[in] Device

A handle to a framework device object.

[in] DeviceProperty

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

[in] Type

A DEVPROPTYPE-typed variable that specifies the type of the data stored in Data.

[in] Size

The size, in bytes, of the buffer that is pointed to by Data.

[in, optional] Data

A pointer to a caller-allocated buffer that contains the device property data. Set this parameter to NULL to delete the specified property.

Return value

If the operation succeeds, WdfDeviceAssignProperty 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.

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

Remarks

You can use WdfDeviceAssignProperty to modify the setting of any property that is exposed through the unified property model.

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

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.13
Minimum UMDF version 2.0
Header wdfdevice.h (include Wdf.h)
Library Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)
IRQL APC_LEVEL

See also

WdfDeviceAssignInterfaceProperty