Why don’t you just change the load order of NetBt and load in before
it? That way it will create the correct number of stack locations
in the IRP.
Of course you will still need to check to make sure there are
enough stack locations for you to instrument any IRPs coming
down, as drivers above you may have bugs.
-Jeff
-----Original Message-----
From: xxxxx@softhome.net [mailto:xxxxx@softhome.net]
Sent: Wednesday, May 07, 2003 9:36 AM
To: NT Developers Interest List
Subject: [ntdev] Redux: IoCallDriver…Acess Violation and
NO_MORE_IRP_STACK_LOCATIONS
Hi all ,
I am installing the filter after the loading of NetBt.Hmmm I think this is
common problem with the Netbt and tcp filtering…I tried to change My
handler in the way given below, and strange enough the Access Violation
problem is solved but still i get NO_MORE_IRP_STACK_LOCATIONS and the stack
clearly shows that NetBt is behind this. {P.S. infitcp is my drivers name.}
NTSTATUS
CompleteOrDenyTdiDispatch(IN PDEVICE_OBJECT pFilterDeviceObject,IN PIRP
pIrp,IN int filter,
IN PIO_COMPLETION_ROUTINE pCompletionRoutine,IN
TCP_REQUEST_FILTER_CONTEXT* pFilterContext)
{
NTSTATUS status = STATUS_SUCCESS;
PFILTER_DEVICE_EXTENSION pFilterDeviceExtension =
(PFILTER_DEVICE_EXTENSION)pFilterDeviceObject->DeviceExtension;
PIO_STACK_LOCATION pIrpStack = IoGetCurrentIrpStackLocation( pIrp );
PIO_STACK_LOCATION pNextIrpStack = IoGetNextIrpStackLocation( pIrp );
DbgPrint(" [INFITCP.SYS]CompleteOrDenyTdiDispatch: \n");
// Copy args to the next level
// IoCopyCurrentIrpStackLocationToNext(pIrp);
*pNextIrpStack = *pIrpStack;
// Set up a completion routine to handle the bubbling
// of the “pending” mark of an IRP
if(pCompletionRoutine == NULL)
{
IoSetCompletionRoutine( pIrp, GenericIoCompletionRoutine, NULL,
TRUE, TRUE, TRUE );
}
else
{
IoSetCompletionRoutine(pIrp, pCompletionRoutine, pFilterContext,
TRUE, TRUE, TRUE );
}
if(pFilterContext->Filter == FILTER_ALLOW_IRP)
{
// Pass the IRP to the target.
status = IoCallDriver( pFilterDeviceExtension->pTargetDeviceObject,
pIrp );
return status ;
else
{
DbgPrint(“[INFITCP.SYS] CompleteOrDenyTdiDispatch - Denying The
request\n”);
status = STATUS_ACCESS_VIOLATION;
pIrp->IoStatus.Status = status;
IoCompleteRequest(pIrp,IO_NO_INCREMENT);
return status;
}
}
Now it clearly shows that there are no more stack locations out there for
the driver. How can i prevent this situations or increase the stack
locations with NetBT ? .Do i need to
allocation a new IRP with enough stack locations and send it to TCP and wait
for its completion and then inside the completion i need to copy the
resulting parameters and buffers to the Lastly Held Irp and return to the
caller .Is there some sample code describing this kind of solution ? or if
you could help me with some psuedo code it will be very helpful…
*** Fatal System Error: 0x00000035
(0x81590A48,0x00000000,0x00000000,0x00000000)
Hard coded breakpoint hit
ks
ffffffffb79ed5cc ffffffff8042c487 0000000000000003 ffffffff816b0a50
ffffffff81590a48 NTOSKRNL!RtlpSetSecurityObject+0x9d (EBP)
ffffffffb79ed958 ffffffff8041f787 0000000000000035 ffffffff81590a48
0000000000000000 NTOSKRNL!KeBugCheckEx+0x573 (EBP)
ffffffffb79ed98c ffffffffed201b81 ffffffff815ce5f8 ffffffff81590a48
0000000000000001 NTOSKRNL!@IopfCompleteRequest@8+0x12f (EBP)
ffffffffb79ed9d4 ffffffff8041f79f ffffffff816b0a50 ffffffff81590ab8
ffffffff81571f88 INFITCP!0xFFFFFFFFED201B81 (No FPO)
ffffffffb79eda00 ffffffffb7c29e90 ffffffff8166c608 ffffffffb7c0ce20
ffffffff816d8470 NTOSKRNL!@IopfCompleteRequest@8+0x147 (EBP)
ffffffffb79eda3c ffffffffb7c2a46e ffffffff816d8300 ffffffffc0a80a01
ffffffff8168d9b0 NETBT!PickBestAddress+0xb (EBP)
ffffffffb79eda7c ffffffffb7c2dbed ffffffff8155c448 ffffffff8155c454
0000000000000008 NETBT!NbtConnectCommon+0x229 (EBP)
ffffffffb79edaa4 ffffffffb7c41dc0 ffffffffb7c2a350 ffffffff8168d9b0
0000000000000000 NETBT!NbtRegisterName+0x2cb (EBP)
ffffffffb79edb44 ffffffffb7c2f249 ffffffff815669a8 ffffffffed5a10f0
0000000000000001 NETBT!GetIpAddressesList+0xfffffffffffffdaa (EBP)
ffffffffb7c40060 ffffffffb7c40064 ffffffffb7c40064 0000000000000000
0000000000000000 NETBT!DgramHndlrNotOs+0x1e7 (EBP)
ffffffff8159bba8 ffffffff8156a008 0000000000000000 0000000000000000
ffffffff81615fac _alldiv+0xf648 (No FPO)
0000000000940006 0000000000000000 0000000000000000 0000000000000000
0000000000000000 0xFFFFFFFF8156A008 (No FPO)
Regards…
Subodh Radheshaym Gupta
You are currently subscribed to ntdev as: xxxxx@concord.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
the latest virus scan software available for the presence of computer
viruses.
**********************************************************************