ControlDeviceDeleted rule (kmdf)
The ControDeviceDeleted rule specifies that if a PnP driver creates a control device object, the driver must delete the control device object in one of the cleanup callback functions before the driver unloads.
If an FDO or filter driver calls WdfDeviceCreate for the control device object, the driver must call WdfObjectDelete for the control device object from the driver's cleanup callback function for the WDFDEVICE object, the destroy callback function for WDFDEVICE object, or the EvtDeviceSelfManagedIoCleanup event callback function.
How to test
|At compile time|
Run Static Driver Verifier and specify the ControlDeviceDeleted rule.Use the following steps to run an analysis of your code:
For more information, see Using Static Driver Verifier to Find Defects in Drivers.