REG_OPEN_KEY_EX, DISPLAY_REG_OPEN_KEY_EX

Opens a specified registry key by accessing the Windows registry routine RegOpenKeyEx.

Use DISPLAY_REG_OPEN_KEY_EX to perform the action on the display host's registry (the local host when the application is run with a standard runtime; the thin client when the application is run with the thin client). Use REG_OPEN_KEY_EX to perform the action on the server host's registry (the local host when the application is run with a standard runtime, and the application host when the application is run with the thin client).

Usage

CALL "REG_OPEN_KEY_EX" 
    USING OPEN-KEY-HANDLE, SUBKEY-TO-BE-OPENED, SAM-DESIRED, 
        SUBKEY-HANDLE, 
    GIVING STATUS-CODE

Parameters

  • OPEN-KEY-HANDLE Usage unsigned-long
    Handle of a currently open key or one of the following predefined handles of keys that are always open (defined in acugui.def):
    • HKEY_CLASSES_ROOT
    • HKEY_CURRENT_USER
    • HKEY_LOCAL_MACHINE
    • HKEY_USERS
  • SUBKEY-TO-BE-OPENED PIC X(n)

    String containing the name of the key to open. This key must be a subkey of the key identified by OPEN-KEY-HANDLE.

  • SAM-DESIRED Usage unsigned-long

    Specifies a security access mask (SAM) that describes the desired security access for the new key. This parameter can be a combination of the following values (defined in acugui.def):

    Value Meaning
    KEY_ALL_ACCESS Combination of KEY_QUERY_VALUE, KEY_ENUMERATE_SUB_KEYS, KEY_NOTIFY, KEY_CREATE_SUB_KEY, KEY_CREATE_LINK, and KEY_SET_VALUE access.
    KEY_CREATE_LINK Permission to create a symbolic link.
    KEY_CREATE_SUB_KEY Permission to create subkeys.
    KEY_ENUMERATE_SUB_KEYS Permission to enumerate subkeys.
    KEY_EXECUTE Permission for read access.
    KEY_NOTIFY Permission for change notification.
    KEY_QUERY_VALUE Permission to query subkey data.
    KEY_READ Combination of KEY_QUERY_VALUE, KEY_ENUMERATE_SUB_KEYS, and KEY_NOTIFY access.
    KEY_SET_VALUE Permission to set subkey data.
    KEY_WRITE Combination of KEY_SET_VALUE and KEY_CREATE_SUB_KEY access.

    You may combine the above in COBOL by using the CBL_OR library routine.

  • SUBKEY-HANDLE Usage unsigned-long

    Data item to receive the handle of the opened key.

  • STATUS-CODE Numeric data item.

    Receives the return status of call to Microsoft's RegOpenKeyEx function. A return status of zero indicates success; non-zero indicates that an error occurred.