Question on WRITE routine

Hi,

We have a volume upper filter driver (PnP) on win2k2, 2k3, 2k8 (32 / 64
bit). It seats over “volsnap” driver. In this context,

  1. Is it possible that WRITE dispatch routine
    “DriverObject->MajorFunction[IRP_MJ_WRITE]” is called at DISPATCH_LEVEL? I
    know that it is mostly called at PASSIVE_LEVEL and completion routine is
    called at DISPATCH_LEVEL.

  2. If our device object sets “DO_DIRECT_IO” flag and attaches to the stack,
    “IoAttachDeviceToDeviceStack” (meaning we want to receive only DIRECT IO),
    then is it possible that in WRITE routine (whether it is called at Dispatch
    level or passive level), we will receive non DIRECT IO, where
    Irp->MdlAddress is NULL?

Thanks,
Sunil

You are not allowed to change the write contract for the stack, you may only set direct_io if the device you are attaching to has it set.

d

dent from a phine with no keynoard


From: Sunil Patil
Sent: Thursday, February 24, 2011 10:13 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Question on WRITE routine

Hi,

We have a volume upper filter driver (PnP) on win2k2, 2k3, 2k8 (32 / 64 bit). It seats over “volsnap” driver. In this context,

  1. Is it possible that WRITE dispatch routine “DriverObject->MajorFunction[IRP_MJ_WRITE]” is called at DISPATCH_LEVEL? I know that it is mostly called at PASSIVE_LEVEL and completion routine is called at DISPATCH_LEVEL.

  2. If our device object sets “DO_DIRECT_IO” flag and attaches to the stack, “IoAttachDeviceToDeviceStack” (meaning we want to receive only DIRECT IO), then is it possible that in WRITE routine (whether it is called at Dispatch level or passive level), we will receive non DIRECT IO, where Irp->MdlAddress is NULL?

Thanks,
Sunil
— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hi Doron,

Got your point. Device I am attaching to has direct_io flag set. So I am
setting direct_io flag on my object. Given this, will I ever receive an IRP
with MdlAddress as NULL in my WRITE routine?

Thanks,
Sunil

On Fri, Feb 25, 2011 at 11:46 AM, Doron Holan wrote:

> You are not allowed to change the write contract for the stack, you may
> only set direct_io if the device you are attaching to has it set.
>
> d
>
> dent from a phine with no keynoard
> ------------------------------
> From: Sunil Patil
> Sent: Thursday, February 24, 2011 10:13 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Question on WRITE routine
>
> Hi,
>
> We have a volume upper filter driver (PnP) on win2k2, 2k3, 2k8 (32 / 64
> bit). It seats over “volsnap” driver. In this context,
>
> 1. Is it possible that WRITE dispatch routine
> “DriverObject->MajorFunction[IRP_MJ_WRITE]” is called at DISPATCH_LEVEL? I
> know that it is mostly called at PASSIVE_LEVEL and completion routine is
> called at DISPATCH_LEVEL.
>
> 2. If our device object sets “DO_DIRECT_IO” flag and attaches to the stack,
> “IoAttachDeviceToDeviceStack” (meaning we want to receive only DIRECT IO),
> then is it possible that in WRITE routine (whether it is called at Dispatch
> level or passive level), we will receive non DIRECT IO, where
> Irp->MdlAddress is NULL?
>
> Thanks,
> Sunil
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
> the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>