Skip to content
Snippets Groups Projects
Commit ba033f37 authored by calrama's avatar calrama
Browse files

Support running without administrator rights on Windows

By default, CRegKey::Open tries to get both read and write privileges.
The latter of which are obviously going to be denied (and we don't need
them).
parent 9c9b1ae7
No related branches found
No related tags found
No related merge requests found
......@@ -72,7 +72,7 @@ std::vector<std::string> QueryKey(HKEY hKey, std::string path)
CHAR szBuffer[512];
ULONG dwBufferSize = sizeof(szBuffer);
if(auto error_code = regKey.Open(HKEY_LOCAL_MACHINE, path.c_str()); error_code != ERROR_SUCCESS)
if(auto error_code = regKey.Open(HKEY_LOCAL_MACHINE, path.c_str(), KEY_READ); error_code != ERROR_SUCCESS)
{
qWarning() << "Error opening windows registry path " << path.c_str() << ": " << error_code;
regKey.Close();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment