WdfDeviceAssignInterfaceProperty method

[Applies to UMDF only]

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

Syntax


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

Parameters

Device [in]

A handle to a framework device object.

PropertyData [in]

A pointer to WDF_DEVICE_INTERFACE_PROPERTY_DATA structure.

Type [in]

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

BufferLength [in]

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

PropertyBuffer [in, optional]

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

Target platform

Universal

Minimum support

Windows 8.1

Minimum UMDF version

2.0

Header

Wdfdevice.h (include Wdf.h)

Library

WUDFx02000.lib

DLL

WUDFx02000.dll;
TBD

IRQL

PASSIVE_LEVEL

See also

WDF_DEVICE_INTERFACE_PROPERTY_DATA
WDF_DEVICE_INTERFACE_PROPERTY_DATA_INIT
WdfDeviceAllocAndQueryInterfaceProperty
WdfDeviceQueryInterfaceProperty

 

 

Send comments about this topic to Microsoft

Show: