WdfDeviceInitSetDeviceType - NtDoc

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

VOID WdfDeviceInitSetDeviceType(
  [in] PWDFDEVICE_INIT DeviceInit,
  [in] DEVICE_TYPE     DeviceType
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

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

WdfDeviceInitSetDeviceType function

Description

[Applies to KMDF only]

The WdfDeviceInitSetDeviceType method sets the device type for a specified device.

Parameters

DeviceInit [in]

A pointer to a WDFDEVICE_INIT structure.

DeviceType [in]

A FILE_DEVICE_XXXX value that identifies the device type. For more information about FILE_DEVICE_XXXX values, see Specifying Device Types.

Remarks

If a driver calls WdfDeviceInitSetDeviceType, it must do so before it calls WdfDeviceCreate.

For more information about calling WdfDeviceCreate, see Creating a Framework Device Object.

The device type that a driver specifies determines the default priority boost value that the framework uses when the driver completes an I/O request. For more information about priority boost values, see Specifying Priority Boosts When Completing I/O Requests.

If you are writing a UMDF driver, you must modify your driver's INF file or make registry changes to specify a device type. For more information about using the registry, see Setting Device Object Registry Properties During Installation.

Examples

The following code example indicates that a device is a serial device.

WdfDeviceInitSetDeviceType(
                           DeviceInit,
                           FILE_DEVICE_SERIAL_PORT
                           );