IO Transfer Type in WDF (WdfDeviceInitSetIoType has no effect for filter driver.)

Hi,

I am developing some WFP driver based on WDF framework.

WDF is used for FileCreate,FileClose, FileCleanup callbacks and configuring
an IO queue with

WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(
&ioQueueConfig,
WdfIoQueueDispatchSequential
);

ioQueueConfig.EvtIoDeviceControl = EvtIoDeviceControl;

I am also calling WdfDeviceInitSetIoType(DeviceInit, WdfDeviceIoBuffered);
to set the device IO transfer Type.

Now the problem is my IOCTL is failing with error = 6 which is envalid File
handle and this IOCTL call is not hitting my driver code at all.

If i use IOCTL which is defined as METHOD_IN_DIRECT , the IOCTL call is
hitting the driver.

I have gone through msdn found that calling *WdfDeviceInitSetIoType *has no
effect for filter driver. “*KMDF *If you are writing a new driver using
KMDF version 1.13 or later, you should instead use
*WdfDeviceInitSetIoTypeEx*
https:.
CallingWdfDeviceInitSetIoType 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.”

so question is it not possible to use driver defined IOCTL Transfer Type if
we are in filter driver.

Regards,
Rahul</https:>

Io type has no control over ioctls, only reads and writes.

Get Outlook for Androidhttps:

From: Rahul Kumar
Sent: Saturday, September 17, 5:08 AM
Subject: [ntdev] IO Transfer Type in WDF (WdfDeviceInitSetIoType has no effect for filter driver.)
To: Windows System Software Devs Interest List

Hi,

I am developing some WFP driver based on WDF framework.

WDF is used for FileCreate,FileClose, FileCleanup callbacks and configuring an IO queue with

WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(

&ioQueueConfig,

WdfIoQueueDispatchSequential

);

ioQueueConfig.EvtIoDeviceControl = EvtIoDeviceControl;

I am also calling WdfDeviceInitSetIoType(DeviceInit, WdfDeviceIoBuffered); to set the device IO transfer Type.

Now the problem is my IOCTL is failing with error = 6 which is envalid File handle and this IOCTL call is not hitting my driver code at all.

If i use IOCTL which is defined as METHOD_IN_DIRECT , the IOCTL call is hitting the driver.

I have gone through msdn found that calling WdfDeviceInitSetIoType has no effect for filter driver. “KMDF If you are writing a new driver using KMDF version 1.13 or later, you should instead use WdfDeviceInitSetIoTypeExhttps:. CallingWdfDeviceInitSetIoType 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.”

so question is it not possible to use driver defined IOCTL Transfer Type if we are in filter driver.

Regards,

Rahul

— NTDEV is sponsored by OSR Visit the list online at: MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at To unsubscribe, visit the List Server section of OSR Online at</https:></https:>

Hi Doron,

Thanks, I was messing up with the structures, now its working fine.

On Sat, Sep 17, 2016 at 7:16 PM, Doron Holan
wrote:

> Io type has no control over ioctls, only reads and writes.
>
> Get Outlook for Android
>
> From: Rahul Kumar
> Sent: Saturday, September 17, 5:08 AM
> Subject: [ntdev] IO Transfer Type in WDF (WdfDeviceInitSetIoType has no
> effect for filter driver.)
> To: Windows System Software Devs Interest List
>
> Hi,
>
> I am developing some WFP driver based on WDF framework.
>
> WDF is used for FileCreate,FileClose, FileCleanup callbacks and
> configuring an IO queue with
>
> WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(
>
> &ioQueueConfig,
>
> WdfIoQueueDispatchSequential
>
> );
>
> ioQueueConfig.EvtIoDeviceControl = EvtIoDeviceControl;
>
> I am also calling WdfDeviceInitSetIoType(DeviceInit,
> WdfDeviceIoBuffered); to set the device IO transfer Type.
>
> Now the problem is my IOCTL is failing with error = 6 which is envalid
> File handle and this IOCTL call is not hitting my driver code at all.
>
> If i use IOCTL which is defined as METHOD_IN_DIRECT , the IOCTL call is
> hitting the driver.
>
> I have gone through msdn found that calling WdfDeviceInitSetIoType has
> no effect for filter driver. “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.”
>
> so question is it not possible to use driver defined IOCTL Transfer Type
> if we are in filter driver.
>
> Regards,
>
> Rahul
>
>
>
> — NTDEV is sponsored by OSR Visit the list online at: MONTHLY seminars
> on crash dump analysis, WDF, Windows internals and software drivers!
> Details at To unsubscribe, visit the List Server section of OSR Online at
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: http:
>
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
></http:></http:>