WdfDeviceAssignInterfaceProperty function (wdfdevice.h)
Important
Applies to UMDF only
The WdfDeviceAssignInterfaceProperty method modifies the current value of a device interface property.
Note
To retrieve or modify a device interface property, a KMDF driver must call IoGetDeviceInterfacePropertyData or IoSetDeviceInterfacePropertyData directly.
Syntax
NTSTATUS WdfDeviceAssignInterfaceProperty(
[in] WDFDEVICE Device,
[in] PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData,
[in] DEVPROPTYPE Type,
[in] ULONG BufferLength,
[in, optional] PVOID PropertyBuffer
);
Parameters
[in] Device
A handle to a framework device object.
[in] PropertyData
A pointer to WDF_DEVICE_INTERFACE_PROPERTY_DATA structure.
[in] Type
A DEVPROPTYPE-typed value that specifies the type of the data that is provided in PropertyBuffer.
[in] BufferLength
Specifies the length, in bytes, of the buffer that PropertyBuffer points to.
[in, optional] 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
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