Problem with IoSetCompletionRoutine

Hi all

I am trying to allocate multiple IRP and reuse them in my driver. When I am
calling IoSetCompletionRoutine with in completion routine,it is running as
if it is in Infinite loop with the single IRP . Any suggestions how to solve
this problem ?

Thanks in advance
srinivas


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Answer to problem is in your post only… You are requesting completion
routine for same Irp within it, it will call once again the same… To
handle this situation before processing any Irp in your completion routine
check for the Irp which you want to set completion routine…
Bharat
----- Original Message -----
From: “Srinivasa Rao Deevi”
To: “NT Developers Interest List”
Sent: Wednesday, June 20, 2001 10:46 AM
Subject: [ntdev] Problem with IoSetCompletionRoutine

> Hi all
>
> I am trying to allocate multiple IRP and reuse them in my driver. When I
am
> calling IoSetCompletionRoutine with in completion routine,it is running as
> if it is in Infinite loop with the single IRP . Any suggestions how to
solve
> this problem ?
>
> Thanks in advance
> srinivas
>
> —
> You are currently subscribed to ntdev as: xxxxx@wipro.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi Srinivas,

I believe you are not keeping the number of IRPs generated. The count
should be made available in the Completion routine (usually stored in
“orgIrpStack->Parameters.Others.Argument1”). You need to decrement the
value on each IRP completion. When your final IRP is completed you need to
complete the original IRP. If the completion routine is not for the last
IRP then simply decrement, clean if required and return.
The other possibility is that the generation of IRP is not controlled. i.e.
the IRPs are generated with no stop.

This is best illustrated in the DDK sample driver “class.c”

Hope this helps…

Regards,
Prasanna.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Srinivasa Rao Deevi
Sent: Wednesday, June 20, 2001 10:46 AM
To: NT Developers Interest List
Subject: [ntdev] Problem with IoSetCompletionRoutine

Hi all

I am trying to allocate multiple IRP and reuse them in my driver. When I am
calling IoSetCompletionRoutine with in completion routine,it is running as
if it is in Infinite loop with the single IRP . Any suggestions how to solve
this problem ?

Thanks in advance
srinivas


You are currently subscribed to ntdev as: xxxxx@tataelxsi.co.in
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi Prasanna

Thanks for the response . I wanted to use IRP’s as it was in the isousb
example which allocates IRP’s and reusing them continuously . In that sample
it allocates two IRP’s and reuse the IRP’s continuously one after the other
. I am not sure about the mechanism what was in sample driver is good or
not . But I see failure if I tried to do the same . I don’t know what I am
missing in this . I checked the IRP pointers and Structure pointers passing
to completion routine . They are fine . The IoCallDriver does not send the
request properly I believe. I am not sure how to have control over that .

Anybody has any ideas or suggestions about it ?

Thanks in advance
srinivas

-----Original Message-----
From: Prasanna B R [mailto:xxxxx@tataelxsi.co.in]
Sent: Wednesday, June 20, 2001 12:50 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Problem with IoSetCompletionRoutine

Hi Srinivas,

I believe you are not keeping the number of IRPs generated. The count
should be made available in the Completion routine (usually stored in
“orgIrpStack->Parameters.Others.Argument1”). You need to decrement the
value on each IRP completion. When your final IRP is completed you need to
complete the original IRP. If the completion routine is not for the last
IRP then simply decrement, clean if required and return.
The other possibility is that the generation of IRP is not controlled. i.e.
the IRPs are generated with no stop.

This is best illustrated in the DDK sample driver “class.c”

Hope this helps…

Regards,
Prasanna.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Srinivasa Rao Deevi
Sent: Wednesday, June 20, 2001 10:46 AM
To: NT Developers Interest List
Subject: [ntdev] Problem with IoSetCompletionRoutine

Hi all

I am trying to allocate multiple IRP and reuse them in my driver. When I am
calling IoSetCompletionRoutine with in completion routine,it is running as
if it is in Infinite loop with the single IRP . Any suggestions how to solve
this problem ?

Thanks in advance
srinivas


You are currently subscribed to ntdev as: xxxxx@tataelxsi.co.in
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@transilica.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> I am trying to allocate multiple IRP and reuse them in my driver.

Why? IoAllocateIrp is very fast - are you sure that it is a good idea to
write your own IoAllocateIrp?

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi Max

Thanks for the response . I am not allocating IRP’s multiple times . My idea
is to use the same IRP multiple times . I did not understand what you are
trying to say . I don’t think it matters how fast it is when it is allocated
only once . what do you think ?

regards
srinivas

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Friday, June 22, 2001 5:58 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Problem with IoSetCompletionRoutine

I am trying to allocate multiple IRP and reuse them in my driver.

Why? IoAllocateIrp is very fast - are you sure that it is a good idea to
write your own IoAllocateIrp?

Max


You are currently subscribed to ntdev as: xxxxx@transilica.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> Thanks for the response . I am not allocating IRP’s multiple times . My
idea

is to use the same IRP multiple times . I did not understand what you are

Then my suggestion is to disassemble IoReuseIrp from NT and code the same
function for Win9x drivers.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com