Expand Minimize

WdfDeviceInitSetDeviceType method

[Applies to KMDF only]

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

Syntax


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

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.

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

Requirements

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

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft