IRP_NO_MORE_STACK_LOCATIONS in TCP/IP filter driver

Hi All,

I have successfully hooked the TCP/IP driver. Some times I am getting IRP_NO_MORE_STACK_LOCATIONS error follwowed by blue screen. Some times I am not getting the above error. I am using the follwing Routine to copy the Current IRP stack location to Next Irp stack location.

ULONG IoCopyCurrentIrpStackLocationToNext(PIRP Irp )
{
PIO_STACK_LOCATION irpSp;
PIO_STACK_LOCATION nextIrpSp;

if(Irp->StackCount == 1)
{
KdPrint((“No next IRP stack location\n”));
return 0;
}
irpSp = IoGetCurrentIrpStackLocation( (Irp) );
nextIrpSp = IoGetNextIrpStackLocation( (Irp) );
RtlCopyMemory( nextIrpSp, irpSp, FIELD_OFFSET(IO_STACK_LOCATION, CompletionRoutine));
nextIrpSp->Control = 0;
return 1;
}

Can anybody help me in solving the above problem?

Regards,
Gopikrishna.

The problem is that the driver calling your driver is probably constructing
the IRPs directly and there are not enough stack locations. If you wish to
function in this case, you either need to find the driver and adjust it
accordingly (e.g., via the registry for some of the standard drivers) or you
have to construct a NEW IRP and send it down instead of using the existing
IRP.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com http:

-----Original Message-----
From: Gopikrishna [mailto:xxxxx@calsoft.co.in]
Sent: Wednesday, May 03, 2000 12:05 PM
To: NT Developers Interest List
Subject: [ntdev] IRP_NO_MORE_STACK_LOCATIONS in TCP/IP filter driver

Hi All,

I have successfully hooked the TCP/IP driver. Some times I am getting
IRP_NO_MORE_STACK_LOCATIONS error follwowed by blue screen. Some times I am
not getting the above error. I am using the follwing Routine to copy the
Current IRP stack location to Next Irp stack location.

ULONG IoCopyCurrentIrpStackLocationToNext(PIRP Irp )
{
PIO_STACK_LOCATION irpSp;
PIO_STACK_LOCATION nextIrpSp;

if(Irp->StackCount == 1)
{
KdPrint((“No next IRP stack location\n”));
return 0;
}
irpSp = IoGetCurrentIrpStackLocation( (Irp) );
nextIrpSp = IoGetNextIrpStackLocation( (Irp) );
RtlCopyMemory( nextIrpSp, irpSp, FIELD_OFFSET(IO_STACK_LOCATION,
CompletionRoutine));
nextIrpSp- <file:> >Control = 0;
return 1;
}

Can anybody help me in solving the above problem?

Regards,
Gopikrishna.</file:></http:>