Same IRP appearing more than once?
From: Old Codger (OldCodger101_at_hotmail.com)
Date: 09/27/04
- Next message: Old Codger: "Re: Serial Upper Filter Driver Help Required"
- Previous message: manu: "Re: how to decode such device path?"
- Messages sorted by: [ date ] [ thread ]
Date: 27 Sep 2004 03:40:11 -0700
Hi,
This is my first driver project so please excuse me if I have made a
basic mistake somewhere.
I am writing an upper filter driver for a serial port.
In my DispatchControl function I pass everything down to the lower
driver as follows (abbreviated):
status = IoAcquireRemoveLock(&pdx->RemoveLock,Irp);
if (!NT_SUCCESS(status))
{
return CompleteRequest(Irp, status, 0);
}
IoSkipCurrentIrpStackLocation(Irp);
status = IoCallDriver(pdx->LowerDeviceObject,Irp);
IoReleaseRemoveLock(&pdx->RemoveLock,Irp);
return status;
After this has been running for a few seconds I get an ASSERT in my
DispatchControl function because of an incorrect IRQ level. I see that
IoCallDriver() has not immediately returned and that DispatchControl
has been called three times for the same Irp.
The sequence of events I see in the debugger is as follows (I have
numbered the Irp's as 1,2,3 etc in order of appearance).
DispatchControl entered for IRP 1
IoCallDriver called for IRP 1
IoCallDriver returns STATUS_SUCCESS for IRP 1 (This one was OK)
DispatchControl entered for IRP 2
IoCallDriver called for IRP 2 (Does not immediately return)
DispatchControl entered for IRP 2 *FOR 2ND TIME*
IoCallDriver called for IRP 2 (Does not immediately return)
DispatchControl entered for IRP 3
IoCallDriver called for IRP 3
IoCallDriver returns STATUS_PENDING for IRP 3
IoCallDriver returns STATUS_SUCCESS for IRP 2
IoCallDriver returns STATUS_SUCCESS for IRP 2 *FOR 2ND TIME*
DispatchControl entered for IRP 4
IoCallDriver called for IRP 4 (Does not immediately return)
DispatchControl entered for IRP 2 *FOR 3RD TIME*
ASSERT fires Pageable code called at IRQL2.
Note that this failure only appears to occur when IoCallDriver has
returned STATUS_PENDING, all other times it returns STATUS_SUCCESS.
If I continue in the debugger with "g" the driver continues to run
(but with the same ASSERT occurring).
The only other thing to note is that I also have DispatchRead (with a
completion function) and DispatchWrite functions which appear to be
called correctly.
Thanks for any help received
O.C.
- Next message: Old Codger: "Re: Serial Upper Filter Driver Help Required"
- Previous message: manu: "Re: how to decode such device path?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|