In this paper, we mainly introduce the loading and unloading process of a typical kmdf driver with the TraceView.exe tool. The related theory mainly comes from "Win7 Device driver Program development" book. For the use of TraceView.exe, please refer to my previous blog: Click to open the link.
First, start and load order
In section 7.2 of Win7 device driver development, "enumeration and startup of devices", it is mentioned that in order to prepare the device, Kmdf invokes the driver's callback routine in a fixed order. Where the FDO or filter do callback process is as follows: (bottom-up, starting from the insertion device)
Second, unloading sequence
Turn off FDO or filter do power and the sequence of callback function calls involved in removing the FDO or filter do procedure.
Third, actual device loading and unloading event tracking
Below I show the actual process with the TraceView trace information of Microsoft's PLX9X5X driver sample program's loading and unloading process.
It is generally possible to see:
1, loading process: Plxevtdeviceadd, Adddevicepdo, Plxevtdevicepreparehardware, other initialization
2, uninstall process: Plxshutdown, Plxevtdevicepreparehardware, Plxevtdrivercontextcleanup
Using TraceView to observe the Windows PCIe driver loading and unloading process