Beispiel #1
0
wstring GetSettingString(const string& settingName, wstring defaultValue, bool writeDefault=false)
{
    AutoMUTEX lock(g_registryMutex);

    wstring value;

    if (!ReadRegistryStringValue(settingName.c_str(), value))
    {
        value = defaultValue;

        if (writeDefault)
        {
            RegistryFailureReason reason = REGISTRY_FAILURE_NO_REASON;
            WriteRegistryStringValue(settingName, value, reason);
        }
    }

    return value;
}
SString SharedUtil::GetVersionRegistryValueLegacy ( const SString& strVersion, const SString& strPath, const SString& strName )
{
    return ReadRegistryStringValue ( HKEY_CURRENT_USER, MakeVersionRegistryPathLegacy ( strVersion, strPath ), strName, NULL );
}
SString SharedUtil::GetCommonRegistryValue ( const SString& strPath, const SString& strName )
{
    return ReadRegistryStringValue ( HKEY_LOCAL_MACHINE, MakeVersionRegistryPath ( "Common", strPath ), strName, NULL );
}
//
// GetSystemRegistryValue
//
SString SharedUtil::GetSystemRegistryValue ( uint hKey, const SString& strPath, const SString& strName )
{
    return ReadRegistryStringValue ( (HKEY)hKey, strPath, strName, NULL );
}