IRP in Completion Routine

D

David F.

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!!
 
D

David F.

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]" (e-mail address removed)
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
 
D

David F.

(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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top