The IoFreeIrp routine releases a caller-allocated IRP from the caller's IoCompletion routine.
NTKERNELAPI VOID IoFreeIrp( __drv_freesMem(Mem)PIRP Irp );
Pointer to the IRP that is to be released.
IoFreeIrp does not free any MDLs that might be attached to the IRP. The driver that frees the IRP must explicitly free these MDLs. In addition, if the physical pages that are described by an MDL are locked, the driver must unlock the pages before it frees the MDL. However, the driver does not need to explicitly unmap these pages. Instead, IoFreeMdl automatically unmaps the pages when it frees the MDL. For a code example that shows how to free an MDL chain, see Using MDLs.
|Windows version||Available starting with Windows 2000.|
|Header||wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)|
|DDI compliance rules||IoAllocateFree, IoBuildDeviceControlNoFree, IoBuildFsdFree, IoBuildSynchronousFsdRequestNoFree, HwStorPortProhibitedDDIs, IoFreeIrp|