@@ -120,12 +120,12 @@ bool GetStringFromRegistry(std::string path, std::string key, std::string& val)
120120#endif
121121
122122 fullPath.append (path);
123- if (getStringFromRegistry (HKEY_LOCAL_MACHINE , fullPath.c_str (), key.c_str (), val))
123+ if (getStringFromRegistry (HKEY_CURRENT_USER , fullPath.c_str (), key.c_str (), val))
124124 {
125125 return true ;
126126 }
127127
128- return getStringFromRegistry (HKEY_CURRENT_USER , fullPath.c_str (), key.c_str (), val);
128+ return getStringFromRegistry (HKEY_LOCAL_MACHINE , fullPath.c_str (), key.c_str (), val);
129129}
130130
131131bool GetUnsignedIntFromRegistry (std::string path, std::string key, unsigned int & val)
@@ -137,12 +137,12 @@ bool GetUnsignedIntFromRegistry(std::string path, std::string key, unsigned int&
137137#endif
138138
139139 fullPath.append (path);
140- if (getUnsignedIntFromRegistry (HKEY_LOCAL_MACHINE , fullPath.c_str (), key.c_str (), val))
140+ if (getUnsignedIntFromRegistry (HKEY_CURRENT_USER , fullPath.c_str (), key.c_str (), val))
141141 {
142142 return true ;
143143 }
144144
145- return getUnsignedIntFromRegistry (HKEY_CURRENT_USER , fullPath.c_str (), key.c_str (), val);
145+ return getUnsignedIntFromRegistry (HKEY_LOCAL_MACHINE , fullPath.c_str (), key.c_str (), val);
146146}
147147
148148bool SetStringInRegistry ( std::string path, std::string key, std::string val)
@@ -154,9 +154,8 @@ bool SetStringInRegistry( std::string path, std::string key, std::string val)
154154#endif
155155 fullPath.append (path);
156156
157- if (setStringInRegistry ( HKEY_LOCAL_MACHINE , fullPath, key, val))
158- return true ;
159-
157+ // TheSuperHackers @fix bobtista 12/02/2026 Always write to HKCU. Per-user settings belong
158+ // in HKEY_CURRENT_USER and writes there should always succeed without admin privileges.
160159 return setStringInRegistry ( HKEY_CURRENT_USER , fullPath, key, val );
161160}
162161
@@ -169,9 +168,8 @@ bool SetUnsignedIntInRegistry( std::string path, std::string key, unsigned int v
169168#endif
170169 fullPath.append (path);
171170
172- if (setUnsignedIntInRegistry ( HKEY_LOCAL_MACHINE , fullPath, key, val))
173- return true ;
174-
171+ // TheSuperHackers @fix bobtista 12/02/2026 Always write to HKCU. Per-user settings belong
172+ // in HKEY_CURRENT_USER and writes there should always succeed without admin privileges.
175173 return setUnsignedIntInRegistry ( HKEY_CURRENT_USER , fullPath, key, val );
176174}
177175
0 commit comments