WdfDeviceInitSetIoType function (wdfdevice.h)

[Applies to KMDF and UMDF]

The WdfDeviceInitSetIoType method sets the method or preference for how a driver will access the data buffers that are included in read and write requests for a specified device.

Syntax

void WdfDeviceInitSetIoType(
  [in] PWDFDEVICE_INIT    DeviceInit,
  [in] WDF_DEVICE_IO_TYPE IoType
);

Parameters

[in] DeviceInit

A pointer to a WDFDEVICE_INIT structure.

[in] IoType

A WDF_DEVICE_IO_TYPE-typed enumerator that identifies the method that the driver will use to access data buffers that it receives for read and write requests.

Return value

None

Remarks

KMDF If you are writing a new driver using KMDF version 1.13 or later, you should instead use WdfDeviceInitSetIoTypeEx. Calling WdfDeviceInitSetIoType from a KMDF filter driver has no effect. For filter drivers, the framework uses the I/O type specified by the next-lower driver in the driver stack.

UMDF If you are converting a KMDF driver that calls WdfDeviceInitSetIoType to UMDF version 2.0 or later, your converted driver can continue to call WdfDeviceInitSetIoType without issue. However, if you are writing an entirely new driver using UMDF version 2.0 or later, you should instead use WdfDeviceInitSetIoTypeEx.

If a driver calls WdfDeviceInitSetIoType, it must do so before it calls WdfDeviceCreate. For more information about calling WdfDeviceCreate, see Creating a Framework Device Object.

If the driver does not call WdfDeviceInitSetIoType, the framework sets the driver's buffer-access method to WdfDeviceIoBuffered, for the specified device.

For more information about buffer-access methods, see Accessing Data Buffers.

Examples

The following code example indicates that a driver will use the direct I/O method when it accesses the device.

WdfDeviceInitSetIoType(
                       DeviceInit,
                       WdfDeviceIoDirect
                       );

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdfdevice.h (include Wdf.h)
Library Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)
IRQL <= DISPATCH_LEVEL
DDI compliance rules ChildDeviceInitAPI(kmdf), ControlDeviceInitAPI(kmdf), DeviceInitAPI(kmdf), DriverCreate(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf), PdoDeviceInitAPI(kmdf)

See also

IWDFDeviceInitialize2::SetIoTypePreference

WDF_DEVICE_IO_TYPE

WdfDeviceInitSetIoTypeEx