WdfDeviceSetCharacteristics - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfdevice.h

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

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfdevice-wdfdevicesetcharacteristics)

WdfDeviceSetCharacteristics function

Description

[Applies to KMDF only]

The WdfDeviceSetCharacteristics method sets device characteristics for a specified device.

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.

Remarks

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

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
                            );

See also

WdfDeviceGetCharacteristics

WdfDeviceInitSetCharacteristics