Miscellaneous rule set (WDM)

Use these rules to verify that your driver correctly follows a general set of requirements for the proper handling of registry keys, strings and device object pointers.

In this section



The AddDevice rule specifies that the driver's AddDevice routine calls IoAttachDeviceToDeviceStack only after calling IoCreateDevice.


The DanglingDeviceObjectReference rule specifies that the driver calls ObDereferenceObject with the same device object pointer that IoGetAttachedDeviceReference returned.


The PnpSameDeviceObject rule specifies that the driver calls IoAttachDeviceToDeviceStack with a pointer to a valid target device object.


The TargetRelationNeedsRef rule specifies that when processing a TargetDeviceRelation query, the driver's DispatchPnP routine calls one of the following functions to reference the child device's PDO:


The ZwRegistryCreate rule specifies that after calling ZwCreateKey, the driver can call the following registry functions only while holding an open handle to the registry key (that is, before any calls to ZwClose or ZwDeleteKey to close or delete the handle to the registry key):


The ZwRegistryOpen rule specifies that after calling ZwOpenKey, the driver calls the following registry functions only while holding an open handle to a registry key (that is, before calling ZwClose or ZwDeleteKey):


Hh987010.wedge(en-us,VS.85).gifTo select the Miscellaneous rule set

  1. Select your driver project (.vcxProj) in Microsoft Visual Studio. From the Driver menu, click Launch Static Driver Verifier….

  2. Click the Rules tab. Under Rule Sets, select Miscellaneous.

    To select the default rule set from a Visual Studio developer command prompt window, specify Miscellaneous.sdv with the /check option. For example:

    msbuild /t:sdv /p:Inputs="/check:Miscellaneous.sdv" mydriver.VcxProj /p:Configuration="Win8 Release" /p:Platform=Win32

    For more information, see Using Static Driver Verifier to Find Defects in Drivers and Static Driver Verifier commands (MSBuild).



Send comments about this topic to Microsoft

© 2015 Microsoft