WdfDeviceSetCharacteristics method

[Applies to KMDF only]

The WdfDeviceSetCharacteristics method sets device characteristics for a specified device.

Syntax


VOID WdfDeviceSetCharacteristics(
  [in] WDFDEVICE Device,
  [in] ULONG     DeviceCharacteristics
);

Parameters

Device [in]

A handle to a framework device object.

DeviceCharacteristics [in]

A value that consists of ORed system-defined constants that represent device characteristics. For more information, see the Characteristics member of the DEVICE_OBJECT structure.

Return value

None.

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

Remarks

You should set device characteristics by calling the WdfDeviceInitSetCharacteristics method in your EvtDriverDeviceAdd callback function before calling WdfDeviceCreate. If your driver cannot determine a device's characteristics until after the EvtDriverDeviceAdd callback function returns, the driver typically should call WdfDeviceSetCharacteristics in its EvtDevicePrepareHardware callback function.

Each call to WdfDeviceSetCharacteristics overwrites the settings of any previous call.

Examples

The following code example sets the FILE_REMOVABLE_MEDIA characteristic for a specified device.


WdfDeviceSetCharacteristics(
                            Device,
                            FILE_REMOVABLE_MEDIA
                            );

Requirements

Target platform

Universal

Minimum KMDF version

1.0

Header

Wdfdevice.h (include Wdf.h)

Library

Wdf01000.sys (see Framework Library Versioning.)

IRQL

<=DISPATCH_LEVEL

DDI compliance rules

DriverCreate, KmdfIrql, KmdfIrql2

See also

WdfDeviceInitSetCharacteristics
WdfDeviceGetCharacteristics

 

 

Send comments about this topic to Microsoft

Show: