Thanks George.
There is a problem in how I’m allocating things. The IRP->MdlAddress is a
control packet that contains the pointer to the buffer and it’s length. What
I’m trying to do here, is create an MDL for the data buffer and associate it
with the IRP, thus when the IRP is completed, the system then destroys both
MDLs.
Another part of the problem is the use of the DO_BUFFERED_IO flag in the
DEVICE_OBJECT. If set, then SecondaryBuffer must be FALSE, else
IoAllocateMdl throws an access denied exception. Grrrr … things have
changed from NT4 … this logic worked there.
Another anomaly (or maybe the source of my bug) … (Elyas/Microsoft) is
that with DO_BUFFERED_IO, SecondaryBuffer set FALSE, and a pointer to an
IRP, IoAllocateMdl returns Irp->MdlAddress. In some ways that makes sense,
but that behavior is totally undocumented.
Gary G. Little
Sr. Staff Engineer
Broadband Storage, LLC
xxxxx@broadstor.com
xxxxx@delphieng.com
-----Original Message-----
From: George Blat [mailto:xxxxx@brd.com]
Sent: Thursday, February 22, 2001 2:34 PM
To: NT Developers Interest List
Subject: [ntdev] Re: [NTDEV] Driver verifier problem …
I think that when calling IoAllocateMdl(), the irp parameter should be set
to NULL. It would be
used when an Irp is passed with a direct method of passing parameters. It
seems from your code
that you are not using that feature.
George
At 11:47 AM 2/22/01 -0800, you wrote:
In testing the drivers for 2000, I have turned on the Driver Verifier and
enabled all of the Global Flags. I/O verification I set to Level 2.Here is a code fragment that is giving me problems. It is in the dispatch
Read/Write function that prepares an IRP for transfer on our fibre channel
HBA.PMDL pMdl = IoAllocateMdl(packet->DataBuffer,
packet->Length,
FALSE,
FALSE,
Irp);
__try {
MmProbeAndLockPages(pMdl,KernelMode,
((packet->Direction < FC_RECEIVE) ?
IoWriteAccess :
IoReadAccess));
} __except(EXCEPTION_EXECUTE_HANDLER) {
status = GetExceptionCode();
CompleteRequest(Irp, status, 0);
return status;
}GetExceptionCode returns a 0xC00000A1, or insufficient quota. That’s fine,
to handle it, I want to return to the user by completing the IRP.
CompleteRequest calls IoCompleteRequest and pops a blue screen, with
bugcheck 0x76. (NOTE: The documentation on this bugcheck is erroneous.)
Nothing I do, freeing pMdl, or unlocking pMdl resolves the bugcheck upon
completing the IRP.How should this be handled?
Gary G. Little
Sr. Staff Engineer
Broadband Storage, LLC
xxxxx@broadstor.com
xxxxx@delphieng.com
You are currently subscribed to ntdev as: xxxxx@brd.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
George Blat
BRD Corp
8016 188th SW, Edmonds, WA 98026
phone: 425-775-7475
fax: 781-998-5940
mailto:xxxxx@brd.com
http://www.brd.com
You are currently subscribed to ntdev as: xxxxx@delphieng.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