It is impossible for a dispatch routine to complete another IRP then the one
was called for?
or
It is impossible to complete a IRP from another place then a dispatch
routine?

Re: IRP(s) by Farooque

Farooque
Mon Mar 01 23:18:13 CST 2004

It's very much possible to complete an IRP
from place other than the dispatch routine. It's normal
to PEND an IRP in the dispatch routine and put
it in some queue. Then from some other place, take
this IRP out and complete it.

--

-Farooque Khan
http://farooque.150m.com




"Alex" <AlX@a> wrote in message
news:OMDqg1AAEHA.1032@TK2MSFTNGP10.phx.gbl...
> It is impossible for a dispatch routine to complete another IRP then the
one
> was called for?
> or
> It is impossible to complete a IRP from another place then a dispatch
> routine?
>
>



Re: IRP(s) by Tim

Tim
Tue Mar 02 00:30:09 CST 2004

"Alex" <AlX@a> wrote:
>
>It is impossible for a dispatch routine to complete another IRP then the one
>was called for?

Not at all.

>It is impossible to complete a IRP from another place then a dispatch
>routine?

No, not at all. It is quite common to mark incoming IRPs as "pending", put
them into a queue/list, and come back later to complete them.

Now, you have to do SOMETHING with the incoming IRP. If you don't complete
it, you have to follow the rules to mark it "pending" and make darn sure
you will EVENTUALLY get around to completing or cancelling it.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc

Re: IRP(s) by Alex

Alex
Tue Mar 02 06:20:38 CST 2004

So, if from a system thread I call IoCompleteRequest it will complete the
IRP?


"Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com> wrote in
message news:%23W8V0UBAEHA.1468@tk2msftngp13.phx.gbl...
> It's very much possible to complete an IRP
> from place other than the dispatch routine. It's normal
> to PEND an IRP in the dispatch routine and put
> it in some queue. Then from some other place, take
> this IRP out and complete it.

Do, you mean complete it trough DDStartIo?

>
> --
>
> -Farooque Khan
> http://farooque.150m.com
>
>
>
>
> "Alex" <AlX@a> wrote in message
> news:OMDqg1AAEHA.1032@TK2MSFTNGP10.phx.gbl...
> > It is impossible for a dispatch routine to complete another IRP then the
> one
> > was called for?
> > or
> > It is impossible to complete a IRP from another place then a dispatch
> > routine?
> >
> >
>
>



Re: IRP(s) by Farooque

Farooque
Tue Mar 02 07:20:12 CST 2004

> So, if from a system thread I call IoCompleteRequest it will complete the
> IRP?

Yes

--

-Farooque Khan
http://farooque.150m.com




"Alex" <AlX@a> wrote in message
news:uzCMUDFAEHA.2072@TK2MSFTNGP11.phx.gbl...
> So, if from a system thread I call IoCompleteRequest it will complete the
> IRP?
>
>
> "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com> wrote
in
> message news:%23W8V0UBAEHA.1468@tk2msftngp13.phx.gbl...
> > It's very much possible to complete an IRP
> > from place other than the dispatch routine. It's normal
> > to PEND an IRP in the dispatch routine and put
> > it in some queue. Then from some other place, take
> > this IRP out and complete it.
>
> Do, you mean complete it trough DDStartIo?
>
> >
> > --
> >
> > -Farooque Khan
> > http://farooque.150m.com
> >
> >
> >
> >
> > "Alex" <AlX@a> wrote in message
> > news:OMDqg1AAEHA.1032@TK2MSFTNGP10.phx.gbl...
> > > It is impossible for a dispatch routine to complete another IRP then
the
> > one
> > > was called for?
> > > or
> > > It is impossible to complete a IRP from another place then a dispatch
> > > routine?
> > >
> > >
> >
> >
>
>



Re: IRP(s) by Alex

Alex
Tue Mar 02 07:55:31 CST 2004

Calling IoCompleteRequest for IRP "a" in a dispatch routine that was called
for IRP "b" will complete the IRP "a" ?


"Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com> wrote in
message news:%23T0EKiFAEHA.1468@tk2msftngp13.phx.gbl...
> > So, if from a system thread I call IoCompleteRequest it will complete
the
> > IRP?
>
> Yes
>
> --
>
> -Farooque Khan
> http://farooque.150m.com
>
>
>
>
> "Alex" <AlX@a> wrote in message
> news:uzCMUDFAEHA.2072@TK2MSFTNGP11.phx.gbl...
> > So, if from a system thread I call IoCompleteRequest it will complete
the
> > IRP?
> >
> >
> > "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com> wrote
> in
> > message news:%23W8V0UBAEHA.1468@tk2msftngp13.phx.gbl...
> > > It's very much possible to complete an IRP
> > > from place other than the dispatch routine. It's normal
> > > to PEND an IRP in the dispatch routine and put
> > > it in some queue. Then from some other place, take
> > > this IRP out and complete it.
> >
> > Do, you mean complete it trough DDStartIo?
> >
> > >
> > > --
> > >
> > > -Farooque Khan
> > > http://farooque.150m.com
> > >
> > >
> > >
> > >
> > > "Alex" <AlX@a> wrote in message
> > > news:OMDqg1AAEHA.1032@TK2MSFTNGP10.phx.gbl...
> > > > It is impossible for a dispatch routine to complete another IRP then
> the
> > > one
> > > > was called for?
> > > > or
> > > > It is impossible to complete a IRP from another place then a
dispatch
> > > > routine?
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: IRP(s) by Farooque

Farooque
Tue Mar 02 08:17:00 CST 2004

> Calling IoCompleteRequest for IRP "a" in a dispatch routine that was
called
> for IRP "b" will complete the IRP "a" ?

Yes. For completion of any IRP, the dispatch routine is not important.
Dispatch
routine is invoked just to let you know that an IRP was targetted towards
you. Now
what you do in the dispatch routine, does not matter (well, of course you
will have to do
something with the IRP, either complete it, pend etc.). For whichever IRP
you call IoCompleteRequest(),
will get completed. Even if you don't call it from the dispatch routine in
which it was given to you.

You should pick up some good book on Device drivers and kernel programming
and that
will explain you all this, in detail. (Check out WDM Driver Programming by
Walter Oney).

HTH,
--

-Farooque Khan
http://farooque.150m.com




"Alex" <AlX@a> wrote in message
news:eLvjM4FAEHA.3056@TK2MSFTNGP11.phx.gbl...
> Calling IoCompleteRequest for IRP "a" in a dispatch routine that was
called
> for IRP "b" will complete the IRP "a" ?
>
>
> "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com> wrote
in
> message news:%23T0EKiFAEHA.1468@tk2msftngp13.phx.gbl...
> > > So, if from a system thread I call IoCompleteRequest it will complete
> the
> > > IRP?
> >
> > Yes
> >
> > --
> >
> > -Farooque Khan
> > http://farooque.150m.com
> >
> >
> >
> >
> > "Alex" <AlX@a> wrote in message
> > news:uzCMUDFAEHA.2072@TK2MSFTNGP11.phx.gbl...
> > > So, if from a system thread I call IoCompleteRequest it will complete
> the
> > > IRP?
> > >
> > >
> > > "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com>
wrote
> > in
> > > message news:%23W8V0UBAEHA.1468@tk2msftngp13.phx.gbl...
> > > > It's very much possible to complete an IRP
> > > > from place other than the dispatch routine. It's normal
> > > > to PEND an IRP in the dispatch routine and put
> > > > it in some queue. Then from some other place, take
> > > > this IRP out and complete it.
> > >
> > > Do, you mean complete it trough DDStartIo?
> > >
> > > >
> > > > --
> > > >
> > > > -Farooque Khan
> > > > http://farooque.150m.com
> > > >
> > > >
> > > >
> > > >
> > > > "Alex" <AlX@a> wrote in message
> > > > news:OMDqg1AAEHA.1032@TK2MSFTNGP10.phx.gbl...
> > > > > It is impossible for a dispatch routine to complete another IRP
then
> > the
> > > > one
> > > > > was called for?
> > > > > or
> > > > > It is impossible to complete a IRP from another place then a
> dispatch
> > > > > routine?
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: IRP(s) by Alex

Alex
Tue Mar 02 08:22:11 CST 2004

Did you trayed that? I did and it ain't working. In fact what seem to decide
the fate of the IRP seem to be the return value of the dispatch routine.

Here, the test code:

PIRP drlIrp = NULL;

NTSTATUS FCore_DispatchRead(IN PDEVICE_OBJECT DeviceObject,IN PIRP Irp)

{

if (drlIrp)

{

drlIrp->IoStatus.Status = STATUS_SUCCESS;

drlIrp->IoStatus.Information = 5;

IoCompleteRequest(drlIrp, IO_NO_INCREMENT);

drlIrp = NULL;

}

PIO_STACK_LOCATION s =

IoGetCurrentIrpStackLocation(Irp);

Irp->IoStatus.Status = STATUS_PENDING;

Irp->IoStatus.Information = 0;

IoMarkIrpPending(Irp);

drlIrp = Irp;

cout << "FCore_DispatchRead(..)" EOLS;

return STATUS_PENDING;

}



"Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com> wrote in
message news:%23c715BGAEHA.3256@TK2MSFTNGP09.phx.gbl...
> > Calling IoCompleteRequest for IRP "a" in a dispatch routine that was
> called
> > for IRP "b" will complete the IRP "a" ?
>
> Yes. For completion of any IRP, the dispatch routine is not important.
> Dispatch
> routine is invoked just to let you know that an IRP was targetted towards
> you. Now
> what you do in the dispatch routine, does not matter (well, of course you
> will have to do
> something with the IRP, either complete it, pend etc.). For whichever IRP
> you call IoCompleteRequest(),
> will get completed. Even if you don't call it from the dispatch routine in
> which it was given to you.
>
> You should pick up some good book on Device drivers and kernel programming
> and that
> will explain you all this, in detail. (Check out WDM Driver Programming by
> Walter Oney).
>
> HTH,
> --
>
> -Farooque Khan
> http://farooque.150m.com
>
>
>
>
> "Alex" <AlX@a> wrote in message
> news:eLvjM4FAEHA.3056@TK2MSFTNGP11.phx.gbl...
> > Calling IoCompleteRequest for IRP "a" in a dispatch routine that was
> called
> > for IRP "b" will complete the IRP "a" ?
> >
> >
> > "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com> wrote
> in
> > message news:%23T0EKiFAEHA.1468@tk2msftngp13.phx.gbl...
> > > > So, if from a system thread I call IoCompleteRequest it will
complete
> > the
> > > > IRP?
> > >
> > > Yes
> > >
> > > --
> > >
> > > -Farooque Khan
> > > http://farooque.150m.com
> > >
> > >
> > >
> > >
> > > "Alex" <AlX@a> wrote in message
> > > news:uzCMUDFAEHA.2072@TK2MSFTNGP11.phx.gbl...
> > > > So, if from a system thread I call IoCompleteRequest it will
complete
> > the
> > > > IRP?
> > > >
> > > >
> > > > "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com>
> wrote
> > > in
> > > > message news:%23W8V0UBAEHA.1468@tk2msftngp13.phx.gbl...
> > > > > It's very much possible to complete an IRP
> > > > > from place other than the dispatch routine. It's normal
> > > > > to PEND an IRP in the dispatch routine and put
> > > > > it in some queue. Then from some other place, take
> > > > > this IRP out and complete it.
> > > >
> > > > Do, you mean complete it trough DDStartIo?
> > > >
> > > > >
> > > > > --
> > > > >
> > > > > -Farooque Khan
> > > > > http://farooque.150m.com
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > "Alex" <AlX@a> wrote in message
> > > > > news:OMDqg1AAEHA.1032@TK2MSFTNGP10.phx.gbl...
> > > > > > It is impossible for a dispatch routine to complete another IRP
> then
> > > the
> > > > > one
> > > > > > was called for?
> > > > > > or
> > > > > > It is impossible to complete a IRP from another place then a
> > dispatch
> > > > > > routine?
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: IRP(s) by Gary

Gary
Tue Mar 02 08:36:54 CST 2004

Well, technically yes ... but ... if you have a completion routine set, then
all of the completion routines get called. The IRP may not be completed
exactly when you expect it, which is why you can't touch it after passing it
on.

--
Gary G. Little
Seagate Technologies, LLC

"Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com> wrote in
message news:%23T0EKiFAEHA.1468@tk2msftngp13.phx.gbl...
> > So, if from a system thread I call IoCompleteRequest it will complete
the
> > IRP?
>
> Yes
>
> --
>
> -Farooque Khan
> http://farooque.150m.com
>
>
>
>
> "Alex" <AlX@a> wrote in message
> news:uzCMUDFAEHA.2072@TK2MSFTNGP11.phx.gbl...
> > So, if from a system thread I call IoCompleteRequest it will complete
the
> > IRP?
> >
> >
> > "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com> wrote
> in
> > message news:%23W8V0UBAEHA.1468@tk2msftngp13.phx.gbl...
> > > It's very much possible to complete an IRP
> > > from place other than the dispatch routine. It's normal
> > > to PEND an IRP in the dispatch routine and put
> > > it in some queue. Then from some other place, take
> > > this IRP out and complete it.
> >
> > Do, you mean complete it trough DDStartIo?
> >
> > >
> > > --
> > >
> > > -Farooque Khan
> > > http://farooque.150m.com
> > >
> > >
> > >
> > >
> > > "Alex" <AlX@a> wrote in message
> > > news:OMDqg1AAEHA.1032@TK2MSFTNGP10.phx.gbl...
> > > > It is impossible for a dispatch routine to complete another IRP then
> the
> > > one
> > > > was called for?
> > > > or
> > > > It is impossible to complete a IRP from another place then a
dispatch
> > > > routine?
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: IRP(s) by Gary

Gary
Tue Mar 02 08:46:48 CST 2004

Sure ... classic example is terminating the app, having many IRP's queued
from only God knows where. Every one of them has to be cancelled or
completed or the app will hang.

--
Gary G. Little
Seagate Technologies, LLC

"Alex" <AlX@a> wrote in message
news:eLvjM4FAEHA.3056@TK2MSFTNGP11.phx.gbl...
> Calling IoCompleteRequest for IRP "a" in a dispatch routine that was
called
> for IRP "b" will complete the IRP "a" ?
>
>
> "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com> wrote
in
> message news:%23T0EKiFAEHA.1468@tk2msftngp13.phx.gbl...
> > > So, if from a system thread I call IoCompleteRequest it will complete
> the
> > > IRP?
> >
> > Yes
> >
> > --
> >
> > -Farooque Khan
> > http://farooque.150m.com
> >
> >
> >
> >
> > "Alex" <AlX@a> wrote in message
> > news:uzCMUDFAEHA.2072@TK2MSFTNGP11.phx.gbl...
> > > So, if from a system thread I call IoCompleteRequest it will complete
> the
> > > IRP?
> > >
> > >
> > > "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com>
wrote
> > in
> > > message news:%23W8V0UBAEHA.1468@tk2msftngp13.phx.gbl...
> > > > It's very much possible to complete an IRP
> > > > from place other than the dispatch routine. It's normal
> > > > to PEND an IRP in the dispatch routine and put
> > > > it in some queue. Then from some other place, take
> > > > this IRP out and complete it.
> > >
> > > Do, you mean complete it trough DDStartIo?
> > >
> > > >
> > > > --
> > > >
> > > > -Farooque Khan
> > > > http://farooque.150m.com
> > > >
> > > >
> > > >
> > > >
> > > > "Alex" <AlX@a> wrote in message
> > > > news:OMDqg1AAEHA.1032@TK2MSFTNGP10.phx.gbl...
> > > > > It is impossible for a dispatch routine to complete another IRP
then
> > the
> > > > one
> > > > > was called for?
> > > > > or
> > > > > It is impossible to complete a IRP from another place then a
> dispatch
> > > > > routine?
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: IRP(s) by Farooque

Farooque
Tue Mar 02 09:01:48 CST 2004

> the fate of the IRP seem to be the return value of the dispatch routine.

Yes, I didn't give you details. If you are pending the original IRP, you
need to
call IoMarkPending() on it, set completion routine for it, put it some where
(some sort of queue) to retrieve later,
then return STATUS_PENDING.

There are a few articles at www.osronline.com about IRP pending, you may
refer that.

HTH,
--

-Farooque Khan
http://farooque.150m.com




"Alex" <AlX@a> wrote in message
news:%23KTwFHGAEHA.2036@TK2MSFTNGP12.phx.gbl...
> Did you trayed that? I did and it ain't working. In fact what seem to
decide
> the fate of the IRP seem to be the return value of the dispatch routine.
>
> Here, the test code:
>
> PIRP drlIrp = NULL;
>
> NTSTATUS FCore_DispatchRead(IN PDEVICE_OBJECT DeviceObject,IN PIRP Irp)
>
> {
>
> if (drlIrp)
>
> {
>
> drlIrp->IoStatus.Status = STATUS_SUCCESS;
>
> drlIrp->IoStatus.Information = 5;
>
> IoCompleteRequest(drlIrp, IO_NO_INCREMENT);
>
> drlIrp = NULL;
>
> }
>
> PIO_STACK_LOCATION s =
>
> IoGetCurrentIrpStackLocation(Irp);
>
> Irp->IoStatus.Status = STATUS_PENDING;
>
> Irp->IoStatus.Information = 0;
>
> IoMarkIrpPending(Irp);
>
> drlIrp = Irp;
>
> cout << "FCore_DispatchRead(..)" EOLS;
>
> return STATUS_PENDING;
>
> }
>
>
>
> "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com> wrote
in
> message news:%23c715BGAEHA.3256@TK2MSFTNGP09.phx.gbl...
> > > Calling IoCompleteRequest for IRP "a" in a dispatch routine that was
> > called
> > > for IRP "b" will complete the IRP "a" ?
> >
> > Yes. For completion of any IRP, the dispatch routine is not important.
> > Dispatch
> > routine is invoked just to let you know that an IRP was targetted
towards
> > you. Now
> > what you do in the dispatch routine, does not matter (well, of course
you
> > will have to do
> > something with the IRP, either complete it, pend etc.). For whichever
IRP
> > you call IoCompleteRequest(),
> > will get completed. Even if you don't call it from the dispatch routine
in
> > which it was given to you.
> >
> > You should pick up some good book on Device drivers and kernel
programming
> > and that
> > will explain you all this, in detail. (Check out WDM Driver Programming
by
> > Walter Oney).
> >
> > HTH,
> > --
> >
> > -Farooque Khan
> > http://farooque.150m.com
> >
> >
> >
> >
> > "Alex" <AlX@a> wrote in message
> > news:eLvjM4FAEHA.3056@TK2MSFTNGP11.phx.gbl...
> > > Calling IoCompleteRequest for IRP "a" in a dispatch routine that was
> > called
> > > for IRP "b" will complete the IRP "a" ?
> > >
> > >
> > > "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com>
wrote
> > in
> > > message news:%23T0EKiFAEHA.1468@tk2msftngp13.phx.gbl...
> > > > > So, if from a system thread I call IoCompleteRequest it will
> complete
> > > the
> > > > > IRP?
> > > >
> > > > Yes
> > > >
> > > > --
> > > >
> > > > -Farooque Khan
> > > > http://farooque.150m.com
> > > >
> > > >
> > > >
> > > >
> > > > "Alex" <AlX@a> wrote in message
> > > > news:uzCMUDFAEHA.2072@TK2MSFTNGP11.phx.gbl...
> > > > > So, if from a system thread I call IoCompleteRequest it will
> complete
> > > the
> > > > > IRP?
> > > > >
> > > > >
> > > > > "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com>
> > wrote
> > > > in
> > > > > message news:%23W8V0UBAEHA.1468@tk2msftngp13.phx.gbl...
> > > > > > It's very much possible to complete an IRP
> > > > > > from place other than the dispatch routine. It's normal
> > > > > > to PEND an IRP in the dispatch routine and put
> > > > > > it in some queue. Then from some other place, take
> > > > > > this IRP out and complete it.
> > > > >
> > > > > Do, you mean complete it trough DDStartIo?
> > > > >
> > > > > >
> > > > > > --
> > > > > >
> > > > > > -Farooque Khan
> > > > > > http://farooque.150m.com
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > "Alex" <AlX@a> wrote in message
> > > > > > news:OMDqg1AAEHA.1032@TK2MSFTNGP10.phx.gbl...
> > > > > > > It is impossible for a dispatch routine to complete another
IRP
> > then
> > > > the
> > > > > > one
> > > > > > > was called for?
> > > > > > > or
> > > > > > > It is impossible to complete a IRP from another place then a
> > > dispatch
> > > > > > > routine?
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: IRP(s) by Alex

Alex
Tue Mar 02 10:47:32 CST 2004


"Alex" <AlX@a> wrote in message
news:%23KTwFHGAEHA.2036@TK2MSFTNGP12.phx.gbl...
> Did you trayed that? I did and it ain't working. In fact what seem to
decide
> the fate of the IRP seem to be the return value of the dispatch routine.

> Irp->IoStatus.Status = STATUS_PENDING;



Someone might have pointed that this is a bad thing to do, since noone did,
I do it :)



>
>
>
> "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com> wrote
in
> message news:%23c715BGAEHA.3256@TK2MSFTNGP09.phx.gbl...
> > > Calling IoCompleteRequest for IRP "a" in a dispatch routine that was
> > called
> > > for IRP "b" will complete the IRP "a" ?
> >
> > Yes. For completion of any IRP, the dispatch routine is not important.
> > Dispatch
> > routine is invoked just to let you know that an IRP was targetted
towards
> > you. Now
> > what you do in the dispatch routine, does not matter (well, of course
you
> > will have to do
> > something with the IRP, either complete it, pend etc.). For whichever
IRP
> > you call IoCompleteRequest(),
> > will get completed. Even if you don't call it from the dispatch routine
in
> > which it was given to you.
> >
> > You should pick up some good book on Device drivers and kernel
programming
> > and that
> > will explain you all this, in detail. (Check out WDM Driver Programming
by
> > Walter Oney).
> >
> > HTH,
> > --
> >
> > -Farooque Khan
> > http://farooque.150m.com
> >
> >
> >
> >
> > "Alex" <AlX@a> wrote in message
> > news:eLvjM4FAEHA.3056@TK2MSFTNGP11.phx.gbl...
> > > Calling IoCompleteRequest for IRP "a" in a dispatch routine that was
> > called
> > > for IRP "b" will complete the IRP "a" ?
> > >
> > >
> > > "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com>
wrote
> > in
> > > message news:%23T0EKiFAEHA.1468@tk2msftngp13.phx.gbl...
> > > > > So, if from a system thread I call IoCompleteRequest it will
> complete
> > > the
> > > > > IRP?
> > > >
> > > > Yes
> > > >
> > > > --
> > > >
> > > > -Farooque Khan
> > > > http://farooque.150m.com
> > > >
> > > >
> > > >
> > > >
> > > > "Alex" <AlX@a> wrote in message
> > > > news:uzCMUDFAEHA.2072@TK2MSFTNGP11.phx.gbl...
> > > > > So, if from a system thread I call IoCompleteRequest it will
> complete
> > > the
> > > > > IRP?
> > > > >
> > > > >
> > > > > "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com>
> > wrote
> > > > in
> > > > > message news:%23W8V0UBAEHA.1468@tk2msftngp13.phx.gbl...
> > > > > > It's very much possible to complete an IRP
> > > > > > from place other than the dispatch routine. It's normal
> > > > > > to PEND an IRP in the dispatch routine and put
> > > > > > it in some queue. Then from some other place, take
> > > > > > this IRP out and complete it.
> > > > >
> > > > > Do, you mean complete it trough DDStartIo?
> > > > >
> > > > > >
> > > > > > --
> > > > > >
> > > > > > -Farooque Khan
> > > > > > http://farooque.150m.com
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > "Alex" <AlX@a> wrote in message
> > > > > > news:OMDqg1AAEHA.1032@TK2MSFTNGP10.phx.gbl...
> > > > > > > It is impossible for a dispatch routine to complete another
IRP
> > then
> > > > the
> > > > > > one
> > > > > > > was called for?
> > > > > > > or
> > > > > > > It is impossible to complete a IRP from another place then a
> > > dispatch
> > > > > > > routine?
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: IRP(s) by Alex

Alex
Tue Mar 02 20:26:33 CST 2004

Ma bad, I must have been sleeping or something, because indeed it works
:)


"Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com> wrote in
message news:eiMo7aGAEHA.916@tk2msftngp13.phx.gbl...
> > the fate of the IRP seem to be the return value of the dispatch routine.
>
> Yes, I didn't give you details. If you are pending the original IRP, you
> need to
> call IoMarkPending() on it, set completion routine for it, put it some
where
> (some sort of queue) to retrieve later,
> then return STATUS_PENDING.
>
> There are a few articles at www.osronline.com about IRP pending, you may
> refer that.
>
> HTH,
> --
>
> -Farooque Khan
> http://farooque.150m.com
>
>
>
>
> "Alex" <AlX@a> wrote in message
> news:%23KTwFHGAEHA.2036@TK2MSFTNGP12.phx.gbl...
> > Did you trayed that? I did and it ain't working. In fact what seem to
> decide
> > the fate of the IRP seem to be the return value of the dispatch routine.
> >
> > Here, the test code:
> >
> > PIRP drlIrp = NULL;
> >
> > NTSTATUS FCore_DispatchRead(IN PDEVICE_OBJECT DeviceObject,IN PIRP Irp)
> >
> > {
> >
> > if (drlIrp)
> >
> > {
> >
> > drlIrp->IoStatus.Status = STATUS_SUCCESS;
> >
> > drlIrp->IoStatus.Information = 5;
> >
> > IoCompleteRequest(drlIrp, IO_NO_INCREMENT);
> >
> > drlIrp = NULL;
> >
> > }
> >
> > PIO_STACK_LOCATION s =
> >
> > IoGetCurrentIrpStackLocation(Irp);
> >
> > Irp->IoStatus.Status = STATUS_PENDING;
> >
> > Irp->IoStatus.Information = 0;
> >
> > IoMarkIrpPending(Irp);
> >
> > drlIrp = Irp;
> >
> > cout << "FCore_DispatchRead(..)" EOLS;
> >
> > return STATUS_PENDING;
> >
> > }
> >
> >
> >
> > "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com> wrote
> in
> > message news:%23c715BGAEHA.3256@TK2MSFTNGP09.phx.gbl...
> > > > Calling IoCompleteRequest for IRP "a" in a dispatch routine that was
> > > called
> > > > for IRP "b" will complete the IRP "a" ?
> > >
> > > Yes. For completion of any IRP, the dispatch routine is not important.
> > > Dispatch
> > > routine is invoked just to let you know that an IRP was targetted
> towards
> > > you. Now
> > > what you do in the dispatch routine, does not matter (well, of course
> you
> > > will have to do
> > > something with the IRP, either complete it, pend etc.). For whichever
> IRP
> > > you call IoCompleteRequest(),
> > > will get completed. Even if you don't call it from the dispatch
routine
> in
> > > which it was given to you.
> > >
> > > You should pick up some good book on Device drivers and kernel
> programming
> > > and that
> > > will explain you all this, in detail. (Check out WDM Driver
Programming
> by
> > > Walter Oney).
> > >
> > > HTH,
> > > --
> > >
> > > -Farooque Khan
> > > http://farooque.150m.com
> > >
> > >
> > >
> > >
> > > "Alex" <AlX@a> wrote in message
> > > news:eLvjM4FAEHA.3056@TK2MSFTNGP11.phx.gbl...
> > > > Calling IoCompleteRequest for IRP "a" in a dispatch routine that was
> > > called
> > > > for IRP "b" will complete the IRP "a" ?
> > > >
> > > >
> > > > "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com>
> wrote
> > > in
> > > > message news:%23T0EKiFAEHA.1468@tk2msftngp13.phx.gbl...
> > > > > > So, if from a system thread I call IoCompleteRequest it will
> > complete
> > > > the
> > > > > > IRP?
> > > > >
> > > > > Yes
> > > > >
> > > > > --
> > > > >
> > > > > -Farooque Khan
> > > > > http://farooque.150m.com
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > "Alex" <AlX@a> wrote in message
> > > > > news:uzCMUDFAEHA.2072@TK2MSFTNGP11.phx.gbl...
> > > > > > So, if from a system thread I call IoCompleteRequest it will
> > complete
> > > > the
> > > > > > IRP?
> > > > > >
> > > > > >
> > > > > > "Farooque Khan"
<farooquek@NoSpamPls-concretioindia-NoSpamPls.com>
> > > wrote
> > > > > in
> > > > > > message news:%23W8V0UBAEHA.1468@tk2msftngp13.phx.gbl...
> > > > > > > It's very much possible to complete an IRP
> > > > > > > from place other than the dispatch routine. It's normal
> > > > > > > to PEND an IRP in the dispatch routine and put
> > > > > > > it in some queue. Then from some other place, take
> > > > > > > this IRP out and complete it.
> > > > > >
> > > > > > Do, you mean complete it trough DDStartIo?
> > > > > >
> > > > > > >
> > > > > > > --
> > > > > > >
> > > > > > > -Farooque Khan
> > > > > > > http://farooque.150m.com
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > "Alex" <AlX@a> wrote in message
> > > > > > > news:OMDqg1AAEHA.1032@TK2MSFTNGP10.phx.gbl...
> > > > > > > > It is impossible for a dispatch routine to complete another
> IRP
> > > then
> > > > > the
> > > > > > > one
> > > > > > > > was called for?
> > > > > > > > or
> > > > > > > > It is impossible to complete a IRP from another place then a
> > > > dispatch
> > > > > > > > routine?
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: IRP(s) by Alexander

Alexander
Tue Mar 02 21:38:20 CST 2004

You meant "set cancel routine".

"Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com> wrote in
message news:eiMo7aGAEHA.916@tk2msftngp13.phx.gbl...
> > the fate of the IRP seem to be the return value of the dispatch routine.
>
> Yes, I didn't give you details. If you are pending the original IRP, you
> need to
> call IoMarkPending() on it, set completion routine for it, put it some
where
> (some sort of queue) to retrieve later,
> then return STATUS_PENDING.
>
> There are a few articles at www.osronline.com about IRP pending, you may
> refer that.
>
> HTH,
> --
>
> -Farooque Khan
> http://farooque.150m.com
>
>
>
>
> "Alex" <AlX@a> wrote in message
> news:%23KTwFHGAEHA.2036@TK2MSFTNGP12.phx.gbl...
> > Did you trayed that? I did and it ain't working. In fact what seem to
> decide
> > the fate of the IRP seem to be the return value of the dispatch routine.
> >
> > Here, the test code:
> >
> > PIRP drlIrp = NULL;
> >
> > NTSTATUS FCore_DispatchRead(IN PDEVICE_OBJECT DeviceObject,IN PIRP Irp)
> >
> > {
> >
> > if (drlIrp)
> >
> > {
> >
> > drlIrp->IoStatus.Status = STATUS_SUCCESS;
> >
> > drlIrp->IoStatus.Information = 5;
> >
> > IoCompleteRequest(drlIrp, IO_NO_INCREMENT);
> >
> > drlIrp = NULL;
> >
> > }
> >
> > PIO_STACK_LOCATION s =
> >
> > IoGetCurrentIrpStackLocation(Irp);
> >
> > Irp->IoStatus.Status = STATUS_PENDING;
> >
> > Irp->IoStatus.Information = 0;
> >
> > IoMarkIrpPending(Irp);
> >
> > drlIrp = Irp;
> >
> > cout << "FCore_DispatchRead(..)" EOLS;
> >
> > return STATUS_PENDING;
> >
> > }
> >
> >
> >
> > "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com> wrote
> in
> > message news:%23c715BGAEHA.3256@TK2MSFTNGP09.phx.gbl...
> > > > Calling IoCompleteRequest for IRP "a" in a dispatch routine that was
> > > called
> > > > for IRP "b" will complete the IRP "a" ?
> > >
> > > Yes. For completion of any IRP, the dispatch routine is not important.
> > > Dispatch
> > > routine is invoked just to let you know that an IRP was targetted
> towards
> > > you. Now
> > > what you do in the dispatch routine, does not matter (well, of course
> you
> > > will have to do
> > > something with the IRP, either complete it, pend etc.). For whichever
> IRP
> > > you call IoCompleteRequest(),
> > > will get completed. Even if you don't call it from the dispatch
routine
> in
> > > which it was given to you.
> > >
> > > You should pick up some good book on Device drivers and kernel
> programming
> > > and that
> > > will explain you all this, in detail. (Check out WDM Driver
Programming
> by
> > > Walter Oney).
> > >
> > > HTH,
> > > --
> > >
> > > -Farooque Khan
> > > http://farooque.150m.com
> > >
> > >
> > >
> > >
> > > "Alex" <AlX@a> wrote in message
> > > news:eLvjM4FAEHA.3056@TK2MSFTNGP11.phx.gbl...
> > > > Calling IoCompleteRequest for IRP "a" in a dispatch routine that was
> > > called
> > > > for IRP "b" will complete the IRP "a" ?
> > > >
> > > >
> > > > "Farooque Khan" <farooquek@NoSpamPls-concretioindia-NoSpamPls.com>
> wrote
> > > in
> > > > message news:%23T0EKiFAEHA.1468@tk2msftngp13.phx.gbl...
> > > > > > So, if from a system thread I call IoCompleteRequest it will
> > complete
> > > > the
> > > > > > IRP?
> > > > >
> > > > > Yes
> > > > >
> > > > > --
> > > > >
> > > > > -Farooque Khan
> > > > > http://farooque.150m.com
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > "Alex" <AlX@a> wrote in message
> > > > > news:uzCMUDFAEHA.2072@TK2MSFTNGP11.phx.gbl...
> > > > > > So, if from a system thread I call IoCompleteRequest it will
> > complete
> > > > the
> > > > > > IRP?
> > > > > >
> > > > > >
> > > > > > "Farooque Khan"
<farooquek@NoSpamPls-concretioindia-NoSpamPls.com>
> > > wrote
> > > > > in
> > > > > > message news:%23W8V0UBAEHA.1468@tk2msftngp13.phx.gbl...
> > > > > > > It's very much possible to complete an IRP
> > > > > > > from place other than the dispatch routine. It's normal
> > > > > > > to PEND an IRP in the dispatch routine and put
> > > > > > > it in some queue. Then from some other place, take
> > > > > > > this IRP out and complete it.
> > > > > >
> > > > > > Do, you mean complete it trough DDStartIo?
> > > > > >
> > > > > > >
> > > > > > > --
> > > > > > >
> > > > > > > -Farooque Khan
> > > > > > > http://farooque.150m.com
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > "Alex" <AlX@a> wrote in message
> > > > > > > news:OMDqg1AAEHA.1032@TK2MSFTNGP10.phx.gbl...
> > > > > > > > It is impossible for a dispatch routine to complete another
> IRP
> > > then
> > > > > the
> > > > > > > one
> > > > > > > > was called for?
> > > > > > > > or
> > > > > > > > It is impossible to complete a IRP from another place then a
> > > > dispatch
> > > > > > > > routine?
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>