Recursive completion routine ?

Hi All,

I have a driver that sets the completion routine and when routine is called
by the lower driver it creates a new IRP (with completion routine pointing
to the same function) and sends it down again.
Is this reasonable ? What is the right way to create a new IRP on completion
of another IRP ?

Regards,
Stas.
**************************************************************************************************
The contents of this email and any attachments are confidential.
It is intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or the
sender immediately and do not disclose the contents to any one or make copies.

** eSafe scanned this email for viruses, vandals and malicious content **
**************************************************************************************************

Sounds OK to me; we do something very similar. The only issues is that
the completion routine can be called in an arbitrary process context and
at a raised IRQL. Make sure you stay on your toes.

Jamey Kirby
StorageCraft, inc.
xxxxx@storagecraft.com
www.storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Stass Desyatnikov
Sent: Sunday, March 31, 2002 2:26 AM
To: NT Developers Interest List
Subject: [ntdev] Recursive completion routine ?

Hi All,

I have a driver that sets the completion routine and when routine is
called
by the lower driver it creates a new IRP (with completion routine
pointing
to the same function) and sends it down again.
Is this reasonable ? What is the right way to create a new IRP on
completion
of another IRP ?

Regards,
Stas.
************************************************************************
**************************
The contents of this email and any attachments are confidential.
It is intended for the named recipient(s) only.
If you have received this email in error please notify the system
manager or the
sender immediately and do not disclose the contents to any one or make
copies.

** eSafe scanned this email for viruses, vandals and malicious content
**
************************************************************************
**************************


You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

You also have to watch out for stack overflow. In the storage stack this
is very possible.

=====================
Mark Roddy
Windows XP/2000/NT Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com
xxxxx@hollistech.com
For Windows Device Driver Training: see www.azius.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jamey Kirby
Sent: Sunday, March 31, 2002 12:21 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Recursive completion routine ?

Sounds OK to me; we do something very similar. The only
issues is that the completion routine can be called in an
arbitrary process context and at a raised IRQL. Make sure you
stay on your toes.

Jamey Kirby
StorageCraft, inc.
xxxxx@storagecraft.com
www.storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On > Behalf Of Stass
Desyatnikov
Sent: Sunday, March 31, 2002 2:26 AM
To: NT Developers Interest List
Subject: [ntdev] Recursive completion routine ?

Hi All,

I have a driver that sets the completion routine and when
routine is called by the lower driver it creates a new IRP
(with completion routine pointing to the same function) and
sends it down again. Is this reasonable ? What is the right
way to create a new IRP on completion of another IRP ?

Regards,
Stas.
**************************************************************
**********
**************************
The contents of this email and any attachments are
confidential. It is intended for the named recipient(s) only.
If you have received this email in error please notify the
system manager or the
sender immediately and do not disclose the contents to any
one or make copies.

** eSafe scanned this email for viruses, vandals and malicious content
**
**************************************************************
**********
**************************


You are currently subscribed to ntdev as:
xxxxx@storagecraft.com To unsubscribe send a blank email to
%%email.unsub%%


You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
%%email.unsub%%

What stack namely?
In disk and 1394 stacks, this works fine.
Filesystems can crash on it - since the completion can be called on DISPATCH_LEVEL, and filesystems cannot tolerate their dispatch
entry points to be called on such and IRQL.

Max

----- Original Message -----
From: “Stass Desyatnikov”
To: “NT Developers Interest List”
Sent: Sunday, March 31, 2002 2:26 PM
Subject: [ntdev] Recursive completion routine ?

> Hi All,
>
> I have a driver that sets the completion routine and when routine is called
> by the lower driver it creates a new IRP (with completion routine pointing
> to the same function) and sends it down again.
> Is this reasonable ? What is the right way to create a new IRP on completion
> of another IRP ?
>
> Regards,
> Stas.
>
> The contents of this email and any attachments are confidential.
> It is intended for the named recipient(s) only.
> If you have received this email in error please notify the system manager or the
> sender immediately and do not disclose the contents to any one or make copies.
>
>
eSafe scanned this email for viruses, vandals and malicious content
>

>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to %%email.unsub%%
>

Hi Stas!
How about doing this?

  1. After you send the IRP down the first time, wait on
    an event.
  2. In the completion routine, signal the event.
  3. Now when your wait is over send down the IRP again
    (not from your completion routine but from the routine
    that sent it down first.)
    Wouldn’t that be simpler and cleaner? No IRQL
    problems and no stack over flow problems.
    Are there any reasons for you not to do that?
    Regards,
    Manoj

— Stass Desyatnikov
wrote: > Hi All,
>
> I have a driver that sets the completion routine and
> when routine is called
> by the lower driver it creates a new IRP (with
> completion routine pointing
> to the same function) and sends it down again.
> Is this reasonable ? What is the right way to create
> a new IRP on completion
> of another IRP ?
>
> Regards,
> Stas.
>

> The contents of this email and any attachments are
> confidential.
> It is intended for the named recipient(s) only.
> If you have received this email in error please
> notify the system manager or the
> sender immediately and do not disclose the contents
> to any one or make copies.
>
>
eSafe scanned this email for viruses, vandals and
> malicious content
>

>
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
%%email.unsub%%

=====
-----------------------------------
Manoj Paul Joseph,
Master of Computer Applications (final year student),
School of Computer Science and Engineering,
Anna University,
Chennai (Madras),
India.

________________________________________________________________________
For live cricket scores download Yahoo! Score Tracker
at: http://in.sports.yahoo.com/cricket/tracker.html

Thanx for the tip, No there is no particular reason to do it the way I
described it is just the existing code that I inherited.
Thanx again,
Stas,

-----Original Message-----
From: Manoj Paul Joseph [mailto:xxxxx@yahoo.com]
Sent: Tuesday, April 02, 2002 6:45 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Recursive completion routine ?

Hi Stas!
How about doing this?

  1. After you send the IRP down the first time, wait on
    an event.
  2. In the completion routine, signal the event.
  3. Now when your wait is over send down the IRP again
    (not from your completion routine but from the routine
    that sent it down first.)
    Wouldn’t that be simpler and cleaner? No IRQL
    problems and no stack over flow problems.
    Are there any reasons for you not to do that?
    Regards,
    Manoj

— Stass Desyatnikov
wrote: > Hi All,
>
> I have a driver that sets the completion routine and
> when routine is called
> by the lower driver it creates a new IRP (with
> completion routine pointing
> to the same function) and sends it down again.
> Is this reasonable ? What is the right way to create
> a new IRP on completion
> of another IRP ?
>
> Regards,
> Stas.
>
******************************************************

> The contents of this email and any attachments are
> confidential.
> It is intended for the named recipient(s) only.
> If you have received this email in error please
> notify the system manager or the
> sender immediately and do not disclose the contents
> to any one or make copies.
>
> eSafe scanned this email for viruses, vandals and
> malicious content

>
******************************************************

>
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
%%email.unsub%%

=====
-----------------------------------
Manoj Paul Joseph,
Master of Computer Applications (final year student),
School of Computer Science and Engineering,
Anna University,
Chennai (Madras),
India.

________________________________________________________________________
For live cricket scores download Yahoo! Score Tracker
at: http://in.sports.yahoo.com/cricket/tracker.html


You are currently subscribed to ntdev as: xxxxx@Emblaze.com
To unsubscribe send a blank email to %%email.unsub%%