Bajamani
Fri Feb 10 04:09:34 CST 2006
Ok consider the code snippet
BOOLEAN MakeRequest()
{
irp = IoBuildDeviceIoControlRequest(....);
if(!irp)
return FALSE;
//
// some code here
//
if(something goes wrong)
{
// cannot call IoFreeIrp for irp built
// with IoBuildDeviceIoControlRequest
IoCompleteRequest(irp,...);
return FALSE;
}
//
// some code here
//
}
IoFreeIrp was not called because irp was built with
IoBuildDeviceIoControlRequest. So to cleanup the irp
IoCompleteRequest was called. is it right?
Eliyas Yakub [MSFT] wrote:
> If you allocate an IRP, you cannot call IoCompleteRequest on it. You have to
> call IoFreeIrp to free it. You don't need to set the Irp->MdlAddress to
> NULL. You call IoFreeMdl to free the MDL yourself.
>
> Check out scenario 11 in
http://support.microsoft.com/kb/326315/en-us.
>
> -Eliyas