Opens the specified key.
LONG RtRegOpenKeyEx(
    HKEY hKey,         // handle to open key
    LPCTSTR lpSubKey,  // address of name of subkey to open
    DWORD ulOptions,   // reserved
    REGSAM samDesired, // security access mask
    PHKEY phkResult    // address of handle to open key
);
hKey 
lpSubKey 
hKey parameter. In this case, the call does not close the handles previously opened. 
ulOptions 
samDesired 
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. | 
phkResult 
Unlike RtRegCreateKeyEx, RtRegOpenKeyEx does not create the specified key if the key does not exist in the registry.
ERROR_SUCCESS 
| Versions | Defined in | Include | Link to | 
|---|---|---|---|
| INtime 3.0 | intime/rt/include/rtbase.h | rt.h | rt.lib | 
Registry system calls, RtRegCloseKey, RtRegCreateKeyEx, RtRegDeleteKey