From MSDN DDK document,
IRPs created using IoBuildDeviceIoControlRequest must be completed by
calling IoCompleteRequest and not by merely deallocating the IRP with
IoFreeIrp. IoBuildDeviceIoControlRequest queues the IRPs it creates in the
IRP queue of the current thread. Freeing these IRPs without completing them
might result in a system crash when the thread terminates as the thread
attempts to deallocate the IRP's memory.
However, from DDK examples and likes from other sources, I didn't see any
FreeIrp or CompleteIrp for this reason. Seems to me the IRP is not freed
anywhere through the code.
Who frees this IRP?