Click to Rate and Give Feedback

  Switch on low bandwidth view
Windows Driver Kit: Kernel-Mode Driver Architecture
Registry Key Object Routines

The Windows executive represents registry keys as executive objects that are managed by the object manager. (For more information about the object manager, see Object Management.) In particular, every key has an object name, and you can open a handle to a key.

User-mode applications access keys relative to global handles, such as HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER. However, these handles are not available to kernel-mode code. Instead, you refer to a key by its object name. The root for all registry keys is the \Registry object. The global handles correspond to descendants of the \Registry object, as shown in the following table.

User-mode HandleCorresponding Object Name
HKEY_LOCAL_MACHINE\Registry\Machine
HKEY_USERS\Registry\User
HKEY_CLASSES_ROOTNo kernel-mode equivalent
HKEY_CURRENT_USERNo simple kernel-mode equivalent, but see Registry Run-Time Library Routines

A driver can manipulate a registry-key object by performing the following steps:

  1. Open a handle to the registry-key object. For more information, see Opening a Handle to a Registry-Key Object.
  2. Perform the intended operations by calling the appropriate ZwXxxKey routines. For information about how to do so, see Using a Handle to a Registry-Key Object.
  3. Close the handle by calling ZwClose.


Send feedback on this topic
Built on May 20, 2009
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker