Sign in with
Sign up | Sign in
Your question

IRP in Completion Routine

Last response: in Windows XP
Share
Anonymous
a b \ Driver
September 15, 2005 11:18:30 PM

Archived from groups: microsoft.public.windowsxp.device_driver.dev (More info?)

Hello,

Curious about the following:

Setup an IRP using IoBuildAsynchronousFsdRequest for IRP_MJ_READ for some
starting offset and some length.

In completion routine, for the IRP passed, the IOStatus is good but looking
in the stack (stack=IoGetCurrentIrpStackLocation(irp)), the
Parameters.Read.ByteOffset and Parameters.Read.Length as having zero values.
Why?

TIA!!

More about : irp completion routine

Anonymous
a b \ Driver
September 17, 2005 1:54:20 AM

Archived from groups: microsoft.public.windowsxp.device_driver.dev (More info?)

This is weird - I was looking for something else via a google search and
came across this answer to my question but the answer doesn't show up in the
newsgroup (msnews.microsoft.com) (I've reset it in OE and still only my
message there) .. anyway the answer is below as well as my comment
(immediately below):

Okay, thanks. I was under the impression from various things I read that
the "current" stack was the next stack location during the completion
routine but that must not be the case (or it is and it's already been
cleared)?




Doron Holan [MS] Sep 15, 11:02 pm show options

Newsgroups: microsoft.public.win32.programmer.kernel
From: "Doron Holan [MS]" dor...@nospam.microsoft.com
Date: Thu, 15 Sep 2005 23:02:45 -0700
Local: Thurs, Sep 15 2005 11:02 pm
Subject: Re: IRP Stack in Completion Routine.


if you created the irp, the current stack location is invalid (you don't get
one). this is also why the DeviceObject passed to the completion routine is
NULL as well. You get a completion routine b/c completion routines are
stored in the next stack location where there is storage.


You have 2 options
1) you need to store any relevant data in the Context parameter.
2) allocate yourself an extra stack location and use it store the data you
want, but then you can't use IOBuildAsynchronousFsdRequest b/c it doesn't
allow you to specify stack size (but IoAllocateIrp does)


d





"David F." <70751.3507@xcompuservex.com> wrote in message
news:ewmTvTmuFHA.664@tk2msftngp13.phx.gbl...
> Hello,
>
> Curious about the following:
>
> Setup an IRP using IoBuildAsynchronousFsdRequest for IRP_MJ_READ for some
> starting offset and some length.
>
> In completion routine, for the IRP passed, the IOStatus is good but
> looking
> in the stack (stack=IoGetCurrentIrpStackLocation(irp)), the
> Parameters.Read.ByteOffset and Parameters.Read.Length as having zero
> values.
> Why?
>
> TIA!!
>
>
Anonymous
a b \ Driver
September 17, 2005 2:43:35 AM

Archived from groups: microsoft.public.windowsxp.device_driver.dev (More info?)

(abandon this thread)

Never mind - I had canceled the message in
microsoft.public.win32.programmer.kernel and moved it to this group.
Apparently the cancel didn't work and that is where the answer was.
!