Compartilhar via


3.1.1.11 Symbolic Links

The server MUST support creating and maintaining symbolic links between keys in the registry hierarchy. Each symbolic link has a source key and a target key. The source key of a symbolic link contains a single registry string value, which is the path of the target key in the symbolic link.

Symbolic link source keys are created when a client creates a registry key with the registry option REG_OPTION_CREATE_LINK. After creating the symbolic link source key, a client MUST create a new value under the source key named "SymbolicLinkValue". The SymbolicLinkValue value contains the Object Name of the target of the symbolic link, which MUST NOT be NULL-terminated. The type of the value named SymbolicLinkValue MUST be REG_LINK.

If a client attempts to open the source key of a symbolic link without the REG_OPTION_OPEN_LINK flag set, the server MUST return a handle to the target of the symbolic link. If a client attempts to open the source key of a symbolic link with the REG_OPTION_OPEN_LINK flag set, the server MUST return a handle to the source key of the symbolic link to allow the client to update the target of the symbolic link by changing the value of SymbolicLinkValue.

The server MUST support recursive symbolic links. If the target of a symbolic link has a KEYTYPE of symbolic link, then the server MUST follow the symbolic link to the next target key. The server SHOULD<11> limit the maximum depth of a chain of symbolic links that can be followed.

Registry keys that are the source of a symbolic link MUST NOT have subkeys.

If the client attempts to delete the source key of a symbolic link using the BaseRegDeleteKey or BaseRegDeleteKeyEx method, the server will return the failure code 2 (ERROR_FILE_NOT_FOUND).