WdfDeviceInitSetDeviceType function

[Applies to KMDF only]

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

Syntax

void WdfDeviceInitSetDeviceType(
  PWDFDEVICE_INIT DeviceInit,
  DEVICE_TYPE     DeviceType
);

Parameters

DeviceInit

A pointer to a WDFDEVICE_INIT structure.

DeviceType

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

Return Value

None

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 <a href="https://msdn.microsoft.com/library/windows/hardware/ff563759">Setting Device Object Registry Properties During Installation</a>.

Examples

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

WdfDeviceInitSetDeviceType(
                           DeviceInit,
                           FILE_DEVICE_SERIAL_PORT
                           );

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 ChildDeviceInitAPI, DeviceInitAPI, DriverCreate, KmdfIrql, KmdfIrql2, PdoDeviceInitAPI