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?
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>