IoFreeIrp - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdm.h

VOID IoFreeIrp(
  [in] PIRP Irp
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdm-iofreeirp)

IoFreeIrp function

Description

The IoFreeIrp routine releases a caller-allocated IRP from the caller's IoCompletion routine.

Parameters

Irp [in]

Pointer to the IRP that is to be released.

Remarks

This routine is the reciprocal to IoAllocateIrp or IoBuildAsynchronousFsdRequest. The released IRP must have been allocated by the caller.

This routine also releases an IRP allocated with IoMakeAssociatedIrp in which the caller set up its IoCompletion routine that returns STATUS_MORE_PROCESSING_REQUIRED for the associated IRP.

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.

See also

IoAllocateIrp

IoBuildAsynchronousFsdRequest

IoCompletion

IoMakeAssociatedIrp

IoSetCompletionRoutine