WdfDeviceAssignInterfaceProperty function

[Applies to UMDF only]

The WdfDeviceAssignInterfaceProperty method modifies the current value of a device interface property.

Syntax

NTSTATUS WdfDeviceAssignInterfaceProperty(
  WDFDEVICE                           Device,
  PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData,
  DEVPROPTYPE                         Type,
  ULONG                               BufferLength,
  PVOID                               PropertyBuffer
);

Parameters

Device

A handle to a framework device object.

PropertyData

A pointer to WDF_DEVICE_INTERFACE_PROPERTY_DATA structure.

Type

A DEVPROPTYPE-typed value that specifies the type of the data that is provided in PropertyBuffer.

BufferLength

Specifies the length, in bytes, of the buffer that PropertyBuffer points to.

PropertyBuffer

A pointer to the device interface property data. Set this parameter to NULL to delete the specified property.

Return Value

If the WdfDeviceAssignInterfaceProperty 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

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

Examples

The following code example initializes a WDF_DEVICE_INTERFACE_PROPERTY_DATA structure and then calls WdfDeviceAssignInterfaceProperty.

DEFINE_DEVPROPKEY(DEVPKEY_ToasterCrispLevelDword, 0x5d0ba64a, 0x2396, 0x4bc9, 0xbf, 0x49, 0x52, 0x1d, 0xa6, 0x2b, 0x1b, 0xed, 3);  // DEVPROP_TYPE_UINT32

ULONG crispLevel = 0;
WDF_DEVICE_INTERFACE_PROPERTY_DATA propertyData;

WDF_DEVICE_INTERFACE_PROPERTY_DATA_INIT(
                          &propertyData, 
                          &GUID_DEVINTERFACE_TOASTER_DRIVER
                          &DEVPKEY_ToasterCrispLevelDword
                          );

status = WdfDeviceAssignInterfaceProperty(device, 
                                          &propertData,
                                          DEVPROP_TYPE_UINT32,
                                          sizeof(crispLevel),
                                          &crispLevel);
if (!NT_SUCCESS(status)) {
    return status;
}

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

WdfDeviceAllocAndQueryInterfaceProperty

WdfDeviceQueryInterfaceProperty