reference:plugins:plugin_sdk:registry_functions:opusregopenkeyw

OpusRegOpenKeyW(
     OPUSREGKEY:phKey,
     LPCWSTR:lpSubKey,
     REGSAM:samDesired,
     OPUSREGKEY*:phkResult
)
→ LONG

Arguments

phKey

[in] The parent registry key (or root hive). This must either be a valid key returned by OpusRegCreateKeyW or OpusRegOpenKeyW, or one of the following hive keys:

OPUSREGKEY_CLASSES_ROOTequivalent to HKEY_CLASSES_ROOT
OPUSREGKEY_CURRENT_USERequivalent to HKEY_CURRENT_USER
OPUSREGKEY_LOCAL_MACHINEequivalent to HKEY_LOCAL_MACHINE
OPUSREGKEY_USERSequivalent to HKEY_USERS

lpSubKey

[in] Path of sub-key to create or open, or NULL to open the parent key.

samDesired

[in] Access mask that specifies the desired access rights to the key. See the Windows API documentation for RegOpenKeyEx for more information.

phkResult

[out] Pointer to a variable that receives a handle to the opened key.

Return value

Returns ERROR_SUCCESS if successful or an error code on failure.

Description

The OpusRegOpenKeyW function is used to open an existing registry key for reading or writing.

The key returned in phkResult is not compatible with the Windows registry API functions. You must close all key handles with OpusRegCloseKey when you are finished using the handle.

The specified key must exist or this function will fail. To create a new key, use OpusRegCreateKeyW.