Registry Keys for Drivers

The following trees in the registry are of particular interest to driver writers (where HKLM represents HKEY_LOCAL_MACHINE):

 

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 SetupDiGetDeviceRegistryProperty or SetupDiOpenDevRegKey. The registry can be accessed from INF files using INF AddReg directives.

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

The keys under HKLM\SYSTEM\CurrentControlSet are a safe place to preserve data that is vital to your driver because the data is stored in the system hive. The system takes extra precautions to protect the system hive (for example, keeping multiple copies).

Reproduced in: https: //www.cnblogs.com/fanzi2009/archive/2009/07/16/1524843.html

Guess you like

Origin blog.csdn.net/weixin_33708432/article/details/94192571