Jenson,
IoSkipCurrentIrpStackLocation() and IoCopyCurrentStackLocationToNext()don’t
work the same way.
IoCopyCurrentStackLocationToNext() literally copies information from your
IRP stack location into the next driver’s location (and does some other
initialization of the next location). It requires TWO stack locations to
work correctly. You use this function if, for example, you plan to attach a
completion routine to the IRP in order to regain control after the lower
driver has finished with it.
IoSkipCurrentIrpStackLocation() just moves the IRP’s stack pointer back one
position. When your driver passes the IRP down with IoCallDriver(), the
stack pointer gets advanced one position; in other words, the next lower
driver is actually using the stack location that was given to you.
IoSkipCurrentIrpStackLocation() requires ONE stack location to work
correctly. You use this function if you DON’T plan to attach a completion
routine to the IRP.
Regards,
Art Baker
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of jenson
Sent: Tuesday, October 09, 2001 3:06 AM
To: NT Developers Interest List
Subject: [ntdev] Re: TDI question
Well … can you explain, how could this be ?
We have an IRP … (abstract IRP)
we execute : IoSkipCurrentIrpStackLocation(…) and everything works
we execute : IoCopyCurrentStackLocationToNext(…) and the system falls
if there were a problem with number of StackLocations, I guess, that
IoSkipCurrentIrpStackLocation would also result in system crash …
Am I right or am I still wrong ? 
This is a problem with the load order of your TDI filter.
If you load your TDI filter dynamically or at an arbitrary time then other
services may open the TDI devices and create address and connection
objects
BEFORE your filter is installed. As they open the TDI devices they
determine the required stack location size - and the size they calculate
does not include the additional stack location for your filter. Hence, the
problem you describle occurs later on…
The solution that I have found is to insure that the NBF service loads
AFTER your TDI filter is installed. You will have to read about the
Service Control Manager to learn how to control load order.
There may be another solution where you make create a “proxy IRP” of your
own and use it, in conjunction with the original IRP, to accomodate this
problem. I have never tried this.
Good luck,
Thomas F. Divine
PCAUSA - Toolkits & Resources For Network Software Developers
NDIS Protocol - NDIS Intermediate - TDI Client
http: - http:
>
>
> ----- Original Message -----
> From: “jenson”
> To: “NT Developers Interest List”
> Sent: Monday, October 08, 2001 8:26 AM
> Subject: [ntdev] TDI question
>
>
> > Hello everyone.
> > I’ve attached my device objects to tcp, udp, ip … So I receive Irps
> before
> > they are processed by lower driver.
> > I dont vary internal data of Irps…
> >
> > When I use
> > IoSkipCurrentIrpStackLocation(pIrp);
> > IoCallDriver(…)
> > everything works fine.
> >
> > But sometimes, when I use
> > IoCopyCurrentStackLocationToNext(pIrp);
> > IoSetCompletionRoutine(…)
> > IoCallDriver(…)
> > System falls down with NO_MORE_STACK_LOCATIONS error…
> > for example it happends when I press + R. After that I
> > receive an TDI_QUERY_INFORMATION Irp. Frankly speaking, it seem rather
> > strange to me, because
> > RequestConnectionInformation is NULL there …
> > Nevertheless, the same Irp won’t bring system down, if it’s processing
> > through
> > IoSkipCurrentIrpStackLocation(pIrp);
> >
> > My completion routine looks like that :
> >
> > MyCompletionRoutine(…)
> > {
> > …
> > if (Irp->PendingReturned) {
> > IoMarkPending(Irp)
> > }
> > return STATUS_SUCCESS;
> > }
> >
> > But the system falls before it reaches CompletionRoutine …
> >
> >
> > P.S. In most cases everything works … but sometimes … I wonder, what
> can
> > this be ?
> > What am I missing ?
> >
> >
> > Best regards, Jenson.
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@pcausa.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@beep.ru
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
—
You are currently subscribed to ntdev as: xxxxx@nfr.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</http:></http:>