Registry Trees and Keys for Devices and Drivers

The operating system, drivers, and device installation components store information about drivers and devices in the registry. In general, drivers and device installation components should use the registry to store data that must be maintained across restarts of the system. For information about how a driver accesses registry information, see Using the Registry in a Driver.

Registry contents should always be treated as untrusted, modifiable information. If one of your driver components writes information to the registry and another component reads it later, do not assume that the information has not been modified in the meantime. After reading information from the registry, your driver components should always validate the information before using it.

For more information about the registry in general, see the Microsoft Windows SDK documentation.

This section contains the following topics which describe the use of registry keys to store information about drivers and devices:

Drivers must access Plug and Play (PnP) keys in the registry using system routines such as IoGetDeviceProperty or IoOpenDeviceRegistryKey. User-mode setup components should use device installation functions such as CM_Get_DevNode_Registry_Property or CM_Open_DevNode_Key. The registry can be accessed from INF files by using INF AddReg directives. See the registry state section of the driver package isolation page for more information.

Important

Drivers must not access these registry trees and keys directly. This discussion of registry information in this section is solely for debugging a device installation or configuration problem.