I am sending an IOCTL from the TDI filter to the protocol driver from
a workitem routine.

Foll are the steps:
1. Mdl = IoAllocateMdl (describes a non paged memory)
if(failed) goto Cleanup;
2. MmBuildMdlForNonPagedPool
3. NewIrp = TdiBuildInternalDeviceControlIrp
if(failed) goto Cleanup;
4. TdiBuildQueryInformation (Set the IRP's DeviceObj,FileObj,MDL)

5. IoCallDriver

Cleanup:
6. if(NewIrp) IoCompleteRequest
7. if(Mdl) IoFreeMdl

If there is a failure after step 4, the code will jump to step 6
(Cleanup).
In such cases, Win2k checked OS issues an assertion failure message
Assertion failed: (MemoryDescriptorList->MdlFlags & MDL_PAGES_LOCKED)
!= 0

This assertion is in the IoCompleteRequest code.

What is the problem?

-Mani

Re: Assertion (MemoryDescriptorList->MdlFlags & MDL_PAGES_LOCKED) by Peter

Peter
Wed Nov 10 09:08:38 CST 2004

when you allocate an IRP for an MDL you should remove it and free it before
completing the IRP.

-p

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Bajamani" <bajamani@hotmail.com> wrote in message
news:a0eed5c.0411100045.6046195b@posting.google.com...
>I am sending an IOCTL from the TDI filter to the protocol driver from
> a workitem routine.
>
> Foll are the steps:
> 1. Mdl = IoAllocateMdl (describes a non paged memory)
> if(failed) goto Cleanup;
> 2. MmBuildMdlForNonPagedPool
> 3. NewIrp = TdiBuildInternalDeviceControlIrp
> if(failed) goto Cleanup;
> 4. TdiBuildQueryInformation (Set the IRP's DeviceObj,FileObj,MDL)
>
> 5. IoCallDriver
>
> Cleanup:
> 6. if(NewIrp) IoCompleteRequest
> 7. if(Mdl) IoFreeMdl
>
> If there is a failure after step 4, the code will jump to step 6
> (Cleanup).
> In such cases, Win2k checked OS issues an assertion failure message
> Assertion failed: (MemoryDescriptorList->MdlFlags & MDL_PAGES_LOCKED)
> != 0
>
> This assertion is in the IoCompleteRequest code.
>
> What is the problem?
>
> -Mani



Re: Assertion (MemoryDescriptorList->MdlFlags & MDL_PAGES_LOCKED) by bajamani

bajamani
Sun Nov 14 23:54:11 CST 2004

Thanks Peter. By "removing a MDL" do you mean Irp->MdlAddress = NULL ?

...Mani


> when you allocate an IRP for an MDL you should remove it and free it before
> completing the IRP.
>
> -p

> >I am sending an IOCTL from the TDI filter to the protocol driver from
> > a workitem routine.
> >
> > Foll are the steps:
> > 1. Mdl = IoAllocateMdl (describes a non paged memory)
> > if(failed) goto Cleanup;
> > 2. MmBuildMdlForNonPagedPool
> > 3. NewIrp = TdiBuildInternalDeviceControlIrp
> > if(failed) goto Cleanup;
> > 4. TdiBuildQueryInformation (Set the IRP's DeviceObj,FileObj,MDL)
> >
> > 5. IoCallDriver
> >
> > Cleanup:
> > 6. if(NewIrp) IoCompleteRequest
> > 7. if(Mdl) IoFreeMdl
> >
> > If there is a failure after step 4, the code will jump to step 6
> > (Cleanup).
> > In such cases, Win2k checked OS issues an assertion failure message
> > Assertion failed: (MemoryDescriptorList->MdlFlags & MDL_PAGES_LOCKED)
> > != 0
> >
> > This assertion is in the IoCompleteRequest code.
> >
> > What is the problem?
> >
> > -Mani

Re: Assertion (MemoryDescriptorList->MdlFlags & MDL_PAGES_LOCKED) by Peter

Peter
Mon Nov 15 14:05:38 CST 2004

yep

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Bajamani" <bajamani@hotmail.com> wrote in message
news:a0eed5c.0411142154.40ef5926@posting.google.com...
> Thanks Peter. By "removing a MDL" do you mean Irp->MdlAddress = NULL ?
>
> ...Mani
>
>
>> when you allocate an IRP for an MDL you should remove it and free it
>> before
>> completing the IRP.
>>
>> -p
>
>> >I am sending an IOCTL from the TDI filter to the protocol driver from
>> > a workitem routine.
>> >
>> > Foll are the steps:
>> > 1. Mdl = IoAllocateMdl (describes a non paged memory)
>> > if(failed) goto Cleanup;
>> > 2. MmBuildMdlForNonPagedPool
>> > 3. NewIrp = TdiBuildInternalDeviceControlIrp
>> > if(failed) goto Cleanup;
>> > 4. TdiBuildQueryInformation (Set the IRP's DeviceObj,FileObj,MDL)
>> >
>> > 5. IoCallDriver
>> >
>> > Cleanup:
>> > 6. if(NewIrp) IoCompleteRequest
>> > 7. if(Mdl) IoFreeMdl
>> >
>> > If there is a failure after step 4, the code will jump to step 6
>> > (Cleanup).
>> > In such cases, Win2k checked OS issues an assertion failure message
>> > Assertion failed: (MemoryDescriptorList->MdlFlags & MDL_PAGES_LOCKED)
>> > != 0
>> >
>> > This assertion is in the IoCompleteRequest code.
>> >
>> > What is the problem?
>> >
>> > -Mani