Opens or creates a key. @param p_hParent Handle of parent key. @param p_pKeyPath Path of registry key. @param p_Create Whether to create the registry key if it does not exist. @param p_SecurityAccess Desired security access. Defaults to read/write.
| 92 | // @param p_SecurityAccess Desired security access. Defaults to read/write. |
| 93 | // |
| 94 | long AtlRegKey::Open(HKEY const p_hParent, |
| 95 | const wchar_t* const p_pKeyPath, |
| 96 | const bool p_Create, |
| 97 | const REGSAM p_SecurityAccess /*= KEY_READ | KEY_WRITE*/) noexcept(false) |
| 98 | { |
| 99 | assert(m_Key.m_hKey == nullptr); |
| 100 | |
| 101 | return p_Create |
| 102 | ? m_Key.Create(p_hParent, p_pKeyPath, nullptr, REG_OPTION_NON_VOLATILE, p_SecurityAccess) |
| 103 | : m_Key.Open(p_hParent, p_pKeyPath, p_SecurityAccess); |
| 104 | } |
| 105 | |
| 106 | // |
| 107 | // Tries to load a DWORD value from the registry key. |
no outgoing calls
no test coverage detected