Add an extra option when querying Windows registry keys

(this option will be needed when 32-bit Ardour is running in 64-bit Windows)
This commit is contained in:
John Emmas 2020-11-09 11:35:35 +00:00
parent 56394b7683
commit 5f082e2c9d

View File

@ -71,5 +71,18 @@ PBD::windows_query_registry (const char *regkey, const char *regval, std::string
return true;
}
#ifndef _WIN64
// If this is a 32-bit build (but we're running in Win64) the above
// code will only search Win32 registry keys. So if we got this far
// without finding anything, force Windows to search Win64 keys too
if ( (ERROR_SUCCESS == RegOpenKeyExA (root, regkey, 0, KEY_READ | KEY_WOW64_64KEY, &key))
&& (ERROR_SUCCESS == RegQueryValueExA (key, regval, 0, NULL, reinterpret_cast<LPBYTE>(tmp), &size))
)
{
rv = Glib::locale_to_utf8 (tmp);
return true;
}
#endif
return false;
}