Skip to content

Reg_Get_Access_Rights

Obsolete

This command is obsolete. Use the cRegistry class for accessing the Windows Registry in DataFlex.

Purpose

To query the access rights of the registry.

Syntax

Reg_Get_Access_Rights To dwAccessRights

What It Does

This command retrieves the access rights used when invoking all registry commands, such as Get_Profile_String and Set_Profile_String. The dwAccessRights value is a bitwise combination of any of the following values. The default rights for DataFlex and Web App Server are KEY_WRITE.

  • KEY_QUERY_VALUE: Allows the values of a registry key to be queried.
  • KEY_SET_VALUE: Allows the values of a registry key to be changed.
  • KEY_CREATE_SUB_KEY: Allows subkeys to be created within a registry key.
  • KEY_ENUMERATE_SUB_KEYS: Allows subkeys to be enumerated.
  • KEY_CREATE_LINK: Allows symbolic links to be created from points within the registry.
  • KEY_WRITE: Combination of KEY_SET_VALUE and KEY_CREATE_SUB_KEY.
  • KEY_READ: Combination of all read-only access options, including enumeration.
  • KEY_ALL_ACCESS: Allows for reading and writing registry options and also allows symbolic links to be created.

Example

This command is especially useful when temporary changes to registry rights are required. The following case shows how the ability to create subkeys in the registry can be restricted to one section of an application. Suppose that the rights are originally set (using Reg_Set_Access_Rights) to KEY_READ.

// Change the rights to allow sub key creation
Reg_Get_Access_Rights To dwOldRights
Reg_Set_Access_Rights To (KEY_CREATE_SUB_KEY IOR KEY_SET_VALUE IOR KEY_READ)
// Go create sub keys.
Reg_Set_Access_Rights to dwOldRights