The MSDN docs contain no info about IRQL requirements when calling
IoGetCurrentIrpStackLocation. I was following some code in Art Baker’s
book for resending an Irp in a completion routine. The completion routine
was running at DISPATCH_LEVEL in Win2K. The Irp I used in the call was
created at PASSIVE_LEVEL. When the call to
IoGetCurrentIrpStackLocation(Irp) happens in the completion routine –
KABLOOEY – BSOD.
Is this because of the IRQL difference when I called IoAllocateIrp?
Is it a difference between NT4 and Win2K?
Can you not use IoGetCurrentIrpStackLocation at DISPATCH_LEVEL???
Nope. Go look at IoGetCurrentIrpStackLocation in ntddk.h - it is a MACRO
that dereferences a field out of the IRP itself. If it blew up, it is
because the IRP is trashed.
Regards,
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc. http://www.osr.com
-----Original Message-----
From: skip [mailto:xxxxx@hotmail.com]
Sent: Wednesday, April 17, 2002 4:23 PM
To: NT Developers Interest List
Subject: [ntdev] IoGetCurrentIrpStackLocation
Hi all,
The MSDN docs contain no info about IRQL requirements when calling
IoGetCurrentIrpStackLocation. I was following some code in Art Baker’s
book for resending an Irp in a completion routine. The completion routine
was running at DISPATCH_LEVEL in Win2K. The Irp I used in the call was
created at PASSIVE_LEVEL. When the call to
IoGetCurrentIrpStackLocation(Irp) happens in the completion routine –
KABLOOEY – BSOD.
Is this because of the IRQL difference when I called IoAllocateIrp?
Is it a difference between NT4 and Win2K?
Can you not use IoGetCurrentIrpStackLocation at DISPATCH_LEVEL???
Thanks,
Skip
You are currently subscribed to ntdev as: xxxxx@osr.com
To unsubscribe send a blank email to %%email.unsub%%
You must have some bug in your code because the
IoGetCurrentIrpStackLocation is nothing more than
a macro that will return Irp->Tail.Overlay.CurrentStackLocation.
The Irp is always allocated from NonPagedPool, so
if touching it at DISPATCH_LEVEL results in BSOD it
must be because of your bug. There is no other chance.
Paul
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of skip
Sent: Wednesday, April 17, 2002 10:23 PM
To: NT Developers Interest List
Subject: [ntdev] IoGetCurrentIrpStackLocation
Hi all,
The MSDN docs contain no info about IRQL requirements when calling
IoGetCurrentIrpStackLocation. I was following some code in Art Baker’s
book for resending an Irp in a completion routine. The completion routine
was running at DISPATCH_LEVEL in Win2K. The Irp I used in the call was
created at PASSIVE_LEVEL. When the call to
IoGetCurrentIrpStackLocation(Irp) happens in the completion routine –
KABLOOEY – BSOD.
Is this because of the IRQL difference when I called IoAllocateIrp?
Is it a difference between NT4 and Win2K?
Can you not use IoGetCurrentIrpStackLocation at DISPATCH_LEVEL???
Thanks,
Skip
You are currently subscribed to ntdev as: xxxxx@compelson.com
To unsubscribe send a blank email to %%email.unsub%%
If you have built that IRP (and you did) then you don’t have your stack
location in this IRP.
So, when in completion routine you’re calling for the current stack location
there is simply no
stack locations to return. I just don’t remember what exactly is returned in
this case, but anyway,
you can’t use that pointer and (most likely) you BSOD when you do use it. I
can even guess, that
this happens in the macro IoMarkIrpPending right?
Regards,
Vladimir
-----Original Message-----
From: skip [mailto:xxxxx@hotmail.com]
Sent: Wednesday, April 17, 2002 1:23 PM
To: NT Developers Interest List
Subject: [ntdev] IoGetCurrentIrpStackLocation
Hi all,
The MSDN docs contain no info about IRQL requirements when calling
IoGetCurrentIrpStackLocation. I was following some code in Art Baker’s
book for resending an Irp in a completion routine. The completion routine
was running at DISPATCH_LEVEL in Win2K. The Irp I used in the call was
created at PASSIVE_LEVEL. When the call to
IoGetCurrentIrpStackLocation(Irp) happens in the completion routine –
KABLOOEY – BSOD.
Is this because of the IRQL difference when I called IoAllocateIrp?
Is it a difference between NT4 and Win2K?
Can you not use IoGetCurrentIrpStackLocation at DISPATCH_LEVEL???
Thanks,
Skip
You are currently subscribed to ntdev as: xxxxx@Starbase.com
To unsubscribe send a blank email to %%email.unsub%%
RE: [ntdev] IoGetCurrentIrpStackLocationNo.
To use the current IO stack location in the completion routine (some drivers like IIRC SFILTER use it as a context to pass from way down to way up) - allocate the IRP with 1 more stack location, and then call IoSetNextIrpStackLocation just after the allocation.
Max
----- Original Message -----
From: Chtchetkine, Vladimir
To: NT Developers Interest List
Sent: Thursday, April 18, 2002 12:36 AM
Subject: [ntdev] RE: IoGetCurrentIrpStackLocation
Skip:
If you have built that IRP (and you did) then you don’t have your stack location in this IRP.
So, when in completion routine you’re calling for the current stack location there is simply no
stack locations to return. I just don’t remember what exactly is returned in this case, but anyway,
you can’t use that pointer and (most likely) you BSOD when you do use it. I can even guess, that
this happens in the macro IoMarkIrpPending right?
Regards,
Vladimir
-----Original Message-----
From: skip [mailto:xxxxx@hotmail.com]
Sent: Wednesday, April 17, 2002 1:23 PM
To: NT Developers Interest List
Subject: [ntdev] IoGetCurrentIrpStackLocation
Hi all,
The MSDN docs contain no info about IRQL requirements when calling
IoGetCurrentIrpStackLocation. I was following some code in Art Baker’s
book for resending an Irp in a completion routine. The completion routine
was running at DISPATCH_LEVEL in Win2K. The Irp I used in the call was
created at PASSIVE_LEVEL. When the call to
IoGetCurrentIrpStackLocation(Irp) happens in the completion routine –
KABLOOEY – BSOD.
Is this because of the IRQL difference when I called IoAllocateIrp?
Is it a difference between NT4 and Win2K?
Can you not use IoGetCurrentIrpStackLocation at DISPATCH_LEVEL???
Thanks,
Skip
You are currently subscribed to ntdev as: xxxxx@Starbase.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%