3.1.1.1.2 Relative Name

To uniquely identify a subkey within the set of all subkeys of a given parent key, a relative name (RN) is used. The RN of a key consists of the Base Name of each subkey in the path between the parent and the subkey in question, including the Base Name of the subkey concatenated with the "\" character as a hierarchy separator.

Methods in this protocol that specify subkey names as a Unicode string parameter are interpreted relative to an ancestor key, typically specified by a handle parameter. For example, the BaseRegOpenKey method requires both hKey and lpSubKey parameters. lpSubKey refers to a subkey of the key specified by hKey and can be a direct child of the key specified by hKey or a subkey of the key specified by hKey through multiple parent-child relationships.

The following example uses the BaseRegOpenKey method. Assume the following FQN to a key named "Office" and an existing handle opened and referring to the key named "SOFTWARE".

 HKEY_LOCAL_MACHINE -> SOFTWARE -> Microsoft -> Office

In this example, a client uses the BaseRegOpenKey method to open the "Microsoft" subkey by specifying "Microsoft" as the value of the lpSubKey parameter. Similarly, a client uses the same method to open the "Office" subkey by specifying "Microsoft\Office" as the value of the lpSubKey parameter.

Methods in this protocol that specify subkey names as a Unicode string parameter, with the exception of BaseRegCreateKey, will return a failure code as described in section 3.1.5 if the RN refers to a key that does not exist in the key namespace.