| 43 | } |
| 44 | |
| 45 | std::string GetRegString(const char *pszSubKey, const char *pszValueName) |
| 46 | { |
| 47 | // Declare temporary string and size |
| 48 | char szTemp[MAX_PATH]; |
| 49 | DWORD dwSize = MAX_PATH; |
| 50 | |
| 51 | // Retrieve the key and value from HKCU |
| 52 | DWORD dwErrCode = GetSingleRegString(HKEY_CURRENT_USER, pszSubKey, pszValueName, szTemp, &dwSize); |
| 53 | // If it's not found, then search HKLM |
| 54 | if (dwErrCode != ERROR_SUCCESS) |
| 55 | { |
| 56 | /// @TODO: Check error |
| 57 | GetSingleRegString(HKEY_LOCAL_MACHINE, pszSubKey, pszValueName, szTemp, &dwSize); |
| 58 | } |
| 59 | |
| 60 | // Return the string |
| 61 | return std::string(szTemp); |
| 62 | } |
| 63 | |
| 64 | bool BWAPIError(const char *format, ...) |
| 65 | { |
no test coverage detected