| 25 | } |
| 26 | |
| 27 | DWORD GetSingleRegString(HKEY hBaseKey, const char *pszSubKey, const char *pszValueName, char *pszOutput, DWORD *dwOutSize) |
| 28 | { |
| 29 | HKEY hKey = NULL; |
| 30 | pszOutput[0] = '\0'; |
| 31 | |
| 32 | // Open the key |
| 33 | DWORD dwErrCode = RegOpenKeyExA(hBaseKey, pszSubKey, 0, KEY_QUERY_VALUE, &hKey); |
| 34 | if ( dwErrCode != ERROR_SUCCESS ) |
| 35 | return dwErrCode; |
| 36 | |
| 37 | // Query the value |
| 38 | dwErrCode = RegQueryValueExA(hKey, pszValueName, NULL, NULL, (LPBYTE)pszOutput, dwOutSize); |
| 39 | |
| 40 | // Close key and return error code |
| 41 | RegCloseKey(hKey); |
| 42 | return dwErrCode; |
| 43 | } |
| 44 | |
| 45 | std::string GetRegString(const char *pszSubKey, const char *pszValueName) |
| 46 | { |