Expand Minimize

WdfDeviceInitSetIoType method

[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

DeviceInit [in]

A pointer to a WDFDEVICE_INIT structure.

IoType [in]

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

This method does not return a value.

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

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

See also

IWDFDeviceInitialize2::SetIoTypePreference
WDF_DEVICE_IO_TYPE
WdfDeviceInitSetIoTypeEx

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.