Tries to load a value from the registry key. @param p_pValueName Name of value to load. @param p_pValueType If set, will receive the type of value. @param p_pValue Pointer to buffer where to store value. Can be null. @param p_pValueSize Pointer to variable containing the size of p_pValue. Upon exit, will contain the actual size of the value copied to p_pValue. Can be null only if p_pValue is too.
| 181 | // @return Result code (ERROR_SUCCESS if it worked). |
| 182 | // |
| 183 | long UserOverrideableRegKey::QueryValue(const wchar_t* const p_pValueName, |
| 184 | DWORD* const p_pValueType, |
| 185 | void* const p_pValue, |
| 186 | DWORD* const p_pValueSize) const |
| 187 | { |
| 188 | long res = ERROR_FILE_NOT_FOUND; |
| 189 | if (!Locked()) { |
| 190 | res = m_UserKey.QueryValue(p_pValueName, p_pValueType, p_pValue, p_pValueSize); |
| 191 | } else { |
| 192 | res = ERROR_ACCESS_DENIED; |
| 193 | } |
| 194 | if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA && m_GlobalKey.Valid()) { |
| 195 | res = m_GlobalKey.QueryValue(p_pValueName, p_pValueType, p_pValue, p_pValueSize); |
| 196 | } |
| 197 | return res; |
| 198 | } |
| 199 | |
| 200 | // |
| 201 | // Scans both the user and global keys and returns a list of all values |