Re: Question about IoBuildDeviceIoControlRequest ; Please Ignore the first message uncompleted

“Kommuri, Chakradhar” wrote:

Correct. Looks like, the thumb rule is, unless you allocate an Irp, you
don’t free it.

Not exactly. If you build a “synchronous” IRP (by calling
IoBuildSynchronousFsdRequest or IoBuildDeviceIoControlRequest), you (a)
wait for it to finish and (b) allow the system to call IoFreeIrp. If you
build an “asynchronous” IRP (by calling IoBuildAsynchronousFsdRequest or
IoAllocateIrp), you also install a completion routine that calls
IoFreeIrp.


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Now teaming with John Hyde for USB Device Engineering Seminars
Check out our schedule at http://www.oneysoft.com