ZwRegistryOpen rule (storport)
This rule verifies that the handle to the registry key opened via ZwOpenKey is subsequently used correctly by other ZwXxx routines. The routines ZwEnumerateKey, ZwEnumerateValueKey, ZwFlushKey, ZwQueryKey, ZwQueryValueKey, ZwSetValueKey, ZwClose, and ZwDeleteKey must not be called on a handle that isn't open. The handle must also be closed before returning.
How to test
|At compile time|
Run Static Driver Verifier and specify the ZwRegistryOpen 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.